2%> Install or provide instructions to
install the MPI
3%> library from the requested input MPI ``
vendor``.<br>
6%> Currently,
this function can only
install the
7%> Intel MPI runtime libraries on Linux or Windows.<br>
8%> For other MPI vendors, it can only provide installation instructions.<br>
10%> \param[in]
vendor : The input scalar or vector MATLAB string, containing the
11%> MPI library
vendor supported by the ParaMonte library.<br>
12%> Possible values are:<br>
14%> <li> ``OpenMPI``, representing the OpenMPI library.<br>
15%> <li> ``MPICH``, representing the MPICH MPI library.<br>
16%> <li> ``Intel``, representing the Intel MPI library.<br>
17%> <li> ``all``, representing all available MPI library.<br>
18%> Specifying
this value can lead to a comprehensive
19%> search
for all available ParaMonte-compatible
20%> MPI installations on the system,
which may
21%> time-consuming on some platforms.<br>
22%> This comprehensive system-level search
23%> only
if the initial shallow search
for
24%> the ParaMonte-compatible MPI library
25%> installations fails.<br>
27%> Note that **all values are
case-insensitive**.<br>
28%> (**optional,
default = ``
"Intel"`` on platforms supported by the Intel MPI library, otherwise ``
"all"``.)
29%> \param[in]
isyes : The input scalar MATLAB ``logical`.<br>
30%> If provided, it will serve as the answer to the question displayed on the prompt by
31%> the function to confirm whether the user wants to
install the MPI libraries or not.<br>
32%> This functionality becomes important when interaction with users through the prompt is impossible.<br>
33%> (**optional. If missing or empty, the user will be prompted
for an answer.)
36%> ``failed`` : The output scalar MATLAB ``logical`` that is ``
true``
if and only
if
37%> the MPI library installation or its instruction display fails.<br>
42%> failed = pm.lib.mpi.install();
43%> failed = pm.lib.mpi.install(
vendor);
44%> failed = pm.lib.mpi.install(
vendor, []);
46%> failed = pm.lib.mpi.install([],
isyes);
51%> This function has side-effects by printing messages on screen.<br>
54%> \include{lineno} example/
lib/mpi/
install/main.m
56%> \include{lineno} example/
lib/mpi/
install/main.out.m
61%> \AmirShahmoradi, 11:51 PM Monday, November 11, 2024, Dallas, TX<br>
79 mpiVendorList = ["Intel", "MPICH", "OpenMPI"];
81 mpiVendorList = [
string(
vendor)];
87 %%%% Read the MPI installation instructions.
92 fprintf('%s\n\n', strrep(fileread(msgfile),
char(13), ''));
96 +
string(me.identifier) + " : " +
string(me.message) + newline ...
97 + "Failed to read the contents of the following file:" + newline ...
99 + pm.io.
tab + """" + msgfile + """" + newline ...
101 + "The ParaMonte MATLAB library integrity appears compromised." + newline ...
102 + "You can download the latest
version of the library from: " + newline ...
110 %%%% Install the Intel runtime library if requested.
113 if any(contains(pm.
lib.mpi.
vendor(mpiVendorList), "Intel")) && ~ismac
115 promptmsg = "Would you like to
install the Intel MPI runtime libraries on this system now (requires internet access)? (y/n)";
120 itis = pm.io.
isyes(promptmsg);
126 auxfile = fullfile(auxpath, ".deps." + pm.os.
namel() + ".mpi.intel");
130 mpifile = strrep(strrep(fileread(auxfile),
char(13), ''),
char(10), '');
131 binlink =
weblinks.github.releases.download.
auxil.url + "/" + mpifile;
132 binpath = websave(fullfile(auxpath, mpifile), binlink);
134 disp("The binary file is stored at: """ + binpath + """");
136 disp("Executing binary file...");
137 disp("Please use the default recommended installation settings if and when prompted.");
140 [failed, cmdout] = system(binpath, "-echo");
142 [failed, cmdout] = system("chmod +x " + binpath + " && " + binpath, "-echo");
144 failed = failed ~= 0;
147 warning ( newline ...
148 + "Failed to execute the Intel MPI installation binary file." + newline ...
149 + "Here is the terminal output:" + newline ...
151 + strjoin(
string(cmdout), newline) + newline ...
153 + "You can
install the MPI library by manually executing the binary located at:" + newline ...
155 + pm.io.
tab + binpath + newline ...
157 + "Skipping the Intel MPI installation..." + newline ...
165 warning ( newline ...
166 +
string(me.identifier) + " : " +
string(me.message) + newline ...
167 + "Failed to read the contents of the following file:" + newline ...
169 + pm.io.
tab + """" + auxfile + """" + newline ...
171 + "The ParaMonte MATLAB library integrity appears compromised." + newline ...
172 + "You can download the latest
version of the library from: " + newline ...
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 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 isyes(in question)
Return a scalar MATLAB logical that is true if the user response to a question on the MATLAB command ...
function lib()
Return a scalar MATLAB string containing the path to the lib directory of the ParaMonte library packa...
function namel()
Return a MATLAB string containing the lower-case name of the current OS.
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...