2%> Return the a MATLAB
string containing the MPI library
vendor
3%>
name corresponding to the input ``mpiexec`` system path.<br>
5%> \param[in] path : The input scalar MATLAB string,
6%> containing the path to the ``mpiexec``
7%> binary whose
vendor is to be determined.<br>
8%> (**optional**,
default = [pm.sys.path.mpiexec.which()](@ref
which))
11%> ``
name`` : The output MATLAB
string containing the MPI library
vendor name ALL in lower-
case.<br>
12%> Possible values are:<br>
14%> <li> ``
"Intel"`` : representing the Intel MPI library.
15%> <li> ``
"MPICH"`` : representing the MPICH MPI library.
16%> <li> ``
"OpenMPI"`` : representing the OpenMPI library.
18%> If the
vendor name cannot be identified, the output will be empty ``
""``.<br>
23%>
name = pm.sys.path.mpiexec.vendor()
24%>
name = pm.sys.path.mpiexec.vendor(path)
29%> [pm.lib.mpi.name()](@ref
name)<br>
30%> [pm.lib.mpi.vendor()](@ref
vendor)<br>
31%> [pm.sys.path.mpiexec.vendor()](@ref
vendor)<br>
34%> \include{lineno} example/sys/path/mpiexec/
vendor/main.m
36%> \include{lineno} example/sys/path/mpiexec/
vendor/main.out.m
41%> \JoshuaOsborne, May 21 2024, 5:04 AM, University of Texas at Arlington<br>
42%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
43%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
47 path = pm.sys.path.mpiexec.which();
54 if contains(path,
".openmpi")
56 elseif contains(path, ".mpich")
61 path = strrep(path, """", "\""");
63 failed = pm.os.is.
lin() && startsWith(path, "/mnt/"); % A Windows-path application in WSL freezes MATLAB.
72 elseif contains(versionLower, "openmpi") || contains(versionLower, "open-mpi") || contains(versionLower, "openrte")
74 elseif contains(versionLower, "mpich") || contains(versionLower, "
hydra")
75 % MPICH is the most elusive, so we check it as the last possibility.
79 % On Windows (and perhaps other OS), calling ``system("mpiexec --
version")``
80 % can fail because ``mpiexec`` can refer to the MATLAB
copy of mpiexec binary.
82 % Error: no executable specified
83 % Unable to parse the mpiexec command arguments.
84 % To bypass this failure, we check if ``cpuinfo`` exists in the same path as ``mpiexec``.
85 % If so, then the mpiexec binary belongs to Intel MPI library.
86 [dirname, filename, extname] = fileparts(path);
87 if filename == "mpiexec"
88 cipath = fullfile(dirname, "cpuinfo" + extname);
91 elseif ispc() && extname ~= ".exe"
92 cipath = fullfile(dirname, "cpuinfo.exe");
function name(in vendor)
Return the MPI library name as used in naming the ParaMonte MATLAB shared library directories.
function vendor(in name)
Return the MPI library vendor name from the input MPI name based on the internal ParaMonte shared lib...
function version(in silent)
Return a scalar MATLAB string containing the latest available ParaMonte MATLAB version newer than the...
function copy(in from, in to, in field, in exclude)
Copy the contents of the struct/object from to the struct/object to recursively and without destroyin...
function hydra()
Return the MPI image count and the current image ID (e.g., MPI rank + 1) if the application has been ...
function lin()
Return true if the current OS is Linux.
function which(in vendor)
Return the a MATLAB string containing the path to the first mpiexec executable binary found in system...