2%> Return the runtime number of MPI processes
3%> with
which the `mpiexec` launcher may have been invoked.<br>
6%> Otherwise,
return `1`
if no use of `mpiexec` launcher is
7%> detected or it is invoked with only ``1`` MPI process.<br>
9%> An output value of ``>1`` can be used as an indication of the use
10%> of the ``mpiexec`` launcher in launching the ParaMonte library.<br>
12%> \param[in]
vendor : See the corresponding argument of [pm.lib.mpi.runtime.detect](@ref
detect).<br>
13%> (**optional**. The
default is set by [pm.lib.mpi.runtime.detect](@ref
detect).)
16%> ``value`` : The output MATLAB scalar positive whole number, containing the number
17%> of MPI processes launched by the ``mpiexec`` command or ``1``
18%>
if no ``mpiexec`` invocation has occurred or ``mpiexec``
19%> has been launched with only one process or the rank
20%> inference fails.<br>
25%> value = pm.lib.mpi.runtime.nproc()
26%> value = pm.lib.mpi.runtime.nproc([])
27%> value = pm.lib.mpi.runtime.nproc(
vendor)
32%> \include{lineno} example/
lib/mpi/runtime/
nproc/main.m
34%> \include{lineno} example/
lib/mpi/runtime/
nproc/main.out.m
39%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
40%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute
for Computational Engineering and Sciences (ICES), UT Austin<br>
45 [~, value, ~] = pm.lib.mpi.runtime.detect(
vendor);
46 value = max(1, value);
50 % vendorList = string(
vendor);
52 %
if pm.array.len(vendorList) == 0
53 % vendorList = pm.lib.mpi.choices();
56 %mexname =
"pm_parallelism";
57 %
for iname = 1 : length(vendorList)
58 % mexdirs = pm.lib.path.mexdir(mexname, vendorList(iname));
59 %
for ipath = 1 : length(mexdirs)
62 % pm.lib.path.clean();
63 % path(matpath, mexdirs{ipath});
65 % %
if ~isa(mh,
'matlab.mex.MexHost') || ~isvalid(mh)
68 % %temp = feval(mh, mexname,
'getImageCountMPI');
69 % %value = max(value, temp);
70 % mexcall = string(mexname +
"('getImageCountMPI');");
72 % temp = eval(mexcall);
73 % value = max(value, temp);
function vendor(in name)
Return the MPI library vendor name from the input MPI name based on the internal ParaMonte shared lib...
function detect(in vendor)
Return the MPI image count and current image ID (e.g., MPI rank + 1) and the MPI library name as it a...
function lib()
Return a scalar MATLAB string containing the path to the lib directory of the ParaMonte library packa...
function nproc(in vendor)
Return the runtime number of MPI processes with which the mpiexec launcher may have been invoked.
function which(in vendor)
Return the a MATLAB string containing the path to the first mpiexec executable binary found in system...