Home:ALL Converter>MPI on Windows: how to detect available library and processor count

MPI on Windows: how to detect available library and processor count

Ask Time:2022-10-06T15:18:40         Author:Federico Perini

Json Formatter

I would like to automate detection of an MPI library under Windows 10/11 via a script. So far the only options would be MPICH2 or MS-MPI, so I'd like to:

  • Find an available installation (search for mpiexec.exe or spmd.exe)

For this, I'm currently running

# where mpiexec
C:\Program Files\Microsoft MPI\Bin\mpiexec.exe

and I can search for "Microsoft MPI" or "MPICH2" in the path string, but that's certainly not a general approach.

  • Detect the available number of CPUs on the local machine.

Is the following command general?

mpiexec -n *

Thanks of any help

Author:Federico Perini,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/73969943/mpi-on-windows-how-to-detect-available-library-and-processor-count
yy