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

New constructor for MPMD::Copier #3806

Merged
merged 34 commits into from
Mar 19, 2024

Conversation

siddanib
Copy link
Contributor

Summary

A new constructor, Copier::Copier(), is created in MPMD::Copier. This constructor is ONLY for a particular setup where the utilized BoxArray is exactly the same in both MPMD codes. The empty constructor builds its BoxArray based on the BoxArray supplied by the other code. Hence, the empty constructor MUST be used in conjunction with the other code's constructor being Copier::Copier(ba, dm, true).

Src/Base/AMReX_MPMD.H Outdated Show resolved Hide resolved
Src/Base/AMReX_MPMD.H Outdated Show resolved Hide resolved
Src/Base/AMReX_MPMD.H Outdated Show resolved Hide resolved
Src/Base/AMReX_MPMD.H Outdated Show resolved Hide resolved
Src/Base/AMReX_MPMD.cpp Outdated Show resolved Hide resolved
Src/Base/AMReX_MPMD.cpp Outdated Show resolved Hide resolved
@WeiqunZhang
Copy link
Member

WeiqunZhang commented Mar 17, 2024 via email

Src/Base/AMReX_MPMD.cpp Show resolved Hide resolved
Src/Base/AMReX_MPMD.cpp Outdated Show resolved Hide resolved
Src/Base/AMReX_MPMD.cpp Outdated Show resolved Hide resolved
Src/Base/AMReX_MPMD.H Outdated Show resolved Hide resolved
Src/Base/AMReX_MPMD.H Outdated Show resolved Hide resolved
Co-authored-by: Weiqun Zhang <WeiqunZhang@lbl.gov>
siddanib and others added 4 commits March 18, 2024 11:34
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>
@siddanib
Copy link
Contributor Author

Thanks for helping me with this, @WeiqunZhang! I wanted to mention that I included a minor logic for m_is_thread_safe in the general Copier(ba,dm,false).

https://github.com/siddanib/amrex/blob/6d644be78f76d2aa930a45ffc256364deacf18b6/Src/Base/AMReX_MPMD.cpp#L251

My intention was to check if there is any overlap among cell-centered Boxes in the oba. m_is_thread_safe = false if such an overlap is detected. I hope it is consistent with the objective of MPMD::Copier.

Thanks!

@WeiqunZhang
Copy link
Member

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?

@siddanib
Copy link
Contributor Author

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 isects_o variable that I ended up including in my previous commits.

@WeiqunZhang WeiqunZhang merged commit c2b6e6b into AMReX-Codes:development Mar 19, 2024
69 checks passed
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

Successfully merging this pull request may close these issues.

2 participants