You can post-process and analyze an existing ParaMonte simulation in Python irrespective of when and how this simulation was generated by any of the available ParaMonte library interfaces (e.g., C/C++, Fortran, MATLAB, Python, …). This is one of the many unique features of the ParaMonte library.

The ParaMonte Python library is particularly suitable for post-processing the output of large-scale high-performance ParaMonte simulations performed in C/C++/Fortran.

Post-processing an existing ParaDRAM simulation

To analyze an existing ParaDRAM simulation, all you need to do is to specify the full-filename or minimally, the prefix by which the simulation output filenames have been created. For example, suppose we want to reanalyze this output mvn_serial_process_1_sample.txt sample file from an existing simulation. All that we need to do to read this file, is to pass the local path to this file on your system to an instance of the ParaDRAM class of the ParaMonte Python library.

Suppose we have stored this file in "./temp/mvn_serial_process_1_sample.txt" locally on the system, with respect to the current working directory of the Python session. Then,

import paramonte as pm
pmpd = pm.ParaDRAM() # instantiate an object of class ParaDRAM.
pmpd.readSample(file = "./temp/mvn_serial_process_1_sample.txt") # read the downloaded sample file and store it in the newly-created pmpd.sampleList property.
pmpd.sampleList[0].df.head() # this newly-created pmpd.sampleList Python-list property contains the contents of the sample file and other relevant tools.


Done. The rest of the postprocessing of the simulation data, such as statistical analysis or plotting, is identical to the Python examples provided on this page.

Alternative method:

Alternatively, we could also specify both the filename and delimiter as attributes of the pmpd object and avoid passing them directly to the pmpd.readSample() method,

import paramonte as pm
pmpd = pm.ParaDRAM() # instantiate an object of class ParaDRAM.
pmpd.spec.outputFileName = "./temp/mvn_serial_process_1_sample.txt"
pmpd.spec.outputDelimiter = ","
pmpd.readSample() # read the downloaded sample file and store it in the newly-created pmpd.sampleList property.
pmpd.sampleList[0].df.head() # this newly-created pmpd.sampleList Python-list property contains the contents of the sample file and other relevant tools.


If you have any questions about the topics discussed on this page, feel free to ask in the comment section below, or raise an issue on the GitHub page of the library, or reach out to the ParaMonte library authors.