Comments (4)
Even if the issues reported by @bosilca are addressed, I do not think this can work:
since subarrays are passed to MPI_Isend()
and MPI_Irecv()
, temporary flattened arrays are allocated by the Fortran runtime and deallocated when these subroutines return, which typically occurs before the data is sent or received, and hence undefined behavior which can be a crash.
Bottom line, subarrays should not be used with non blocking communications for now.
Note the MPI standard defines the MPI_SUBARRAYS_SUPPORTED
and MPI_ASYNC_PROTECTS_NONBLOCKING
"macros" and they are currently both .false.
under Open MPI.
from ompi.
There are some major issues with this code, let me highlight two:
- you posted your intent to communicate (
MPI_Isend
andMPI_Irecv
) but you never checked if the communications completed (MPI_Wait*
orMPI_Test*
). Until they are completed you are not supposed to use (for the receiver) or alter (for the sender) the buffers used in nonblocking communications. - you are sending and receiving from the exact same buffer. What exactly do you expect to find inside, the original or the new values ? If you really want to replace the data you should use
MPI_Sendrecv_replace
.
Additional suggestions for improving this code:
- Open MPI does not have support for Fortran array descriptions (aka. CFI_desc_t). This means that the Fortran compiler will have to flatten each subarray you are sending as a packed array. Your datatype will still work, but you need to keep in mind the performance implication of this additional internal data management
- I would suggest you change your communication pattern to be
MPI_Irecv
followed byMPI_Isend
, to make sure all communications are expected on the receiver side.
from ompi.
@bosilca Thank you very much for your kind and helpful reply. The original code works well after adding the MPI_Wait
operations. I have a question about the difference between the combination of MPI_Isend & MPI_Irecv
and MPI_Sendrecv_replace
. In the above code, since different ranks own different values of one variable, the replacement operation is done by using the same buffer and then overwriting it with the MPI_Irecv
operation. I am not clear about if there is any risk of doing so and the difference between this and using MPI_Sendrecv_replace
. Looking forward to your reply.
from ompi.
@ggouaillardet Thank you for your suggestion. It really helped me understand the issue better.
from ompi.
Related Issues (20)
- when i run mpi program using ASAN, asan reports some memory leaks HOT 1
- Error when using MPI_Comm_spawn with ULFM enabled HOT 6
- MPI_Status_f082f not part of the mpi_f08 interface HOT 13
- coll_tuned_dynamic_rules_filename option no way to set alltoall_algorithm_max_requests from the rules file
- coll_tuned_use_dynamic_rules wrong scoping for tools interface
- Fflush(stdout) doesn't work as expected. HOT 6
- DVM environment variable? HOT 3
- Error while building from source openmpi 5.0.3 HOT 1
- Fault tolerant error when re spawn process in mpiexec in remote node
- fortran .mod files installed in libdir instead of includedir HOT 34
- PMIX_ERROR when MPI_Comm_spawn in multiple nodes HOT 12
- coll tuned alltoall algorithm ignored after initialization
- Build fail on Mac M3 with macOS clang 15 HOT 1
- Mystery error on exit HOT 4
- pkgconfig files not installed with `--enable-script-wrapper-compilers` HOT 3
- mpirun nccl-test hang HOT 1
- cannot MPI_File_open a one-character filename, deletes external file anyways HOT 4
- Reduce_local Segmentation fault when Running with IMB-MPI1 built for GPU HOT 3
- mpirun 5.0.3 has bug on parse shell args while 4.1.6 works well. HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ompi.