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

Go to the source code of this file.

Functions

function find (in vendor)
 Return a list of scalar MATLAB strings containing the paths to all detected mpiexec binaries installed on the system and available in the environment path variable.
More...
 

Function Documentation

◆ find()

function find ( in  vendor)

Return a list of scalar MATLAB strings containing the paths to all detected mpiexec binaries installed on the system and available in the environment path variable.

The search strategy is to parse and search the paths in the environmental PATH variable of the runtime processor shell and return all mpiexec paths.
Also, all mpiexec paths found via pm.sys.path.mpiexec.which(vendor) are returned.
Additionally, if vendor is missing or is set to "Intel", also search the default installation directories of Intel MPI libraries on all operating systems.
Think of this functionality pm.sys.path.mpiexec.find(vendor) as a more comprehensive of what pm.sys.path.mpiexec.which(vendor) does.

Warning
In Microsoft Windows Subsystem for Linux (WSL) environments, this function may freeze MATLAB indefinitely, if Windows paths containing MPI installations exist within the environmental variable PATH.
Such paths typically begin with /mnt/ and are automatically prepended by WSL to the contents of the PATH variable.
This problem happens because Windows applications cannot be executed from within a WSL terminal, freezing the terminal indefinitely.
The best solution is to remove Windows paths from the contents of the environment variable PATH of the WSL terminals.
See this StackOverflow question for possible solutions.
Parameters
[in]vendor: The input scalar MATLAB string, containing the MPI library vendor that should match the mpiexec binary.
Possible values are:
  1. Intel, representing the Intel MPI library.
  2. MPICH, representing the MPICH MPI library.
  3. OpenMPI, representing the OpenMPI library.
(optional, default = "")
Returns
pathList : A list of scalar MATLAB strings containing the paths to all detected mpiexec binaries installed on the system.
If the mpiexec is not found or does not match the specified vendor, the output will be an empty list [].


Possible calling interfaces

pathList = pm.sys.path.mpiexec.find()
pathList = pm.sys.path.mpiexec.find(vendor)
function vendor(in name)
Return the MPI library vendor name from the input MPI name based on the internal ParaMonte shared lib...


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
4pm.matlab.show()
5pm.matlab.show('pm.sys.path.mpiexec.find()')
6 pm.sys.path.mpiexec.find()
7
8pm.matlab.show()
9pm.matlab.show('pm.sys.path.mpiexec.find("intel")')
10 pm.sys.path.mpiexec.find("intel")
11
12pm.matlab.show()
13pm.matlab.show('pm.sys.path.mpiexec.find("mpich")')
14 pm.sys.path.mpiexec.find("mpich")
15
16pm.matlab.show()
17pm.matlab.show('pm.sys.path.mpiexec.find("openmpi")')
18 pm.sys.path.mpiexec.find("openmpi")
function root()
Return a scalar MATLAB string containing the root directory of the ParaMonte library package.

Example output
1
2pm.sys.path.mpiexec.find()
3ans =
4 1x4 string array
5 Column 1
6 "/mnt/c/Program Files (x86)/Intel/oneAPI/mpi/latest/bin/mpiexec.exe"
7 Columns 2 through 3
8 "/usr/bin/mpiexec.mpich" "/usr/bin/mpiexec"
9 Column 4
10 "/opt/intel/oneapi/mpi/latest/bin/mpiexec"
11
12pm.sys.path.mpiexec.find("intel")
13ans =
14 1x2 string array
15 Column 1
16 "/mnt/c/Program Files (x86)/Intel/oneAPI/mpi/latest/bin/mpiexec.exe"
17 Column 2
18 "/opt/intel/oneapi/mpi/latest/bin/mpiexec"
19
20pm.sys.path.mpiexec.find("mpich")
21ans =
22 "/usr/bin/mpiexec.mpich"
23
24pm.sys.path.mpiexec.find("openmpi")
25ans =
26 "/usr/bin/mpiexec"


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:
Joshua Alexander Osborne, May 21 2024, 5:03 AM, University of Texas at Arlington
Fatemeh Bagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.
Amir Shahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin