83 virtual int write(
const int *data,
int count) {
return send_buff->
write(data, count); }
84 virtual int write(
const long *data,
int count) {
return send_buff->
write(data, count); }
85 virtual int write(
const unsigned long *data,
int count) {
return send_buff->
write(data, count); }
86 virtual int write(
const double *data,
int count) {
return send_buff->
write(data, count); }
87 virtual int write(
const char *data,
int count) {
return send_buff->
write(data, count); }
88 virtual int write(
bool data) {
return send_buff->
write(data); }
91 virtual int read(
int *data,
int count) {
return this->recv_buff->
read(data, count); }
92 virtual int read(
long *data,
int count) {
return this->recv_buff->
read(data, count); }
93 virtual int read(
unsigned long *data,
int count) {
return this->recv_buff->
read(data, count); }
94 virtual int read(
double *data,
int count) {
return this->recv_buff->
read(data, count); }
95 virtual int read(
char *data,
int count) {
return this->recv_buff->
read(data, count); }
96 virtual int read(
bool &data) {
return recv_buff->
read(data); }
122 result &= initSend(rank, tag);
123 result &= initReceive(rank, tag);
240 template<
class T >
void setToSendArry(T *emodel,
const IntArray &src,
int packUnpackType);
251 template<
class T >
void setToRecvArry(T *emodel,
const IntArray &src,
int packUnpackType);
262 giveProcessCommunicatorBuff()->initForPacking();
263 return ( emodel->*packFunc )(* this);
279 giveProcessCommunicatorBuff()->initForPacking();
280 return ( emodel->*packFunc )(src, *
this);
295 giveProcessCommunicatorBuff()->initForUnpacking();
296 return ( emodel->*unpackFunc )(* this);
312 giveProcessCommunicatorBuff()->initForUnpacking();
313 return ( emodel->*unpackFunc )(dest, *
this);
324 int initExchange(
int tag);
331 int initSend(
int tag);
338 int initReceive(
int tag);
340 int finishExchange();
346 int receiveCompleted();
347 int testCompletion();
348 int waitCompletion();
364 template<
class T >
int resizeSendBuff(T *emodel,
int packUnpackType);
374 template<
class T >
int resizeRecvBuff(T *emodel,
int packUnpackType);
377 template<
class T >
void 383 resizeSendBuff(emodel, packUnpackType);
387 template<
class T >
void 393 resizeRecvBuff(emodel, packUnpackType);
397 template<
class T >
int 402 size = emodel->estimateMaxPackSize(toSend, * giveProcessCommunicatorBuff()->giveSendBuff(), packUnpackType);
403 giveProcessCommunicatorBuff()->resizeSendBuffer(size);
409 template<
class T >
int 415 size = emodel->estimateMaxPackSize(toReceive, * giveProcessCommunicatorBuff()->giveRecvBuff(), packUnpackType);
416 giveProcessCommunicatorBuff()->resizeReceiveBuffer(size);
422 #endif // processcomm_h virtual int resize(int newSize)=0
Resizes buffer to given size.
int packData(T *emodel, int(T::*packFunc)(ProcessCommunicator &))
Pack nodal data to send buff.
virtual int givePackSizeOfLong(int count)
virtual void init()=0
Initializes buffer to empty state.
virtual int givePackSizeOfChar(int count)
virtual void initForPacking()=0
Initialize for packing.
virtual int read(unsigned long *data, int count)
Reads count unsigned long values into array pointed by data.
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
bool isEmpty() const
Checks if receiver is empty (i.e., zero sized).
virtual int givePackSizeOfBool(int count)
void setToSendArry(T *emodel, const IntArray &src, int packUnpackType)
Sets receiver toSend array to src.
virtual int givePackSizeOfInt(int count)
virtual int givePackSizeOfChar(int count)
The mode can be static, meaning that each node can assemble its communication maps independently (or ...
void resizeReceiveBuffer(int size)
CommunicationBuffer * giveRecvBuff()
Returns receive buffer of receiver.
void initForUnpacking()
Initialize for Unpacking (data already received).
virtual void initForUnpacking()=0
Initialize for Unpacking (data already received)
The ProcessCommunicator and corresponding buffers (represented by this class) are separated in order ...
int giveRank()
Returns corresponding rank of associated partition.
ProcessCommunicatorBuff * pcBuffer
Communicator buffers representation.
void init()
Initializes receiver buffers.
Class implementing an array of integers.
virtual int read(int *data, int count)=0
Reads count integer values into array pointed by data.
CommunicatorMode
The communicator mode determines the communication.
~ProcessCommunicator()
Destructor.
const IntArray * giveToSendMap()
Returns receiver to send map.
int rank
Associated partition (problem) number (rank)
virtual int iSend(int dest, int tag)=0
Starts standard mode, nonblocking send.
virtual int write(const int *data, int count)=0
Writes count integer values from array pointed by data.
CommunicatorMode mode
Mode.
int initReceive(int rank, int tag)
Initialize the receive data exchange with associate problem.
virtual int write(const int *data, int count)
Writes count integer values from array pointed by data.
CommunicationBuffer * send_buff
Send buffer.
Class CommunicationBuffer provides abstraction for communication buffer.
virtual int givePackSizeOfInt(int count)
virtual int read(char *data, int count)
Reads count char values into array pointed by data.
CommunicationBuffer * recv_buff
Receive buffer.
virtual int write(const long *data, int count)
Writes count long values from array pointed by data.
ProcessCommunicatorBuff * giveProcessCommunicatorBuff()
Returns communication buffer.
virtual int read(double *data, int count)
Reads count double values into array pointed by data.
virtual int write(bool data)
Writes a bool value.
const IntArray * giveToRecvMap()
Returns receiver to receive map.
virtual int testCompletion()=0
Tests if the operation identified by this->request is complete.
Class representing process communicator for engineering model.
virtual int write(bool data)
Writes a bool value.
IntArray toReceive
Nodes to receive.
virtual int givePackSizeOfDouble(int count)
int initExchange(int rank, int tag)
Initializes data exchange with associated problem.
virtual int waitCompletion()=0
Waits until a completion of a nonblocking communication.
virtual int read(long *data, int count)
Reads count long values into array pointed by data.
IntArray toSend
Nodes to send.
void clearBuffers()
Clears all buffer contents.
(Dynamic) In this case the communication pattern and the amount of data sent between nodes is not kno...
virtual int iRecv(int source, int tag, int count=0)=0
Starts standard mode, nonblocking receive.
virtual int givePackSizeOfDouble(int count)
void initSendBuff()
Initializes send buffer to empty state. All packed data are lost.
CommunicationBuffer * giveSendBuff()
Returns send buffer of receiver.
virtual int write(const double *data, int count)
Writes count double values from array pointed by data.
void setToRecvArry(T *emodel, const IntArray &src, int packUnpackType)
Sets receiver toRecv array to src.
void resizeSendBuffer(int size)
virtual int write(const char *data, int count)
Writes count char values from array pointed by data.
int resizeRecvBuff(T *emodel, int packUnpackType)
Resizes receive buffer to needs according to toRecv array.
int packData(T *emodel, P *src, int(T::*packFunc)(P *, ProcessCommunicator &))
Pack nodal data to send buff.
void initRecvBuff()
Initializes send buffer to empty state. All packed data are lost.
virtual int read(int *data, int count)
Reads count integer values into array pointed by data.
int resizeSendBuff(T *emodel, int packUnpackType)
Resizes send buffer to needs according to toSend array.
int unpackData(T *emodel, int(T::*unpackFunc)(ProcessCommunicator &))
Unpack nodal data from recv buff.
void initForPacking()
Initialize for packing.
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual int read(bool &data)
Reads a bool value from data.
int initSend(int rank, int tag)
Initialize the send data exchange with associate problem.
virtual int read(bool &data)
Reads a bool value from data.
virtual int write(const unsigned long *data, int count)
Writes count unsigned long values from array pointed by data.
virtual int givePackSizeOfLong(int count)
int unpackData(T *emodel, P *dest, int(T::*unpackFunc)(P *, ProcessCommunicator &))
Unpack nodal data from recv buff.
virtual int givePackSizeOfBool(int count)