Get PID of processes spawn by mpiexec RRS feed

  • Question

  • Hello.

    I'm trying to get PIDs of processes spawn by mpiexec.

    For the purpose I've tried to use MSMPI_PRINT_ENVIRONMENT_BLOCK and MSMPI_PRINT_ENVIRONMENT_BLOCK_FILE, so I could get PID from file name.

    I've tries to run the following command:


    and it does not make any difference and files are not created.

    Can anyone please help me with that?

    Wednesday, October 16, 2019 12:56 PM

All replies

  • Dzmitry,

    specifying MSMPI_PRINT_ENVIRONMENT_BLOCK in the command line will work with the executable built with msmpi. In case it is just any executable (whoami, etc), the environment block will not be printed.

    PID is not a part of output for MSMPI_PRINT_ENVIRONMENT_BLOCK. smpd process outputs PIDs as part of its debug output, but it is only being printed out as part of the shutdown sequence.

    mpiexec -d 3 -n 2 hostname


    [01:45308] process_id=0 rank=1 refcount=0, waiting for the process to finish exiting.
    [01:45308] creating an exit command for process id=0  rank=1, pid=29584, exit code=0.
    [01:45308] posting command SMPD_EXIT to parent, src=1, dest=0.
    [01:45308] Handling cmd=SMPD_STDOUT result


    -thanks, Anna



    • Edited by Anna Daly Thursday, October 31, 2019 9:39 PM
    Thursday, October 31, 2019 9:16 PM