MADNESS 0.10.1
madness::archive::ParallelOutputArchive< localarchiveT > Class Template Reference

An archive for storing local or parallel data wrapping a BinaryFstreamOutputArchive. More...

#include <parallel_archive.h>

Inheritance diagram for madness::archive::ParallelOutputArchive< localarchiveT >:
Collaboration diagram for madness::archive::ParallelOutputArchive< localarchiveT >:

Public Types

using basear = BaseParallelArchive<localarchiveT>
Public Types inherited from madness::archive::BaseOutputArchive
using is_saving = std::true_type
 Type used by Boost.Serialization to determine if this object is an output archive.
Public Types inherited from madness::archive::BaseArchive
using is_loading = std::false_type
 Type used by Boost.Serialization to determine if this object is an input archive.
using is_saving = std::false_type
 Type used by Boost.Serialization to determine if this object is an output archive.

Public Member Functions

 ParallelOutputArchive (World &world, const char *filename, int nio=1)
 Creates a parallel archive for output with given base filename and number of I/O nodes.
 ParallelOutputArchive (World &world, const std::string filename, int nio=1)
 Creates a parallel archive for output with given base filename and number of I/O nodes.
 ParallelOutputArchive (World &world, localarchiveT &ar, int nio=1)
 Default constructor.
void flush ()
 Flush any data in the archive.
Public Member Functions inherited from madness::archive::BaseParallelArchive< BinaryFstreamOutputArchive >
 BaseParallelArchive (World &world, BinaryFstreamOutputArchive &ar, int nio)
void broadcast (objT &obj, ProcessID root) const
 Same as world.gop.broadcast_serializable(obj, root).
void close ()
 Closes the parallel archive.
bool dofence () const
 Check if we should fence around a read/write operation.
World * get_world () const
 Returns a pointer to the world.
ProcessID io_node (ProcessID rank) const
 Returns the process doing I/O for given node.
bool is_io_node () const
 Returns true if this node is doing physical I/O.
BinaryFstreamOutputArchive & local_archive () const
 Returns a reference to the local archive.
ProcessID my_io_node () const
 Returns the process doing I/O for this node.
int num_io_clients () const
 Returns the number of I/O clients for this node, including self (zero if not an I/O node).
std::enable_if_t< std::is_same< X, BinaryFstreamInputArchive >::value||std::is_same< X, BinaryFstreamOutputArchive >::value, void > open (World &world, const char *filename, int nwriter=1)
 Opens the parallel archive.
void set_dofence (bool dofence)
 Set the flag for fencing around a read/write operation.
void set_nclient (World &world)
Public Member Functions inherited from madness::archive::BaseArchive
 BaseArchive ()

Additional Inherited Members

Static Public Member Functions inherited from madness::archive::BaseParallelArchive< BinaryFstreamOutputArchive >
static std::enable_if_t< std::is_same< X, BinaryFstreamInputArchive >::value||std::is_same< X, BinaryFstreamOutputArchive >::value, bool > exists (World &world, const char *filename)
 Returns true if the named, unopened archive exists on disk with read access.
static std::enable_if_t< std::is_same< X, BinaryFstreamInputArchive >::value||std::is_same< X, BinaryFstreamOutputArchive >::value, void > remove (World &world, const char *filename)
 Deletes the files associated with the archive of the given name.
Static Public Attributes inherited from madness::archive::BaseParallelArchive< BinaryFstreamOutputArchive >
static const bool is_parallel_archive
 Mark this class as a parallel archive.
Static Public Attributes inherited from madness::archive::BaseOutputArchive
static constexpr bool is_output_archive = true
 Flag to determine if this object is an output archive.
Static Public Attributes inherited from madness::archive::BaseArchive
static constexpr bool is_archive = true
 Flag to determine if this object is an archive.
static constexpr bool is_input_archive = false
 Flag to determine if this object is an input archive.
static constexpr bool is_output_archive = false
 Flag to determine if this object is an output archive.
static constexpr bool is_parallel_archive = false
 Flag to determine if this object is a parallel archive.

Detailed Description

template<class localarchiveT = BinaryFstreamOutputArchive>
class madness::archive::ParallelOutputArchive< localarchiveT >

An archive for storing local or parallel data wrapping a BinaryFstreamOutputArchive.

Note
Writes of process-local objects only store the data from process zero.
Writes of parallel containers (presently only WorldContainer) store all data.

Each of the server or I/O nodes creates a BinaryFstreamOutputArchive with the name filename.rank. Client processes send their data to servers in a round-robin fashion.

Process zero records the number of writers so that, when the archive is opened for reading, the number of readers is forced to match.

Member Typedef Documentation

◆ basear

template<class localarchiveT = BinaryFstreamOutputArchive>
using madness::archive::ParallelOutputArchive< localarchiveT >::basear = BaseParallelArchive<localarchiveT>

Constructor & Destructor Documentation

◆ ParallelOutputArchive() [1/3]

template<class localarchiveT = BinaryFstreamOutputArchive>
madness::archive::ParallelOutputArchive< localarchiveT >::ParallelOutputArchive ( World & world,
localarchiveT & ar,
int nio = 1 )
inline

◆ ParallelOutputArchive() [2/3]

template<class localarchiveT = BinaryFstreamOutputArchive>
madness::archive::ParallelOutputArchive< localarchiveT >::ParallelOutputArchive ( World & world,
const char * filename,
int nio = 1 )
inline

Creates a parallel archive for output with given base filename and number of I/O nodes.

Parameters
[in]worldThe world.
[in]filenameBase name of the file.
[in]nioThe number of I/O nodes.

References madness::filename, madness::archive::BaseParallelArchive< BinaryFstreamOutputArchive >::nio, madness::archive::BaseParallelArchive< localarchiveT >::open(), and madness::archive::BaseParallelArchive< BinaryFstreamOutputArchive >::world.

◆ ParallelOutputArchive() [3/3]

template<class localarchiveT = BinaryFstreamOutputArchive>
madness::archive::ParallelOutputArchive< localarchiveT >::ParallelOutputArchive ( World & world,
const std::string filename,
int nio = 1 )
inline

Creates a parallel archive for output with given base filename and number of I/O nodes.

Parameters
[in]worldThe world.
[in]filenameBase name of the file.
[in]nioThe number of I/O nodes.

References madness::filename, madness::archive::BaseParallelArchive< BinaryFstreamOutputArchive >::nio, madness::archive::BaseParallelArchive< localarchiveT >::open(), and madness::archive::BaseParallelArchive< BinaryFstreamOutputArchive >::world.

Member Function Documentation

◆ flush()

template<class localarchiveT = BinaryFstreamOutputArchive>
void madness::archive::ParallelOutputArchive< localarchiveT >::flush ( )
inline

The documentation for this class was generated from the following file: