I want to create a cluster dynamically, with say 5 nodes . I want to have members join with communicate and accept.
(something like - https://stackoverflow.com/questions/43858346/trying-to-start-another-process-and-join-it-via-mpi-but-getting-access-violation)
Sample code attached (its code from the stackflow page)
Now instead of creating one point to point communication, I want to use multiple threads each having its own communicator using end point.
But I am unable to understand ,how it can be done .
Can someone please provide an example.
You can find information about multiple endpoints feature here (including code samples which demonstrate required code changes):
The same samples are also available in installed IMPI package at <impi_install_path>/doc/examples. Please note that multi-ep feature is supported only for Linux version of Intel MPI 2019.
Regarding your example - when all processes will be started and connected using common communicator you need to duplicate this communicator for each thread. After that each i-th thread can communicate with i-th threads in other processes and for example you can do data parallelization between threads (i.e. splitting of single MPI operation between threads) or parallelization on per-operation layer (i.e. spreading of separate MPI operations between threads).