-
Notifications
You must be signed in to change notification settings - Fork 24
Pywrapper for ba convert, surroundingnodes, and mf.copy #439
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
Pywrapper for ba convert, surroundingnodes, and mf.copy #439
Conversation
| } | ||
|
|
||
| py_MultiFab | ||
| .def("copymf", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for some reason, calling this copy did not seem to work
May be there is another copy method that is shadowing this
so I renamed it as copymf and that works!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this different than the copy method exposed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried using the copy_mfab in the python script and it did not work
So now I am not sure
they look similar, but copy_mfab did not work for me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
discussed offline
.copy creates another copy and does not do what we want in this PR
where we copy the values from a src to dst multifab and the dst multifab is already allocated and initialized.
fe25313 to
7bcd163
Compare
7bcd163 to
88c6008
Compare
This PR exposes the multifab register so that when we create a local copy using pyamrex interface in a python script, 1. the multifab gets allocated and initialized 2. this allows the multifab to also be redistributed during load balancing 3. when finalize is called, the multifab memory is cleared in a clean way This PR AMReX-Codes/pyamrex#439) adds wrappers to ba.convert, ba.surroundingNodes, mf.copy so now , we could add a new "test_mf" with desired nodality ``` reg.alloc_init("test_nf",0,warpx.boxArray(0).convert(amrex.IntVect(1,1)),warpx.DistributionMap(0), 1,amrex.IntVect(1,1),0.0,True,True) ``` <img width="637" alt="Screenshot 2025-05-14 at 10 58 19 AM" src="https://github.com/user-attachments/assets/ecc3a5ae-9ce1-4b32-82ad-169167d8dfdb" /> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Remi Lehe <[email protected]>
This PR exposes the multifab register so that when we create a local copy using pyamrex interface in a python script, 1. the multifab gets allocated and initialized 2. this allows the multifab to also be redistributed during load balancing 3. when finalize is called, the multifab memory is cleared in a clean way This PR AMReX-Codes/pyamrex#439) adds wrappers to ba.convert, ba.surroundingNodes, mf.copy so now , we could add a new "test_mf" with desired nodality ``` reg.alloc_init("test_nf",0,warpx.boxArray(0).convert(amrex.IntVect(1,1)),warpx.DistributionMap(0), 1,amrex.IntVect(1,1),0.0,True,True) ``` <img width="637" alt="Screenshot 2025-05-14 at 10 58 19 AM" src="https://github.com/user-attachments/assets/ecc3a5ae-9ce1-4b32-82ad-169167d8dfdb" /> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Remi Lehe <[email protected]>
This PR exposes the multifab register so that when we create a local copy using pyamrex interface in a python script, 1. the multifab gets allocated and initialized 2. this allows the multifab to also be redistributed during load balancing 3. when finalize is called, the multifab memory is cleared in a clean way This PR AMReX-Codes/pyamrex#439) adds wrappers to ba.convert, ba.surroundingNodes, mf.copy so now , we could add a new "test_mf" with desired nodality ``` reg.alloc_init("test_nf",0,warpx.boxArray(0).convert(amrex.IntVect(1,1)),warpx.DistributionMap(0), 1,amrex.IntVect(1,1),0.0,True,True) ``` <img width="637" alt="Screenshot 2025-05-14 at 10 58 19 AM" src="https://github.com/user-attachments/assets/ecc3a5ae-9ce1-4b32-82ad-169167d8dfdb" /> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Remi Lehe <[email protected]>
No description provided.