IntelligentSoftwareSystems / Galois

Galois: C++ library for multi-core and multi-node parallelization
http://iss.ices.utexas.edu/?p=projects/galois
Other
310 stars 131 forks source link

Question about sssp-pull.cpp #394

Closed Steamgjk closed 2 years ago

Steamgjk commented 2 years ago

https://github.com/IntelligentSoftwareSystems/Galois/blob/59d5aa54b4a7b6594660bb1b18b83ae6875b954c/lonestar/analytics/distributed/sssp/sssp_pull.cpp#L187-L188

I feel the if branch can never be entered. Is there any specical consideration?

Steamgjk commented 2 years ago

I think I know why. The implementation of min is different from std::min (as what I thought) Its makes the first para (snode.dist_current) as min(snode.dist_current, new_dist), but returns the original value of the first parameter.

https://github.com/IntelligentSoftwareSystems/Galois/blob/59d5aa54b4a7b6594660bb1b18b83ae6875b954c/libgalois/include/galois/AtomicHelpers.h#L78-L85