Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix beam_search ABORT when enable openmp and OMP_NUM_THREADS > 1 #767

Merged
merged 3 commits into from
Apr 11, 2021

Conversation

huangjq0617
Copy link
Contributor

@huangjq0617 huangjq0617 commented Dec 1, 2020

fix beam_search ABORT_IF(beamHypIdx >= beam.size(), "Out of bounds beamHypIdx??"); when enable openmp and OMP_NUM_THREADS > 1

Description

Please add a clear and concise description of the changes.

This PR fixes a bug. When enable openmp and OMP_NUM_THREADS > 1, compiler is g++ 5.4, the swapAxes call in beam_search.h sometimes get wrong result. This can lead to abort with "Out of bounds beamHypIdx??", which is caused by activating an inactive beam.

List of changes:

  • move "int oi, oj, ok;" to inner loop, avoid

Added dependencies: none

How to test

Describe how to test your changes, adding command line examples and sample input/output files if relevant.
Point to unit tests or regression tests covering the changes if they have been added.

Describe how you have tested your code, including OS and the cmake command.

Checklist

  • [√] I have tested the code manually
  • [√] I have run regression tests
  • [√] I have read and followed CONTRIBUTING.md
  • I have updated CHANGELOG.md

@emjotde
Copy link
Member

emjotde commented Apr 11, 2021

Forgot about this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants