ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
verify.m
Go to the documentation of this file.
1%> \brief
2%> Verify the existence of ParaMonte-compatible MPI
3%> library installations on the current system.<br>
4%>
5%> \param[in] vendor : The input scalar MATLAB string, containing the MPI
6%> library vendor supported by the ParaMonte library.<br>
7%> Possible values are:<br>
8%> <ol>
9%> <li> ``OpenMPI``, representing the OpenMPI library.<br>
10%> <li> ``MPICH``, representing the MPICH MPI library.<br>
11%> <li> ``Intel``, representing the Intel MPI library.<br>
12%> <li> ``any``, representing any available MPI library.<br>
13%> Specifying this value can force the function to
14%> return as soon as any ParaMonte-compatible MPI library
15%> installation is detected on the current system.<br>
16%> <li> ``all``, representing all available MPI library.<br>
17%> Specifying this value can lead to a comprehensive
18%> search for all available ParaMonte-compatible
19%> MPI installations on the system, which may
20%> time-consuming on some platforms.<br>
21%> This comprehensive system-level search
22%> only if the initial shallow search for
23%> the ParaMonte-compatible MPI library
24%> installations fails.<br>
25%> </ol>
26%> or any other informal name returned by the ParaMonte
27%> MATLAB function [pm.lib.mpi.name()](@ref name).<br>
28%> Note that **all values are case-insensitive**.<br>
29%> (**optional, default = ``"any"``.)
30%>
31%> \return
32%> ``failed`` : The output scalar MATLAB ``logical`` that is ``true``
33%> if and only if the MPI library verification fails.<br>
34%>
35%> \interface{verify}
36%> \code{.m}
37%>
38%> failed = pm.lib.mpi.verify()
39%> failed = pm.lib.mpi.verify(vendor)
40%>
41%> \endcode
42%>
43%> \example{verify}
44%> \include{lineno} example/lib/mpi/verify/main.m
45%> \output{verify}
46%> \include{lineno} example/lib/mpi/verify/main.out.m
47%>
48%> \final{verify}
49%>
50%> \author
51%> \JoshuaOsborne, May 21 2024, 7:18 PM, University of Texas at Arlington<br>
52%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
53%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
54function failed = verify(vendor)
55
56 failed = false;
57
58 if nargin < 1
59 vendor = [];
60 end
61
62 if isempty(vendor)
63 vendor = "";
64 end
65
66 % isall = strcmpi(vendor, "all");
67 % isany = strcmpi(vendor, "any");
68 % if isany || isall
69 % vendors = ["Intel", "MPICH", "OpenMPI"];
70 % else
71 % vendors = string(vendor);
72 % end
73 %
74 % mpiFound = false(numel(vendors), 1);
75 % for iven = numel(vendors)
76 %
77 % mpiVendor = vendors(iven);
78 % mpiVendorLower = lower(mpiVendor);
79 %
80 % disp("Checking for the " + mpiVendor + " MPI library installations...")
81 %
82 % [mpiname, ~, ~] = pm.lib.mpi.runtime.detect(mpiVendor);
83 %
84 % mpiFound(iven) = ~strcmp(mpiname, "");
85 % if mpiFound(iven)
86 % disp(pm.io.tab + "An " + mpiVendor + " MPI (runtime) library installation possibly exists on the system.")
87 % else
88 % disp(pm.io.tab + "None detected.")
89 % end
90 %
91 % end
92
93 %%%%
94 %%%% Perform a brute-force search for MPI installations.
95 %%%%
96
97 % if ~any(mpiFound)
98 if pm.sys.path.mpiexec.verify(vendor);
99 failed = true;
100 end
101 % end
102
103end
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 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 lib()
Return a scalar MATLAB string containing the path to the lib directory of the ParaMonte library packa...
function which(in vendor)
Return the a MATLAB string containing the path to the first mpiexec executable binary found in system...