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%> \include{lineno} example/sys/path/mpiexec/
vendor/main.m
31%> \include{lineno} example/sys/path/mpiexec/
vendor/main.out.m
36%> \JoshuaOsborne, May 21 2024, 5:04 AM, University of Texas at Arlington<br>
37%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
38%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
42 path = pm.sys.path.mpiexec.which();
49 if contains(path,
".openmpi")
51 elseif contains(path, ".mpich")
56 path = strrep(path, """", "\""");
58 failed = pm.os.is.
lin() && startsWith(path, "/mnt/"); % A Windows-path application in WSL freezes MATLAB.
66 elseif contains(versionLower, "openmpi") || contains(versionLower, "open-mpi") || contains(versionLower, "openrte")
68 elseif contains(versionLower, "mpich") || contains(versionLower, "hydra")
69 % MPICH is the most elusive, so we check it as the last possibility.
73 % On Windows (and perhaps other OS), calling ``system("mpiexec --
version")``
74 % can fail because ``mpiexec`` can refer to the MATLAB
copy of mpiexec binary.
76 % Error: no executable specified
77 % Unable to parse the mpiexec command arguments.
78 % To bypass this failure, we check if ``cpuinfo`` exists in the same path as ``mpiexec``.
79 % If so, then the mpiexec binary belongs to Intel MPI library.
80 [dirname, filename, extname] = fileparts(path);
81 if filename == "mpiexec"
82 cipath = fullfile(dirname, "cpuinfo" + extname);
85 elseif ispc() && extname ~= ".exe"
86 cipath = fullfile(dirname, "cpuinfo.exe");
function name(in vendor)
Return the MPI library name as used in naming the ParaMonte MATLAB shared libraries.
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 fields)
Copy the contents of the struct/object from to the struct/object to recursively and without destroyin...
function lin()
Return true if the current OS is Linux.
function vendor(in path)
Return the a MATLAB string containing the MPI library vendor name corresponding to the input mpiexec ...
function which(in vendor)
Return the a MATLAB string containing the path to the first mpiexec executable binary found in system...