3%> containing the contents of a (set of) ParaMonte simulation output report file(s) whose paths match
4%> the specified input ``pattern`` or the simulation specification ``sampler.spec.outputFileName``.<br>
7%> This function is to be only used
for post-processing of the output report file(s) of an already finished simulation.<br>
8%> Although possible,
this method is **not** meant to be called by all processes in MPI-
parallel simulations.<br>
10%> \param[in] sampler : The input
object of superclass [pm.sampling.Sampler](@ref
Sampler)
11%> whose type and properties determine the type of the output
object(s).<br>
12%> (**optional**. If empty, it is set to [pm.sampling.Sampler()](@ref
Sampler).)
13%> \param[in] pattern : The input scalar MATLAB
string containing the pattern matching
14%> the desired report file(s) whose contents is to be read.<br>
15%> The specified ``pattern`` only needs to partially identify
16%> the
name of the simulation to
which the report file belongs.<br>
17%> For example, specifying ``
"./mydir/mysim"`` as input will
18%> lead to a search
for file(s) beginning with ``
"mysim"`` and
19%> ending with ``
"_report.txt"`` inside the directory ``
"./mydir/"``.<br>
20%> If there are multiple files matching in the input ``pattern``,
21%> then all such files will be read and returned as elements of a
list.<br>
22%> If the specified pattern is a valid existing URL, the file will be
23%> downloaded as a temporary file to the local system, its contents
24%> shall be parsed and the file will be subsequently removed.<br>
25%> If the input ``pattern`` is empty, then the method will search
26%>
for any possible candidate files with the appropriate suffix
27%> in the current working directory.<br>
28%> (**optional**. If empty, it is set to ``sampler.spec.outputFileName`` or
if empty, it is set to ``
"./"``.)
31%> ``reportList`` : The output MATLAB cell array of objects of superclass [pm.sampling.FileContentsReport](@ref
FileContentsReport),
32%> each of
which corresponds to the contents of a unique ParaMonte sampler report file.<br>
34%> <li> If the input argument ``sampler`` is of type [pm.sampling.Sampler](@ref
Sampler),
35%> then the output array elements are of type [pm.sampling.FileContentsReport](@ref
FileContentsReport).<br>
36%> <li> If the input argument ``sampler`` is of type [pm.sampling.Paradram](@ref
Paradram),
37%> then the output array elements are of type [pm.sampling.FileContentsReport](@ref
FileContentsReport).<br>
43%> reportList = pm.sampling.readReport();
44%> reportList = pm.sampling.readReport([]);
45%> reportList = pm.sampling.readReport([], []);
46%> reportList = pm.sampling.readReport([], pattern);
47%> reportList = pm.sampling.readReport(sampler, []);
48%> reportList = pm.sampling.readReport(sampler, pattern);
53%> See the documentation of the subclasses of [pm.sampling.Sampler](@ref
Sampler)
54%> (e.g., [pm.sampling.Paradram](@ref
Paradram))
for example usage in action.<br>
59%> sampler = pm.sampling.Sampler();
61%> reportList = pm.sampling.readReport([],
"./out/test_run_");
62%> reportList = pm.sampling.readReport(sampler,
"./out/test_run_");
64%> sampler.spec.outputFileName =
"./out/test_run_";
66%> reportList = pm.sampling.readReport(sampler, []);
67%> reportList = pm.sampling.readReport(sampler);
74%> \AmirShahmoradi, Saturday Nov 2 2024, 11:11 PM, Dallas, TX.<br>
75%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
82 sampler = pm.sampling.Sampler();
86 if 0 < pm.array.len(sampler.spec.outputFileName)
87 pattern = string(sampler.spec.outputFileName);
93 pathList = sampler.findfile(
"report", pattern);
94 reportList = cell(numel(pathList), 1);
96 for ifile = numel(pathList) : -1 : 1
99 disp(
"processing file: """ + pathList(ifile) +
"""");
102 if isequal(
class(sampler),
"pm.sampling.Sampler") || isequal(
class(sampler),
"pm.sampling.Paradram")
103 reportList{ifile} = pm.sampling.FileContentsReport(pathList(ifile), sampler.silent, sampler.method);
105 help(
"pm.sampling.readReport")
106 disp("class(sampler)");
107 disp( class(sampler) );
109 + "Invalid input ``sampler``
object type." + newline ...
110 + "See the documentation displayed above for more " + newline ...
111 + "information on possible values for ``sampler`` argument." + newline ...
function name(in vendor)
Return the MPI library name as used in naming the ParaMonte MATLAB shared library directories.
function list()
Return a list of MATLAB strings containing the names of OS platforms supported by the ParaMonte MATLA...
This is the base class for generating objects that contain the contents of a report file generated by...
This is the ParaDRAM class for generating instances of serial and parallel Delayed-Rejection Adaptive...
This is the base class for the ParaMonte sampler routines.
function parallel()
Return a scalar MATLAB logical that is true if and only if the current installation of MATLAB contain...
function readReport(in sampler, in pattern)
Return a list of objects of superclass pm.sampling.FileContentsReport containing the contents of a (s...
function which(in vendor)
Return the a MATLAB string containing the path to the first mpiexec executable binary found in system...