2%> Verify the existence of ParaMonte-compatible
3%> MPI library installations on the current system
4%>
using a brute-force system path search.<br>
7%> Because of the intensive nature of the search,
8%>
this algorithm may take some time to accomplish
9%> the task on some platforms with large file systems.<br>
11%> The installation detection is performed by searching
for
12%> available `mpiexec` MPI-launcher binaries
for different
13%> MPI library installations.<br>
15%> \param[in]
vendor : The input scalar or vector MATLAB string, containing the
16%> MPI library
vendor supported by the ParaMonte library.<br>
17%> Possible values are:<br>
19%> <li> ``OpenMPI``, representing the OpenMPI library.<br>
20%> <li> ``MPICH``, representing the MPICH MPI library.<br>
21%> <li> ``Intel``, representing the Intel MPI library.<br>
22%> <li> ``all``, representing all available MPI library.<br>
23%> Specifying
this value can lead to a comprehensive
24%> search
for all available ParaMonte-compatible
25%> MPI installations on the system,
which may
26%> time-consuming on some platforms.<br>
27%> This comprehensive system-level search
28%> only
if the initial shallow search
for
29%> the ParaMonte-compatible MPI library
30%> installations fails.<br>
32%> Note that **all values are
case-insensitive**.<br>
33%> (**optional,
default = ``
"all"``.)
36%> ``failed`` : The output scalar MATLAB ``logical`` that is ``
true``
37%>
if and only
if the ``mpiexec`` verification fails.<br>
42%> failed = pm.sys.path.mpiexec.verify()
43%> failed = pm.sys.path.mpiexec.verify(
vendor)
48%> This function has side-effects by printing messages on screen.<br>
51%> \include{lineno} example/sys/path/mpiexec/
verify/main.m
53%> \include{lineno} example/sys/path/mpiexec/
verify/main.out.m
58%> \AmirShahmoradi, 11:51 PM Monday, November 11, 2024, Dallas, TX<br>
72 mpiVendorList = ["Intel", "MPICH", "OpenMPI"];
74 mpiVendorList = [
string(
vendor)];
78 %%%% Perform a brute-force search for MPI installations.
82 mpiVendorList = ["Intel", "MPICH", "OpenMPI"];
83 for mpiVendor = mpiVendorList
84 mpiVendorLower = lower(mpiVendor);
85 disp("Checking for the " + mpiVendor + " MPI library installations. This may take a bit...")
86 mpiPathList = pm.sys.path.mpiexec.
find(mpiVendorLower);
87 if isempty(mpiPathList)
88 disp(pm.io.
tab + "None detected.")
91 disp(pm.io.
tab + "The following " + mpiVendor + " ``mpiexec`` binaries were detected:")
92 for ipath = 1 : length(mpiPathList)
93 disp(pm.io.
tab + pm.io.
tab + mpiPathList(ipath))
100 + "At least one MPI runtime library installation from vendors " + newline ...
101 + "compatible with the ParaMonte library exists on your system." + newline ...
105 + "No MPI runtime libraries were detected on your system." + newline ...
106 + "Even if you believe there is any, it is invisible to runtime shell." + newline ...
112 msgfile = fullfile(pm.
lib.path.
auxil(), ".mpi.run.msg");
114 fprintf('%s\n\n', strrep(fileread(msgfile),
char(13), ''));
118 warning ( newline ...
119 +
string(me.identifier) + " : " +
string(me.message) + newline ...
120 + "Failed to read the contents of the following file:" + newline ...
122 + pm.io.
tab + """" + msgfile + """" + newline ...
124 + "The ParaMonte MATLAB library integrity appears compromised." + newline ...
125 + "You can download the latest
version of the library from: " + newline ...
function verify(in varval, in vartype, in varsize, in varname)
Verify the type and number of elements of the input varval match the specified input vartype and vars...
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 auxil()
Return a scalar MATLAB string containing the path to the auxil directory of the ParaMonte library pac...
function find(in vendor)
Return a list of scalar MATLAB strings containing the paths to all detected mpiexec binaries installe...
function href(in url)
Return an HTML-style decoration of the input URL if the ParaMonte MATLAB library is used in GUI,...
function install(in vendor, in isyes)
Install or provide instructions to install the MPI library from the requested input MPI vendor.
function lib()
Return a scalar MATLAB string containing the path to the lib directory of the ParaMonte library packa...
function tab()
Return a scalar MATLAB string containing 4 blank characters equivalent to a tab character.
function weblinks()
Return a structure containing tree of weblinks for the ParaMonte MATLAB library source file and docum...
function which(in vendor)
Return the a MATLAB string containing the path to the first mpiexec executable binary found in system...