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 | getppm (in self) |
Generate and return the relevant Post-Processing Message (ppm) for the current ParaMonte sampler to be displayed on the MATLAB command line after the sampling is complete. More... | |
function | readChain (in self, in pattern, in sep, in varargin) |
Return a list of objects of superclass 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.FileContentsRestart 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 superclass 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 subclasses of pm.sampling.Sampler 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.
This is a private
and Hidden
dynamic 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). |
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::getppm | ( | in | self | ) |
Generate and return the relevant Post-Processing Message (ppm) for the current ParaMonte sampler to be displayed on the MATLAB command line after the sampling is complete.
This is a private
dynamic method of the pm.sampling.Paradram sampler class.
This method is not meant to be used or accessed by the end users.
[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::readChain | ( | in | self, |
in | pattern, | ||
in | sep, | ||
in | varargin | ||
) |
Return a list of objects of superclass 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 superclass 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.) |
[in] | varargin | : Any set of arguments that must be directly passed to the relevant file contents parser class. (optional. default is empty, corresponding to no extra input arguments.) |
chainList
: The output MATLAB cell array of objects of superclass 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 ⛓
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.FileContentsRestart 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 superclass 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::bldtype |
bldtype
A Hidden
scalar MATLAB string containing the build type of the ParaMonte Fortran library that is to be called.
The value of this component is determined at runtime depending on the availability of the ParaMonte Fortran library.
The runtime value is among the values returned by the ParaMonte MATLAB library function pm.lib.bldtypes().
Hidden
class component must not be accessed by the end users of the library.Property Sampler::checked |
checked
The public
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::clstype |
clstype
A Hidden
scalar MATLAB string containing the type of the ParaMonte Fortran library parallelization that is to be called.
Although the default value is serial
, the class methods will internally set this component to the right parallelization type at runtime.
Hidden
class component must not be accessed by the end users of the library.Property Sampler::input |
input
The public
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::libtype |
libtype
A Hidden
scalar MATLAB string containing the type of the ParaMonte Fortran library that is to be called.
Although both static
and shared
may be possible, this value must always remain as shared
.
Hidden
class component must not be accessed by the end users of the library.Property Sampler::matpath |
Property Sampler::memtype |
memtype
A Hidden
scalar MATLAB string containing the memory usage type of the ParaMonte Fortran library that is to be called.
Although both heap
and stack
may be possible, this value must always remain as heap
.
Hidden
class component must not be accessed by the end users of the library.Property Sampler::method |
Property Sampler::mexname |
Property Sampler::mpiname |
mpiname
The public
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).These names are normally one of the possible values returned by pm.lib.mpi.choices().
By default, the ParaMonte samplers should be capable of detecting the right MPI runtime libraries and the ParaMonte library files.
If the automated MPI detection fails or for any reason, or you want to use a non-preferred non-default MPI library, you can set this argument explicitly to one of the values returned by pm.lib.mpi.choices() to enable your preferred choice of MPI-enabled ParaMonte libraries.
Beware that you must launch MATLAB with an mpiexec
binary that comes with the same MPI library vendor string specified for mpiname
.
The simulation task will mostly likely fail if the MPI-parallel ParaMonte shared libraries corresponding to the specified value for mpiname
do not exist in the ParaMonte package.
For example,
mpiname
is an empty string, implying no specific use of MPI-enabled ParaMonte library routines, unless the mpiexec
launcher with more than one process is detected at runtime.Property Sampler::name |
name
A Hidden
scalar MATLAB string containing the name of the user-created object of superclass pm.sampling.Sampler.
This name is determined at runtime via the MATLAB intrinsic function inputname()
.
Hidden
class component must not be accessed by the end users of the library.Property Sampler::ndim |
Property Sampler::nml |
Property Sampler::partype |
partype
A Hidden
scalar MATLAB string containing the parallelization type of the ParaMonte Fortran library that is to be called.
Although the default value is serial
, the class methods will internally set this component to the right parallelization type at runtime.
Hidden
class component must not be accessed by the end users of the library.Property Sampler::silent |
Property Sampler::spec |
Property Sampler::weblinks |
weblinks
A Hidden
scalar MATLAB object of class pm.lib.weblinks containing the relevant ParaMonte library web links.
Hidden
class component must not be accessed by the end users of the library.