ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation. |
This is the base class for the ParaMonte sampler routines. More...
Public Member Functions | |
function | Sampler (in method) |
Return a scalar object of class [pm.sampling.Sampler``. More... | |
function | finalize (in self) |
Finalize the ParaMonte MATLAB sampler simulation run and return nothing. More... | |
function | findfile (in self, in ftype, in pattern) |
Return a vector of MATLAB strings containing the fully-resolved paths matching the input pattern . More... | |
function | readChain (in self, in pattern, in sep) |
Return a list of objects of class pm.sampling.FileContentsChain containing the content(s) of the ParaMonte simulation output chain file(s) whose path(s) match the specified input pattern or the simulation specification sampler.spec.outputFileName . More... | |
function | readProgress (in self, in pattern, in sep) |
Return a list of objects of class pm.sampling.FileContentsProgress containing the content(s) of the ParaMonte simulation output progress file(s) whose path(s) match the specified input pattern or the simulation specification sampler.spec.outputFileName .More... | |
function | readReport (in self, in pattern) |
Return a list of objects of class pm.sampling.FileContentsReport containing the content(s) of the ParaMonte simulation output report file(s) whose path(s) match the specified input pattern or the simulation specification sampler.spec.outputFileName .More... | |
function | readRestart (in self, in pattern) |
Return a list of objects of class pm.sampling.FileContentsRestartDRAM containing the content(s) of the ParaMonte simulation output restart file(s) whose path(s) match the specified input pattern or the simulation specification sampler.spec.outputFileName .More... | |
function | readSample (in self, in pattern, in sep) |
Return a list of objects of class pm.sampling.FileContentsSample containing the content(s) of the ParaMonte simulation output sample file(s) whose path(s) match the specified input pattern or the simulation specification sampler.spec.outputFileName .More... | |
function | run (in self, in getLogFunc, in ndim) |
Perform the basic runtime checks for the sampler and return nothing. More... | |
function | getLogFuncWrapped (in state) |
function | getLogFuncConcurrent (in state) |
Data Fields | |
Property | input |
Property | checked |
Property | mpiname |
Property | silent |
Property | spec |
Property | mexname |
Property | libtype |
Property | partype |
Property | memtype |
Property | bldtype |
Property | clstype |
Property | name |
Property | weblinks |
Property | matpath |
Property | method |
Property | ndim |
Property | nml |
Property | libspec |
This is the base class for the ParaMonte sampler routines.
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.
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.
function Sampler::Sampler | ( | in | method | ) |
Return a scalar object of class [pm.sampling.Sampler``.
This is the constructor of the class pm.sampling.Sampler.
This class is not meant to be accessed by the end users.
It merely serves as the blueprint for the sampler subclasses accessible to the end users.
[in] | method | : The input scalar MATLAB string containing the name of the target ParaMonte sampler. |
self
: The output scalar object of class pm.sampling.Sampler.
Possible calling interfaces ⛓
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.
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.
function Sampler::finalize | ( | in | self | ) |
Finalize the ParaMonte MATLAB sampler simulation run and return nothing.
[in] | self | : The input parent object of class pm.sampling.Sampler which is implicitly passed to this dynamic method (not by the user). |
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.
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.
function Sampler::findfile | ( | in | self, |
in | ftype, | ||
in | pattern | ||
) |
Return a vector of MATLAB strings containing the fully-resolved paths matching the input pattern
.
This is a Hidden
method of the class pm.sampling.Sampler.
[in] | self | : The input parent object of class pm.sampling.Sampler which is implicitly passed to this dynamic method (not by the user). |
[in] | ftype | : The input scalar MATLAB string containing the sampler file type, which can be one of the following:
|
[in] | pattern | : The input scalar MATLAB string containing either:
|
fileList
: The output vector of MATLAB strings containing the fully-resolved paths matching the input pattern
.
Possible calling interfaces ⛓
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.
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.
function Sampler::getLogFuncConcurrent | ( | in | state | ) |
function Sampler::getLogFuncWrapped | ( | in | state | ) |
function Sampler::readChain | ( | in | self, |
in | pattern, | ||
in | sep | ||
) |
Return a list of objects of class pm.sampling.FileContentsChain containing the content(s) of the ParaMonte simulation output chain file(s) whose path(s) match the specified input pattern
or the simulation specification sampler.spec.outputFileName
.
[in] | self | : The input parent object of class pm.sampling.Sampler which is implicitly passed to this dynamic method (not by the user). |
[in] | pattern | : The input scalar MATLAB string containing the pattern matching the desired chain file(s) whose contents is to be read. The specified pattern only needs to partially identify the name of the simulation to which the chain file belongs.For example, specifying "./mydir/mysim" as input will lead to a search for file(s) beginning with "mysim" and ending with "_chain.txt" inside the directory "./mydir/" .If there are multiple files matching in the input pattern , then all such files will be read and returned as elements of a list.If the specified pattern is a valid existing URL, the file will be downloaded as a temporary file to the local system, its contents shall be parsed and the file will be subsequently removed. If the input pattern is empty, then the method will search for any possible candidate files with the appropriate suffix in the current working directory.(optional, default = sampler.spec.outputFileName or "./" ) |
[in] | sep | : The input MATLAB string containing the field separator used in the file(s). (optional, default = sampler.spec.outputSeparator or automatically inferred.) |
chainList
: The output MATLAB cell array of objects of class pm.sampling.FileContentsChain, each of which corresponds to the contents of a unique chain file.
Possible calling interfaces ⛓
Example usage ⛓
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.
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.
function Sampler::readProgress | ( | in | self, |
in | pattern, | ||
in | sep | ||
) |
Return a list of objects of class pm.sampling.FileContentsProgress containing the content(s) of the ParaMonte simulation output progress file(s) whose path(s) match the specified input pattern
or the simulation specification sampler.spec.outputFileName
.
[in] | self | : The input parent object of class pm.sampling.Sampler which is implicitly passed to this dynamic method (not by the user). |
[in] | pattern | : The input scalar MATLAB string containing the pattern matching the desired progress file(s) whose contents is to be read. The specified pattern only needs to partially identify the name of the simulation to which the progress file belongs.For example, specifying "./mydir/mysim" as input will lead to a search for file(s) beginning with "mysim" and ending with "_progress.txt" inside the directory "./mydir/" .If there are multiple files matching in the input pattern , then all such files will be read and returned as elements of a list.If the specified pattern is a valid existing URL, the file will be downloaded as a temporary file to the local system, its contents shall be parsed and the file will be subsequently removed. If the input pattern is empty, then the method will search for any possible candidate files with the appropriate suffix in the current working directory.(optional, default = sampler.spec.outputFileName or "./" ) |
[in] | sep | : The input MATLAB string containing the field separator used in the file(s). (optional, default = sampler.spec.outputSeparator or automatically inferred.) |
progressList
: The output MATLAB cell array of objects of class pm.sampling.FileContentsProgress, each of which corresponds to the contents of a unique progress file.
Possible calling interfaces ⛓
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.
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.
Example usage ⛓
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.
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.
function Sampler::readReport | ( | in | self, |
in | pattern | ||
) |
Return a list of objects of class pm.sampling.FileContentsReport containing the content(s) of the ParaMonte simulation output report file(s) whose path(s) match the specified input pattern
or the simulation specification sampler.spec.outputFileName
.
[in] | self | : The input parent object of class pm.sampling.Sampler which is implicitly passed to this dynamic method (not by the user). |
[in] | pattern | : The input scalar MATLAB string containing the pattern matching the desired report file(s) whose contents is to be read. The specified pattern only needs to partially identify the name of the simulation to which the report file belongs.For example, specifying "./mydir/mysim" as input will lead to a search for file(s) beginning with "mysim" and ending with "_report.txt" inside the directory "./mydir/" .If there are multiple files matching in the input pattern , then all such files will be read and returned as elements of a list.If the specified pattern is a valid existing URL, the file will be downloaded as a temporary file to the local system, its contents shall be parsed and the file will be subsequently removed. If the input pattern is empty, then the method will search for any possible candidate files with the appropriate suffix in the current working directory.(optional, default = sampler.spec.outputFileName or "./" ) |
reportList
: The output MATLAB cell array of objects of class pm.sampling.FileContentsReport, each of which corresponds to the contents of a unique report file.
Possible calling interfaces ⛓
Example usage ⛓
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.
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.
function Sampler::readRestart | ( | in | self, |
in | pattern | ||
) |
Return a list of objects of class pm.sampling.FileContentsRestartDRAM containing the content(s) of the ParaMonte simulation output restart file(s) whose path(s) match the specified input pattern
or the simulation specification sampler.spec.outputFileName
.
where sampler
can be an instance of any one of the ParaMonte sampler classes, such as pm.sampling.Paradram.
[in] | self | : The input parent object of class pm.sampling.Sampler which is implicitly passed to this dynamic method (not by the user). |
[in] | pattern | : The input scalar MATLAB string containing the pattern matching the desired restart file(s) whose contents is to be read. The specified pattern only needs to partially identify the name of the simulation to which the restart file belongs.For example, specifying "./mydir/mysim" as input will lead to a search for file(s) beginning with "mysim" and ending with "_restart.txt" inside the directory "./mydir/" .If there are multiple files matching in the input pattern , then all such files will be read and returned as elements of a list.If the specified pattern is a valid existing URL, the file will be downloaded as a temporary file to the local system, its contents shall be parsed and the file will be subsequently removed. If the input pattern is empty, then the method will search for any possible candidate files with the appropriate suffix in the current working directory.(optional, default = sampler.spec.outputFileName or "./" ) |
restartList
: The output MATLAB cell array of objects of class pm.sampling.FileContentsRestart, each of which corresponds to the contents of a unique restart file.
Possible calling interfaces ⛓
Example usage ⛓
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.
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.
function Sampler::readSample | ( | in | self, |
in | pattern, | ||
in | sep | ||
) |
Return a list of objects of class pm.sampling.FileContentsSample containing the content(s) of the ParaMonte simulation output sample file(s) whose path(s) match the specified input pattern
or the simulation specification sampler.spec.outputFileName
.
[in] | self | : The input parent object of class pm.sampling.Sampler which is implicitly passed to this dynamic method (not by the user). |
[in] | pattern | : The input scalar MATLAB string containing the pattern matching the desired sample file(s) whose contents is to be read. The specified pattern only needs to partially identify the name of the simulation to which the sample file belongs.For example, specifying "./mydir/mysim" as input will lead to a search for file(s) beginning with "mysim" and ending with "_sample.txt" inside the directory "./mydir/" .If there are multiple files matching in the input pattern , then all such files will be read and returned as elements of a list.If the specified pattern is a valid existing URL, the file will be downloaded as a temporary file to the local system, its contents shall be parsed and the file will be subsequently removed. If the input pattern is empty, then the method will search for any possible candidate files with the appropriate suffix in the current working directory.(optional, default = sampler.spec.outputFileName or "./" ) |
[in] | sep | : The input MATLAB string containing the field separator used in the file(s). (optional, default = sampler.spec.outputSeparator or automatically inferred.) |
sampleList
: The output MATLAB cell array of objects of class pm.sampling.FileContentsSample, each of which corresponds to the contents of a unique sample file.
Possible calling interfaces ⛓
Example usage ⛓
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.
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.
function Sampler::run | ( | in | self, |
in | getLogFunc, | ||
in | ndim | ||
) |
Perform the basic runtime checks for the sampler and return nothing.
[in,out] | self | : The input/output parent object of class pm.sampling.Sampler which is implicitly passed to this dynamic method (not by the user). |
[in] | getLogFunc | : The input MATLAB function handle or anonymous (lambda) function containing the implementation of the objective function to be sampled. This user-specified function must have the following interface, where,
|
[in] | ndim | : The input scalar positive-valued whole-number representing the number of dimensions of the domain of the user-specified objective function in the input getLogFunc() . |
Possible calling interfaces ⛓
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.
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.
Property Sampler::checked |
checked
: Optional scalar MATLAB logical.
If set to true
, then the checked (verified) versions of the ParaMonte MATLAB shared libraries will be used for simulations.
This means that most function calls and computations will be checked at runtime to ensure correctness, at the cost of noticeably slower runtime simulation speeds.
Set this option to true
only for diagnostics, testing, and development.
If set to empty, the sampler will first search for the non-checked version and if none found, will search for a checked version of the library.
Property Sampler::input |
input
: Optional scalar MATLAB string representing the path to an external input file that contains the simulation specification namelist(s).
spec
component of the sampler instance.Property Sampler::libspec |
libspec
: Optional scalar MATLAB string containing a list of colon-(:)-separated configurations of the kernel shared library to be used for the sampling task.
The most important of all is the compiler suite with which the library is built.
libspec
is parsed internally to match a corresponding library path name within the ParaMonte library.Property Sampler::mpiname |
mpiname
: Optional scalar MATLAB string representing the (vendor) name of the MPI runtime library. The following three library names are supported:
"impi"
: The Intel MPI runtime library (Windows/Linux)."mpich"
: The MPICH MPI runtime library (Linux/macOS)."openmpi"
: The OpenMPI runtime library (Linux/macOS).By default, you should set this argument to pm.lib.mpi.choice() to enable the right preferred choice of MPI-enabled ParaMonte libraries.
If for any reason, you want to use a non-preferred non-default MPI library, you can set the MPI library name explicitly as in the above list.
Beware that you must launch MATLAB with an mpiexec
binary that comes from the same MPI library vendor specified for mpiname
.
Note that the MPI-parallel ParaMonte shared libraries corresponding to the specified value for mpiname
may not exist in the ParaMonte package.
For example,
"impi"
) are guaranteed to exist, unless user builds the ParaMonte MATLAB package from GitHub source for the desired MPI library."openmpi"
) are guaranteed to exist, unless user builds the ParaMonte MATLAB package from GitHub source for the desired specified MPI library.mpiname
is an empty string, implying no use of MPI-enabled ParaMonte library routines.Property Sampler::silent |
Property Sampler::spec |