29#ifndef _util_group_memmtmpi_h
30#define _util_group_memmtmpi_h
35#define OMPI_SKIP_MPICXX
36#define MPICH_SKIP_MPICXX
39#include <util/group/message.h>
40#include <util/group/memamsg.h>
41#include <util/group/thread.h>
42#include <util/misc/regtime.h>
66 unsigned int *nreq_sent_;
67 unsigned int *nreq_sent_buf_;
69 MTMPIThread **thread_;
74 void init_mtmpimg(MPI_Comm comm,
int nthreads);
81 int current_datareq_index_;
82 std::vector<MemoryDataRequest> datareqs_;
83 std::vector<MPI_Request> datareqs_mpireq_;
85 int current_data_index_;
86 std::vector<double*> databufs_;
87 std::vector<MPI_Request> databufs_mpireq_;
91 int next_buffer(
int &counter);
93 int next_buffer(
int &counter,
94 std::vector<MPI_Request> &reqs);
100 void retrieve_data(
void *,
int node,
long offset,
long size,
int lock);
101 void replace_data(
void *,
int node,
long offset,
long size,
int unlock);
102 void sum_data(
double *data,
int node,
long doffset,
long dsize);
104 friend class MTMPIThread;
111 MPI_Comm comm = MPI_COMM_WORLD);
The ActiveMsgMemoryGrp abstract class specializes the MsgMemoryGrp class.
Definition memamsg.h:97
This MemoryGrp class requires a MT-safe MPI implementation.
Definition memmtmpi.h:52
void sync()
Synchronizes all the nodes.
void deactivate()
Deactivate is called after the memory has been used.
MTMPIMemoryGrp(const Ref< MessageGrp > &msg, const Ref< ThreadGrp > &th, MPI_Comm comm=MPI_COMM_WORLD)
Construct a MTMPIMemoryGrp given a MessageGrp, ThreadGrp, and an MPI communicator.
void activate()
Activate is called before the memory is to be used.
MTMPIMemoryGrp(const Ref< KeyVal > &)
Construct a MTMPIMemoryGrp given a KeyVal input object.
Ref< MemoryGrp > clone()
Returns a copy of this MemoryGrp specialization that provides an independent communication context.
int size(int node)
Returns the amount of memory residing on node.
Definition memory.h:161
distsize_t offset(int node)
Returns the global offset to node's memory.
Definition memory.h:164
A template class that maintains references counts.
Definition ref.h:361
Contains all MPQC code up to version 3.
Definition mpqcin.h:14