ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
install.m File Reference

Go to the source code of this file.

Functions

function install (in vendor, in isyes)
 Install or provide instructions to install the MPI library from the requested input MPI vendor.
More...
 

Function Documentation

◆ install()

function install ( in  vendor,
in  isyes 
)

Install or provide instructions to install the MPI library from the requested input MPI vendor.

Currently, this function can only install the Intel MPI runtime libraries on Linux or Windows.
For other MPI vendors, it can only provide installation instructions.

Parameters
[in]vendor: The input scalar or vector MATLAB string, containing the MPI library vendor supported by the ParaMonte library.
Possible values are:
  1. OpenMPI, representing the OpenMPI library.
  2. MPICH, representing the MPICH MPI library.
  3. Intel, representing the Intel MPI library.
  4. all, representing all available MPI library.
    Specifying this value can lead to a comprehensive search for all available ParaMonte-compatible MPI installations on the system, which may time-consuming on some platforms.
    This comprehensive system-level search only if the initial shallow search for the ParaMonte-compatible MPI library installations fails.
Note that all values are case-insensitive.
(**optional, default = "Intel" on platforms supported by the Intel MPI library, otherwise "all".)
[in]isyes: The input scalar MATLAB `logical.
If provided, it will serve as the answer to the question displayed on the prompt by the function to confirm whether the user wants to install the MPI libraries or not.
This functionality becomes important when interaction with users through the prompt is impossible.
(**optional. If missing, the download question will be shown on the user prompt.)
Returns
failed : The output scalar MATLAB logical that is true if and only if the MPI library installation or its instruction display fails.


Possible calling interfaces

failed = pm.lib.mpi.install();
failed = pm.lib.mpi.install(vendor);
failed = pm.lib.mpi.install(vendor, []);
failed = pm.lib.mpi.install(vendor, isyes);
failed = pm.lib.mpi.install([], isyes);
function vendor(in name)
Return the MPI library vendor name from the input MPI name based on the internal ParaMonte shared lib...
function isyes(in question)
Return a scalar MATLAB logical that is true if the user response to a question on the MATLAB command ...
Warning
This function has side-effects by printing messages on screen.


Example usage

1cd(fileparts(mfilename('fullpath'))); % Change working directory to source code directory.
2addpath('../../../../'); % Add the ParaMonte library root directory to the search path.
3
4disp("In the following examples, the second argument is provided to bypass interaction with user through prompt questions.")
5disp("In practice, the first and the second arguments are rarely needed and can be dropped to allow real time interactions.")
6
7disp(" ")
8disp("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
9disp(" ")
10
11pm.lib.mpi.install(" ", false);
12
13disp(" ")
14disp("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
15disp(" ")
16
17pm.lib.mpi.install("Intel", false);
18
19disp(" ")
20disp("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
21disp(" ")
22
23pm.lib.mpi.install("MPICH", false);
24
25disp(" ")
26disp("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
27disp(" ")
28
29pm.lib.mpi.install("OpenMPI", false);
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 root()
Return a scalar MATLAB string containing the root directory of the ParaMonte library package.

Example output
1In the following examples, the second argument is provided to bypass interaction with user through prompt questions.
2In practice, the first and the second arguments are rarely needed and can be dropped to allow real time interactions.
3
4%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5
6The MPI runtime libraries are required ONLY for the parallel ParaMonte simulations.
7The MPI-parallel version of the ParaMonte library requires
8one of the following MPI runtime libraries:
9
10 1) Intel MPI runtime library (recommended and available only for Windows and Linux)
11
12 A) Download the Intel MPI runtime library from the Intel website and install it.
13 B) Ensure the mpiexec MPI executable binary is available on the command line in the terminal.
14 I) On Windows systems, you may have difficulty finding mpiexec in Windows terminals.
15 For this reason, Intel provides its dedicated Intel OneAPI command-prompt
16 on Windows which has all environmental paths predefined within the shell.
17 This Batch terminal may not ship with MPI runtime library installations.
18 If so, you can directly run the Intel Windows `vars.bat` Batch script within a
19 compatible Windows shell to define all environmental variables for MPI-parallel simulations.
20 By default, this script is frequently (but not always) stored in one of the following path:
21
22 "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
23 "C:\Program Files (x86)\Intel\oneAPI\mpi\latest\env\vars.bat"
24
25 II) On Linux systems, you can also directly run the Intel `vars.sh` Bash script within a
26 compatible terminal to define all necessary environmental variables for MPI-parallel simulations.
27 By default, this script is frequently (but not always) stored in the following installation path:
28
29 "/opt/intel/oneapi/mpi/latest/env/vars.sh"
30
31 2) MPICH MPI runtime library (available only for Linux and macOS/Darwin)
32
33 This can be downloaded and installed via a package manager.
34 On Linux Ubuntu systems, you can use the shell installation command:
35
36 sudo apt install mpich
37
38 On macOS/Darwin systems, you can use the Homebrew application to install MPICH:
39
40 brew install mpich && brew link mpich
41
42 If you do not have Homebrew installed on your system, you can do so by
43 typing the following command in your (Bash/zsh) shell terminal:
44
45 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
46
47 3) OpenMPI runtime library (available only for Linux and macOS/Darwin)
48
49 This can be downloaded and installed via a package manager.
50 On Linux Ubuntu systems, you can use the shell installation command:
51
52 sudo apt install openmpi-bin openmpi-common libopenmpi-dev
53
54 On macOS/Darwin systems, you can use the Homebrew application to install OpenMPI:
55
56 brew install openmpi && brew link openmpi
57
58 If you do not have Homebrew installed on your system, you can do so by
59 typing the following command in your (Bash/zsh) shell terminal:
60
61 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
62
63For more information on running MPI-parallel simulations, visit:
64
65 <a href = "www.cdslab.org/pm">www.cdslab.org/pm</a>
66
67
68%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
69
70The MPI runtime libraries are required ONLY for the parallel ParaMonte simulations.
71The MPI-parallel version of the ParaMonte library requires
72one of the following MPI runtime libraries:
73
74 1) Intel MPI runtime library (recommended and available only for Windows and Linux)
75
76 A) Download the Intel MPI runtime library from the Intel website and install it.
77 B) Ensure the mpiexec MPI executable binary is available on the command line in the terminal.
78 I) On Windows systems, you may have difficulty finding mpiexec in Windows terminals.
79 For this reason, Intel provides its dedicated Intel OneAPI command-prompt
80 on Windows which has all environmental paths predefined within the shell.
81 This Batch terminal may not ship with MPI runtime library installations.
82 If so, you can directly run the Intel Windows `vars.bat` Batch script within a
83 compatible Windows shell to define all environmental variables for MPI-parallel simulations.
84 By default, this script is frequently (but not always) stored in one of the following path:
85
86 "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
87 "C:\Program Files (x86)\Intel\oneAPI\mpi\latest\env\vars.bat"
88
89 II) On Linux systems, you can also directly run the Intel `vars.sh` Bash script within a
90 compatible terminal to define all necessary environmental variables for MPI-parallel simulations.
91 By default, this script is frequently (but not always) stored in the following installation path:
92
93 "/opt/intel/oneapi/mpi/latest/env/vars.sh"
94
95 2) MPICH MPI runtime library (available only for Linux and macOS/Darwin)
96
97 This can be downloaded and installed via a package manager.
98 On Linux Ubuntu systems, you can use the shell installation command:
99
100 sudo apt install mpich
101
102 On macOS/Darwin systems, you can use the Homebrew application to install MPICH:
103
104 brew install mpich && brew link mpich
105
106 If you do not have Homebrew installed on your system, you can do so by
107 typing the following command in your (Bash/zsh) shell terminal:
108
109 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
110
111 3) OpenMPI runtime library (available only for Linux and macOS/Darwin)
112
113 This can be downloaded and installed via a package manager.
114 On Linux Ubuntu systems, you can use the shell installation command:
115
116 sudo apt install openmpi-bin openmpi-common libopenmpi-dev
117
118 On macOS/Darwin systems, you can use the Homebrew application to install OpenMPI:
119
120 brew install openmpi && brew link openmpi
121
122 If you do not have Homebrew installed on your system, you can do so by
123 typing the following command in your (Bash/zsh) shell terminal:
124
125 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
126
127For more information on running MPI-parallel simulations, visit:
128
129 <a href = "www.cdslab.org/pm">www.cdslab.org/pm</a>
130
131Would you like to install the Intel MPI runtime libraries on this system now (requires internet access)? (y/n)
132
133%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
134
135The MPI runtime libraries are required ONLY for the parallel ParaMonte simulations.
136The MPI-parallel version of the ParaMonte library requires
137one of the following MPI runtime libraries:
138
139 1) Intel MPI runtime library (recommended and available only for Windows and Linux)
140
141 A) Download the Intel MPI runtime library from the Intel website and install it.
142 B) Ensure the mpiexec MPI executable binary is available on the command line in the terminal.
143 I) On Windows systems, you may have difficulty finding mpiexec in Windows terminals.
144 For this reason, Intel provides its dedicated Intel OneAPI command-prompt
145 on Windows which has all environmental paths predefined within the shell.
146 This Batch terminal may not ship with MPI runtime library installations.
147 If so, you can directly run the Intel Windows `vars.bat` Batch script within a
148 compatible Windows shell to define all environmental variables for MPI-parallel simulations.
149 By default, this script is frequently (but not always) stored in one of the following path:
150
151 "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
152 "C:\Program Files (x86)\Intel\oneAPI\mpi\latest\env\vars.bat"
153
154 II) On Linux systems, you can also directly run the Intel `vars.sh` Bash script within a
155 compatible terminal to define all necessary environmental variables for MPI-parallel simulations.
156 By default, this script is frequently (but not always) stored in the following installation path:
157
158 "/opt/intel/oneapi/mpi/latest/env/vars.sh"
159
160 2) MPICH MPI runtime library (available only for Linux and macOS/Darwin)
161
162 This can be downloaded and installed via a package manager.
163 On Linux Ubuntu systems, you can use the shell installation command:
164
165 sudo apt install mpich
166
167 On macOS/Darwin systems, you can use the Homebrew application to install MPICH:
168
169 brew install mpich && brew link mpich
170
171 If you do not have Homebrew installed on your system, you can do so by
172 typing the following command in your (Bash/zsh) shell terminal:
173
174 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
175
176 3) OpenMPI runtime library (available only for Linux and macOS/Darwin)
177
178 This can be downloaded and installed via a package manager.
179 On Linux Ubuntu systems, you can use the shell installation command:
180
181 sudo apt install openmpi-bin openmpi-common libopenmpi-dev
182
183 On macOS/Darwin systems, you can use the Homebrew application to install OpenMPI:
184
185 brew install openmpi && brew link openmpi
186
187 If you do not have Homebrew installed on your system, you can do so by
188 typing the following command in your (Bash/zsh) shell terminal:
189
190 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
191
192For more information on running MPI-parallel simulations, visit:
193
194 <a href = "www.cdslab.org/pm">www.cdslab.org/pm</a>
195
196
197%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
198
199The MPI runtime libraries are required ONLY for the parallel ParaMonte simulations.
200The MPI-parallel version of the ParaMonte library requires
201one of the following MPI runtime libraries:
202
203 1) Intel MPI runtime library (recommended and available only for Windows and Linux)
204
205 A) Download the Intel MPI runtime library from the Intel website and install it.
206 B) Ensure the mpiexec MPI executable binary is available on the command line in the terminal.
207 I) On Windows systems, you may have difficulty finding mpiexec in Windows terminals.
208 For this reason, Intel provides its dedicated Intel OneAPI command-prompt
209 on Windows which has all environmental paths predefined within the shell.
210 This Batch terminal may not ship with MPI runtime library installations.
211 If so, you can directly run the Intel Windows `vars.bat` Batch script within a
212 compatible Windows shell to define all environmental variables for MPI-parallel simulations.
213 By default, this script is frequently (but not always) stored in one of the following path:
214
215 "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
216 "C:\Program Files (x86)\Intel\oneAPI\mpi\latest\env\vars.bat"
217
218 II) On Linux systems, you can also directly run the Intel `vars.sh` Bash script within a
219 compatible terminal to define all necessary environmental variables for MPI-parallel simulations.
220 By default, this script is frequently (but not always) stored in the following installation path:
221
222 "/opt/intel/oneapi/mpi/latest/env/vars.sh"
223
224 2) MPICH MPI runtime library (available only for Linux and macOS/Darwin)
225
226 This can be downloaded and installed via a package manager.
227 On Linux Ubuntu systems, you can use the shell installation command:
228
229 sudo apt install mpich
230
231 On macOS/Darwin systems, you can use the Homebrew application to install MPICH:
232
233 brew install mpich && brew link mpich
234
235 If you do not have Homebrew installed on your system, you can do so by
236 typing the following command in your (Bash/zsh) shell terminal:
237
238 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
239
240 3) OpenMPI runtime library (available only for Linux and macOS/Darwin)
241
242 This can be downloaded and installed via a package manager.
243 On Linux Ubuntu systems, you can use the shell installation command:
244
245 sudo apt install openmpi-bin openmpi-common libopenmpi-dev
246
247 On macOS/Darwin systems, you can use the Homebrew application to install OpenMPI:
248
249 brew install openmpi && brew link openmpi
250
251 If you do not have Homebrew installed on your system, you can do so by
252 typing the following command in your (Bash/zsh) shell terminal:
253
254 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
255
256For more information on running MPI-parallel simulations, visit:
257
258 <a href = "www.cdslab.org/pm">www.cdslab.org/pm</a>
259
function version(in silent)
Return a scalar MATLAB string containing the latest available ParaMonte MATLAB version newer than the...
function parallel()
Return a scalar MATLAB logical that is true if and only if the current installation of MATLAB contain...
function which(in vendor)
Return the a MATLAB string containing the path to the first mpiexec executable binary found in system...


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Amir Shahmoradi, 11:51 PM Monday, November 11, 2024, Dallas, TX