fix: bounds error in mpi{f08} utilities when make_copy_before_broadcast = .true. - #1183
Conversation
5276a3b to
c227001
Compare
|
This is a clean fix, but why even keep make_copy_before_broadcast and make_copy_before_sendrecv in the code? Multiple places state it is for an old bug that should be fixed now, so do we know if this is the case? DART/assimilation_code/modules/utilities/mpi_utilities_mod.f90 Lines 128 to 131 in c227001 I know sometimes we are a little hesitant to change the namelists as to not break users' experiments, but especially if you have to edit the code to even use the mpi namelist, I don't think it would really be an issue side note make_copy_before_broadcast is not in the docs, but make_copy_before_sendrecv is: |
Yeah this is dart all over, why are we keeping things like this? I agree with you, it is better to have less code, and the code we have should work. |
Great idea, I'll set up a new issue for the future mpi updates, where I can add info about these issues and add on as I go. I'll approve this PR |
c227001 to
c759b22
Compare
Description:
When copy before broadcast is set to true, array is copied into a temporary variable. This variable was a different size to array and so gave an out-of-bounds error when doing the copy.
This pull request uses the itemcount to right-size the array copy (and copy back after broadcast).
Note you have to edit the code to switch on the mpi namelist to select "copy before broadcast" so I do not think users were hitting this, but it did trip me up debugging openmpi issues in openmpi in various containers #1118.
Fixes issue
fixes #1168
Types of changes
Documentation changes needed?
Tests
Please describe any tests you ran to verify your changes.
Running lorenz_96 with mpi (and mpi_utitiles namelist) making a copy before broadcast.
Checklist for merging
Checklist for release
Testing Datasets