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

Go to the source code of this file.

Functions

function readReport (in sampler, in pattern)
 Return a list of objects of superclass pm.sampling.FileContentsReport containing the contents of a (set of) ParaMonte simulation output report file(s) whose paths match the specified input pattern or the simulation specification sampler.spec.outputFileName.
More...
 

Function Documentation

◆ readReport()

function readReport ( in  sampler,
in  pattern 
)

Return a list of objects of superclass pm.sampling.FileContentsReport containing the contents of a (set of) ParaMonte simulation output report file(s) whose paths match the specified input pattern or the simulation specification sampler.spec.outputFileName.

Warning
This function is to be only used for post-processing of the output report file(s) of an already finished simulation.
Although possible, this method is NOT meant to be called by all processes in MPI-parallel simulations.
Parameters
[in]sampler: The input object of superclass pm.sampling.Sampler whose type and properties determine the type of the output object(s).
(optional. If empty, it is set to pm.sampling.Sampler().)
[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. If empty, it is set to sampler.spec.outputFileName or if empty, it is set to "./".)
Returns
reportList : The output MATLAB cell array of objects of superclass pm.sampling.FileContentsReport, each of which corresponds to the contents of a unique ParaMonte sampler report file.
  1. If the input argument sampler is of type pm.sampling.Sampler, then the output array elements are of type pm.sampling.FileContentsReport.
  2. If the input argument sampler is of type pm.sampling.Paradram, then the output array elements are of type pm.sampling.FileContentsReport.


Possible calling interfaces

reportList = pm.sampling.readReport();
reportList = pm.sampling.readReport([]);
reportList = pm.sampling.readReport([], []);
reportList = pm.sampling.readReport([], pattern);
reportList = pm.sampling.readReport(sampler, []);
reportList = pm.sampling.readReport(sampler, pattern);
Note
See the documentation of the subclasses of pm.sampling.Sampler (e.g., pm.sampling.Paradram) for example usage in action.


Example usage

sampler = pm.sampling.Sampler();
reportList = pm.sampling.readReport("./out/test_run_");
reportList = pm.sampling.readReport([], "./out/test_run_");
reportList = pm.sampling.readReport(sampler, "./out/test_run_");
sampler.spec.outputFileName = "./out/test_run_";
reportList = pm.sampling.readReport(sampler, []);
reportList = pm.sampling.readReport(sampler);


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, Saturday Nov 2 2024, 11:11 PM, Dallas, TX.
Fatemeh Bagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.