MADNESS  version 0.9
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
madness::archive::BaseParallelArchive< Archive > Class Template Reference

Base class for input and output parallel archives. More...

#include <parar.h>

Public Member Functions

 BaseParallelArchive ()
 
ProcessID io_node (ProcessID rank) const
 Returns the process doing IO for given node. More...
 
ProcessID my_io_node () const
 Returns the process doing IO for this node. More...
 
int num_io_clients () const
 Returns the number of IO clients for this node including self (zero if not an IO node) More...
 
bool is_io_node () const
 Returns true if this node is doing physical IO. More...
 
Worldget_world () const
 Returns pointer to the world. More...
 
void open (World &world, const char *filename, int nwriter=1)
 Opens the parallel archive. More...
 
void close ()
 Closes the parallel archive. More...
 
Archive & local_archive () const
 Returns a reference to local archive ... throws if not an IO node. More...
 
template<typename objT >
void broadcast (objT &obj, ProcessID root) const
 Same as world.gop.broadcast_serializable(obj, root) More...
 
void remove ()
 Removes the files associated with the current archive. More...
 
bool dofence () const
 
void set_dofence (bool dofence)
 

Static Public Member Functions

static bool exists (World &world, const char *filename)
 Returns true if the named, unopened archive exists on disk with read access ... collective. More...
 
static void remove (World &world, const char *filename)
 Deletes the files associated with the archive of the given name. More...
 

Static Public Attributes

static const bool is_parallel_archive = true
 

Detailed Description

template<typename Archive>
class madness::archive::BaseParallelArchive< Archive >

Base class for input and output parallel archives.

Templated by the local archive (only tested for BinaryFstream(In/Out)putArchive).

Constructor & Destructor Documentation

template<typename Archive>
madness::archive::BaseParallelArchive< Archive >::BaseParallelArchive ( )
inline

Member Function Documentation

template<typename Archive>
template<typename objT >
void madness::archive::BaseParallelArchive< Archive >::broadcast ( objT &  obj,
ProcessID  root 
) const
inline
template<typename Archive>
void madness::archive::BaseParallelArchive< Archive >::close ( )
inline

Closes the parallel archive.

Referenced by main().

template<typename Archive>
bool madness::archive::BaseParallelArchive< Archive >::dofence ( ) const
inline
template<typename Archive>
static bool madness::archive::BaseParallelArchive< Archive >::exists ( World world,
const char *  filename 
)
inlinestatic

Returns true if the named, unopened archive exists on disk with read access ... collective.

template<typename Archive>
World* madness::archive::BaseParallelArchive< Archive >::get_world ( ) const
inline
template<typename Archive>
ProcessID madness::archive::BaseParallelArchive< Archive >::io_node ( ProcessID  rank) const
inline

Returns the process doing IO for given node.

Currently assigned in round-robin-fashion to the first nio processes except on IBM BG/P where use every 64'th

Referenced by madness::archive::BaseParallelArchive< BinaryFstreamInputArchive >::my_io_node(), madness::archive::BaseParallelArchive< BinaryFstreamInputArchive >::open(), and madness::archive::ArchiveStoreImpl< ParallelOutputArchive, WorldContainer< keyT, valueT > >::store().

template<typename Archive>
bool madness::archive::BaseParallelArchive< Archive >::is_io_node ( ) const
inline
template<typename Archive>
Archive& madness::archive::BaseParallelArchive< Archive >::local_archive ( ) const
inline
template<typename Archive>
ProcessID madness::archive::BaseParallelArchive< Archive >::my_io_node ( ) const
inline
template<typename Archive>
int madness::archive::BaseParallelArchive< Archive >::num_io_clients ( ) const
inline

Returns the number of IO clients for this node including self (zero if not an IO node)

Referenced by madness::archive::ArchiveStoreImpl< ParallelOutputArchive, WorldContainer< keyT, valueT > >::store().

template<typename Archive>
void madness::archive::BaseParallelArchive< Archive >::open ( World world,
const char *  filename,
int  nwriter = 1 
)
inline

Opens the parallel archive.

When writing a new archive, the numer of writers specified is used. When reading an existing archive, the number of ionodes is adjusted to to be the same as the number that wrote the original archive. Presently we don't have logic to handle reading an archive using fewer processes originally used to write it. If you want to fix this have a look in worlddc.h for the only spot that currently needs changing to make that work.

The default number of IO nodes is one and there is an arbitrary maximum of 50 set. On IBM BG/P the maximum is nproc/64.

template<typename Archive>
static void madness::archive::BaseParallelArchive< Archive >::remove ( World world,
const char *  filename 
)
inlinestatic

Deletes the files associated with the archive of the given name.

Presently assumes a shared file system since process zero does the deleting

template<typename Archive>
void madness::archive::BaseParallelArchive< Archive >::remove ( )
inline

Removes the files associated with the current archive.

template<typename Archive>
void madness::archive::BaseParallelArchive< Archive >::set_dofence ( bool  dofence)
inline

Member Data Documentation

template<typename Archive>
const bool madness::archive::BaseParallelArchive< Archive >::is_parallel_archive = true
static

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