Mpi process identifiers

I would like to get mpi application process identifiers that start with mpirun / mpiexec tools.

For example, I run my code with a resolution of 8 processes and I want to get the process IDs of all these 8 processes right at the beginning of execution to provide another tool as input.

What will be the correct way?

+1
source share
1 answer

I do not believe that there is any MPI library routine that will return the pid of the o / s process that starts the MPI process. To be absolutely accurate, I don’t think that the MPI standard requires one thing: one mapping between MPI processes and o / s processes, as well as no other cardinality of display, although I don’t think I have ever used MPI where there was neither one: one mapping between different representations of processes.

All that aside, why not just use getpidit if you're on a Linux machine? Each MPI process must receive its own pid. I think there is a Windows system call that does the same thing, but I know little about Windows.

+4
source

Source: https://habr.com/ru/post/1585076/


All Articles