2%> Return ``
true``
if and only
if the application has been invoked via
3%> an Intel MPI ``mpiexec`` launcher, otherwise,
return ``
false``.<br>
6%> This function attempts to
detect the invocation of the current MATLAB
7%> session via an Intel MPI ``mpiexec`` binary MPI launcher instance.<br>
8%> The runtime detection is achieved by checking
for runtime environment
9%> variables that the Intel MPI ``mpiexec`` binary executable defines upon launch.<br>
11%> Specifically, Intel MPI provides a
long informal
list of
12%> environment variables that are defined on every MPI process.<br>
13%> These variables may not be defined on all platforms.<br>
14%> Some are only defined at runtime,
while others are defined at compile-time.<br>
17%> <li> On **Unix systems**, the best approach to investigate the Intel-specific runtime variables
18%> is to launch the Intel ``mpiexec`` binary executable with the ``printenv`` Unix command.<br>
20%> mpiexec -np 1 printenv
22%> To see the compile-time variables and compare them with the runtime
list from the above,
try:<br>
26%> <li> On **Windows systems**, the best approach to investigate the Intel-specific runtime variables
27%> is to launch the Intel ``mpiexec`` binary executable with the ``set`` Windows batch command.<br>
29%> mpiexec -localonly -n 1 cmd /k set
31%> To see the compile-time variables and compare them with the runtime
list from the above,
try:<br>
37%> Note that all Intel-MPI-specific environment variables are prefixed with ``I_MPI_``.<br>
38%> The most persistent environment variables
for Intel ``mpiexec`` binary appear to be the following:<br>
41%> <li> ``I_MPI_INFO_STATE`` : The status code
for the Intel MPI runtime (e.g., ``0``).<br>
42%> <li> ``I_MPI_INFO_BRAND`` : The processor brand (e.g., ``12th Gen Intel(R) Core(TM) i9-12950HX``).<br>
45%> Therefore,
this function attempts to
detect the above runtime environment variables.<br>
48%> ``itis`` : The output scalar MATLAB ``logical`` that is ``
true``
49%>
if and only
if the application has been invoked via an
50%> Intel MPI ``mpiexec`` launcher, otherwise,
return ``
false``.<br>
55%> itis = pm.lib.mpi.runtime.isimpi()
60%> [pm.lib.mpi.runtime.mmpi()](@ref
mmpi)<br>
61%> [pm.lib.mpi.runtime.impi()](@ref
impi)<br>
62%> [pm.lib.mpi.runtime.ompi()](@ref
ompi)<br>
63%> [pm.lib.mpi.runtime.hydra()](@ref
hydra)<br>
64%> [pm.lib.mpi.runtime.nproc()](@ref
nproc)<br>
65%> [pm.lib.mpi.runtime.rankp1()](@ref
rankp1)<br>
66%> [pm.lib.mpi.runtime.isimpi()](@ref
isimpi)<br>
67%> [pm.lib.mpi.runtime.detect()](@ref
detect)<br>
70%> \include{lineno} example/
lib/mpi/runtime/
isimpi/main.m
72%> \include{lineno} example/
lib/mpi/runtime/
isimpi/main.out.m
77%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
78%> \AmirShahmoradi, 12:10 AM Wednesday, November 13, 2024, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
81 brand = getenv("I_MPI_INFO_BRAND");
82 state = getenv("I_MPI_INFO_STATE");
83 itis = ~isempty(brand) || ~isempty(state);
function list()
Return a list of MATLAB strings containing the names of OS platforms supported by the ParaMonte MATLA...
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 hydra()
Return the MPI image count and the current image ID (e.g., MPI rank + 1) if the application has been ...
function impi()
Return the MPI image count and the current image ID (e.g., MPI rank + 1) if the application has been ...
function isimpi()
Return true if and only if the application has been invoked via an Intel MPI mpiexec launcher,...
function lib()
Return a scalar MATLAB string containing the path to the lib directory of the ParaMonte library packa...
function mmpi()
Return the MPI image count and the current image ID (e.g., MPI rank + 1) if the application has been ...
function nproc(in vendor)
Return the runtime number of MPI processes with which the mpiexec launcher may have been invoked.
function ompi()
Return the MPI image count and the current image ID (e.g., MPI rank + 1) if the application has been ...
function rankp1(in vendor)
Return the ID (MPI rank + 1) of the current MPI image (process), starting from the number one.