36 #ifndef MADNESS_WORLD_MPIAR_H__INCLUDED
37 #define MADNESS_WORLD_MPIAR_H__INCLUDED
52 : world(&world), dest(dest), tag(tag) {};
58 world->
mpi.
Send(t, n, dest, tag);
68 : world(&world), src(src), tag(tag) {};
74 world->
mpi.
Recv(t, n, src, tag);
83 const std::size_t bufsize;
84 mutable std::vector<unsigned char> v;
88 : world(&world), dest(dest), tag(tag), bufsize(1024*1024), v(), var(v) {
96 if (v.size() > bufsize)
flush();
98 if (v.size() > bufsize)
flush();
103 world->
mpi.
Send(v.size(), dest, tag);
104 world->
mpi.
Send(&v[0], v.size(), dest, tag);
106 if (v.capacity() < 2*bufsize) v.reserve(2*bufsize);
120 mutable World* world;
123 mutable std::vector<unsigned char> v;
127 : world(&world), src(src), tag(tag), v(), var(v) {};
138 world->
mpi.
Recv(&v[0], m, src, tag);
175 #endif // MADNESS_WORLD_MPIAR_H__INCLUDED
void close()
Definition: mpiar.h:110
void flush() const
Definition: mpiar.h:101
void Recv(T *buf, long lenbuf, int src, int tag) const
Receive data of up to lenbuf elements from process dest.
Definition: worldmpi.h:313
WorldMpiInterface & mpi
MPI interface.
Definition: worldfwd.h:459
Implements archive wrapping an STL vector.
static void preamble_store(const MPIRawOutputArchive &ar)
Definition: mpiar.h:147
madness::enable_if< std::is_fundamental< T >, void >::type store(const T *t, long n) const
Definition: mpiar.h:95
Interface templates for the archives (serialization)
static void postamble_store(const MPIRawOutputArchive &ar)
Definition: mpiar.h:148
~MPIOutputArchive()
Definition: mpiar.h:114
Default implementation of pre/postamble.
Definition: archive.h:641
static void postamble_load(const MPIInputArchive &ar)
Definition: mpiar.h:169
Wraps an archive around an STL vector for output.
Definition: vecar.h:54
madness::enable_if< std::is_fundamental< T >, void >::type store(const T *t, long n) const
Definition: mpiar.h:57
madness::enable_if< madness::is_serializable< T >, void >::type store(const T *t, long n) const
Definition: vecar.h:64
const T1 &f1 return GTEST_2_TUPLE_() T(f0, f1)
Base class for output archives classes.
Definition: archive.h:583
static void preamble_load(const MPIRawInputArchive &ar)
Definition: mpiar.h:154
static void postamble_store(const MPIOutputArchive &ar)
Definition: mpiar.h:162
A parallel world with full functionality wrapping an MPI communicator.
Definition: worldfwd.h:416
int ProcessID
Used to clearly identify process number/rank.
Definition: worldtypes.h:37
const double m
Definition: gfit.cc:199
MPIOutputArchive(World &world, const ProcessID &dest, int tag=SafeMPI::MPIAR_TAG)
Definition: mpiar.h:87
static void postamble_load(const MPIRawInputArchive &ar)
Definition: mpiar.h:155
enable_if from Boost for conditionally instantiating templates based on type
Definition: enable_if.h:60
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45
void Send(const T *buf, long lenbuf, int dest, int tag=SafeMPI::DEFAULT_SEND_RECV_TAG) const
Send array of lenbuf elements to process dest.
Definition: worldmpi.h:296
static void preamble_load(const MPIInputArchive &ar)
Definition: mpiar.h:168
static void preamble_store(const MPIOutputArchive &ar)
Definition: mpiar.h:161
MPIRawOutputArchive(World &world, const ProcessID &dest, int tag=SafeMPI::MPIAR_TAG)
Definition: mpiar.h:51