Generally, O2scl objects are thread-safe in the same way that classes like std::vector<double>
are thread-safe: reads are safe and writes are unsafe. It may be useful to make objects const
to ensure that one is reading data in a thread-safe way. O2scl is designed to ensure const methods are thread-safe, unless noted. (A few classes contain mutable internal members which mean that const methods are not thread-safe, and this is noted in the class documentation.)
OpenMP support may be enabled during installation by –enable-openmp
. All OpenMP functionality is headers only, but enabling OpenMP support during installation allows O2scl to test the multithreaded behavior of o2scl::anneal_para, o2scl::mcmc_para_base, and o2scl::mcmc_para_table.
On some systems, code similar to the following may be required to ensure that the error handler is valid on each OpenMP thread.
You can test to see if OpenMP support was enabled during installation in the o2scl::o2scl_settings object of type o2scl::lib_settings_class or with acol -v
.
Currently, all MPI calls are in header classes, except for some support for parallel HDF5 which is currently being developed and not yet enabled. MPI functions are used in o2scl::anneal_para, o2scl::mcmc_para_base, and o2scl::mcmc_para_table .
You can test to see if MPI support was enabled during installation in the o2scl::o2scl_settings object of type o2scl::lib_settings_class or with acol -v
.
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).