-
Notifications
You must be signed in to change notification settings - Fork 365
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
New constructor for MPMD::Copier #3806
Conversation
that's right
…On Sat, Mar 16, 2024, 4:50 PM siddanib ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In Src/Base/AMReX_MPMD.cpp
<#3806 (comment)>:
> + }
+
+ ParallelDescriptor::Bcast(oprocs.data(), oprocs.size());
+
+ // procs holds mpi ranks of our boxes, and oprocs holds
+ // mpi ranks of the other program's boxes. All mpi ranks are in
+ // MPI_COMM_WORLD.
+
+ // Build communication meta-data
+ m_is_thread_safe = ba.ixType().cellCentered();
+
+ std::vector<std::pair<int,Box> > isects;
+
+ for (int i = 0; i < this_nboxes; ++i) {
+ if (procs[i] == myproc) {
+ ba.intersections(m_bv[i], isects);
Thanks for helping me with this, @WeiqunZhang
<https://github.com/WeiqunZhang> ! For this special case if we ONLY do a
copy of a (NODAL) box i to box i do you think we should also make m_is_thread_safe
= true irrespective of the BoxArray being cell centered or not?
—
Reply to this email directly, view it on GitHub
<#3806 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB37TYPWRNQQRCUBFNFUNVLYYTLDJAVCNFSM6AAAAABEXDIYN6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTSNBRGM2DQMRSGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Co-authored-by: Weiqun Zhang <WeiqunZhang@lbl.gov>
Co-authored-by: Weiqun Zhang <WeiqunZhang@lbl.gov>
Co-authored-by: Weiqun Zhang <WeiqunZhang@lbl.gov>
Co-authored-by: Weiqun Zhang <WeiqunZhang@lbl.gov>
Co-authored-by: Weiqun Zhang <WeiqunZhang@lbl.gov>
Thanks for helping me with this, @WeiqunZhang! I wanted to mention that I included a minor logic for My intention was to check if there is any overlap among cell-centered Thanks! |
I don't think the check is correct, because there are no race conditions for reading. I also don't think we need to check because under normal circumstances this is not any issue. I just made some small changes. Could you please check if it works? |
Thanks for looking into this, @WeiqunZhang! I was able to successfully perform my local MPMD tests based on the latest changes. I removed the unused |
Summary
A new constructor,
Copier::Copier()
, is created inMPMD::Copier
. This constructor is ONLY for a particular setup where the utilizedBoxArray
is exactly the same in both MPMD codes. The empty constructor builds itsBoxArray
based on theBoxArray
supplied by the other code. Hence, the empty constructor MUST be used in conjunction with the other code's constructor beingCopier::Copier(ba, dm, true)
.