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

missing atomics in node bitmap update #3

Open
tromp opened this issue Nov 1, 2023 · 0 comments
Open

missing atomics in node bitmap update #3

tromp opened this issue Nov 1, 2023 · 0 comments

Comments

@tromp
Copy link

tromp commented Nov 1, 2023

The following pragmas avoid losing some set bits when multiple threads race to set a bit in the same word. There is still a risk of two threads trying to set the exact same bit and both seeing it 0 before the update, but that's less likely (an issue that cuckatoo avoids).

			// Two bit counter for cuckoo
			if ((bucketNodes[targ] & one) != 0) {
  •   			#pragma omp atomic update
      			bucketNodes[nodesPerBucket + targ] |= one;
      		}
    
  •   		#pragma omp atomic update
      		bucketNodes[targ] |= 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

No branches or pull requests

1 participant