MADNESS  0.10.1
Public Types | Public Member Functions | List of all members
madness::archive::ParallelInputArchive< localarchiveT > Class Template Reference

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

#include <parallel_archive.h>

Inheritance diagram for madness::archive::ParallelInputArchive< localarchiveT >:
Inheritance graph
[legend]
Collaboration diagram for madness::archive::ParallelInputArchive< localarchiveT >:
Collaboration graph
[legend]

Public Types

using basear = BaseParallelArchive< localarchiveT >
 
- Public Types inherited from madness::archive::BaseInputArchive
using is_loading = std::true_type
 Type used by Boost.Serialization to determine if this object is an input archive. More...
 
- 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. More...
 
using is_saving = std::false_type
 Type used by Boost.Serialization to determine if this object is an output archive. More...
 

Public Member Functions

 ParallelInputArchive (World &world, const char *filename, int nio=1)
 Creates a parallel archive for input. More...
 
 ParallelInputArchive (World &world, const std::string filename, int nio=1)
 Creates a parallel archive for input. More...
 
 ParallelInputArchive (World &world, localarchiveT &ar, int nio=1)
 Default constructor. More...
 
- Public Member Functions inherited from madness::archive::BaseParallelArchive< BinaryFstreamInputArchive >
 BaseParallelArchive (typename std::enable_if_t< std::is_same< X, BinaryFstreamInputArchive >::value||std::is_same< X, BinaryFstreamOutputArchive >::value, int > nio=0)
 Default constructor. More...
 
 BaseParallelArchive (World &world, BinaryFstreamInputArchive &ar, int nio)
 
void broadcast (objT &obj, ProcessID root) const
 Same as world.gop.broadcast_serializable(obj, root). More...
 
void close ()
 Closes the parallel archive. More...
 
bool dofence () const
 Check if we should fence around a read/write operation. More...
 
Worldget_world () const
 Returns a pointer to the world. More...
 
ProcessID io_node (ProcessID rank) const
 Returns the process doing I/O for given node. More...
 
bool is_io_node () const
 Returns true if this node is doing physical I/O. More...
 
BinaryFstreamInputArchivelocal_archive () const
 Returns a reference to the local archive. More...
 
ProcessID my_io_node () const
 Returns the process doing I/O for this node. More...
 
int num_io_clients () const
 Returns the number of I/O clients for this node, including self (zero if not an I/O node). More...
 
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. More...
 
void remove ()
 Removes the files associated with the current archive. More...
 
void set_dofence (bool dofence)
 Set the flag for fencing around a read/write operation. More...
 
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< BinaryFstreamInputArchive >
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. More...
 
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. More...
 
- Static Public Attributes inherited from madness::archive::BaseParallelArchive< BinaryFstreamInputArchive >
static const bool is_parallel_archive
 Mark this class as a parallel archive. More...
 
- Static Public Attributes inherited from madness::archive::BaseInputArchive
static constexpr bool is_input_archive = true
 Flag to determine if this object is an input archive. More...
 
- Static Public Attributes inherited from madness::archive::BaseArchive
static constexpr bool is_archive = true
 Flag to determine if this object is an archive. More...
 
static constexpr bool is_input_archive = false
 Flag to determine if this object is an input archive. More...
 
static constexpr bool is_output_archive = false
 Flag to determine if this object is an output archive. More...
 
static constexpr bool is_parallel_archive = false
 Flag to determine if this object is a parallel archive. More...
 

Detailed Description

template<class localarchiveT = BinaryFstreamInputArchive>
class madness::archive::ParallelInputArchive< localarchiveT >

An archive for storing local or parallel data, wrapping a BinaryFstreamInputArchive.

Note
Reads of process-local objects load the values originally stored by process zero, which is then broadcast to all processes.
Reads of parallel containers (presently only WorldContainer) load all data.

The number of I/O nodes or readers is presently ignored. It is forced to be the same as the original number of writers and, therefore, you cannot presently read an archive from a parallel job with fewer total processes than the number of writers.

Member Typedef Documentation

◆ basear

template<class localarchiveT = BinaryFstreamInputArchive>
using madness::archive::ParallelInputArchive< localarchiveT >::basear = BaseParallelArchive<localarchiveT>

Constructor & Destructor Documentation

◆ ParallelInputArchive() [1/3]

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

Default constructor.

◆ ParallelInputArchive() [2/3]

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

Creates a parallel archive for input.

Parameters
[in]worldThe world.
[in]filenameBase name of the file.
[in]nioThe number of writers. Ignored, see above.

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

◆ ParallelInputArchive() [3/3]

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

Creates a parallel archive for input.

Parameters
[in]worldThe world.
[in]filenameBase name of the file.
[in]nioThe number of writers. Ignored, see above.

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


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