Issue #482: SEQ mode incorrectly requires master as current_persona for shared allocation
Dan Bonachea
Branch: bonachea/upcxx:issue482-master_ifseq
Branch: berkeleylab/upcxx:develop
Merged
Merged pull request
Merge pull request #355 into develop
Merge pull request #355 into develop
Status
Ready for review.
The first commit (8ac9ef6) is a minimal/surgical hotfix suitable for application to the 2021.3.0 release.
Examples of updated assertion failures:
////////////////////////////////////////////////////////////////////// UPC++ assertion failure: on process 0 (pcp-d-10) at <redacted>/upcxx/src/./team.cpp:60 in function: upcxx::team upcxx::team::split(upcxx::intrank_t, upcxx::intrank_t) const() When compiled in threadmode=seq, this operation requires the primordial thread using the master persona as the current persona. Applications with multi-threaded communication requirements should compile with `upcxx -threadmode=par` or `UPCXX_THREADMODE=par`. For details, please see `docs/implementation-defined.md` To have UPC++ freeze during these errors so you can attach a debugger, rerun the program with GASNET_FREEZE_ON_ERROR=1 in the environment. //////////////////////////////////////////////////////////////////////
*** FATAL ERROR (proc 0): ////////////////////////////////////////////////////////////////////// UPC++ assertion failure: on process 0 (pcp-d-10) at <redacted>/upcxx/src/backend/gasnet/runtime.cpp:1135 in function: void* upcxx::backend::gasnet::allocate(size_t, size_t, upcxx::backend::gasnet::sheap_footprint_t*) When compiled in threadmode=seq, this operation requires the primordial thread with the master persona in the persona stack. Invoking certain UPC++ functions from multiple threads requires compiling with `upcxx -threadmode=par` or `UPCXX_THREADMODE=par`. For details, please see `docs/implementation-defined.md` To have UPC++ freeze during these errors so you can attach a debugger, rerun the program with GASNET_FREEZE_ON_ERROR=1 in the environment. //////////////////////////////////////////////////////////////////////
Commits
issue #482: Disable the incorrect assertions
This disables the problematic assertions reported in issue #482, replacing them with a temporary point solution.
Add issue482 test
issue482: Split UPCXX_ASSERT_MASTER_IFSEQ into two flavors
In SEQ mode, we actually have two different preconditions wrt the master persona, so we need a macro for each.
Add comments to explain correct usage.
Update calls accordingly.
Fixes issue #482.
Update ChangeLog
device_allocator: Require master persona in SEQ mode
device_allocator heap management operations have always required the master persona in SEQ mode, but we were not enforcing or documenting that restriction. Fix both deficiencies.
Add other missing MASTER_CURRENT_IFSEQ assertions
A number of communication injection paths were not enforcing the SEQ-mode precondition requiring the master persona to be current.