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

Fixing the non-deterministic behaviour of multi-thread FA. #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/ttables.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ class TTable {
}

inline void Increment(const unsigned e, const unsigned f, const double x) {
counts[e].find(f)->second += x; // Ignore race conditions here.
// Each thread locks only the part of the table which is writing on. Other threads have access to the rest of the table to update!
#pragma omp atomic
counts[e].find(f)->second += x;.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the . at the end intended? It does not compile on my machine.

}

void NormalizeVB(const double alpha) {
Expand Down