48ParaCommMpi::tagStringTable[] = {
61 TAG_STR(TagRacingRampUpParamSets),
84 ofs.open(s.str().c_str());
109 std::ostringstream s;
111 ofs.open(s.str().c_str());
121 MPI_Abort(MPI_COMM_WORLD, 0);
143 int previousRank =
myRank - 1;
144 if( previousRank == 0 )
152 MPI_Status mpiStatus;
154 MPI_Probe(MPI_ANY_SOURCE, MPI_ANY_TAG,
myComm, &mpiStatus)
156 receivedTag = mpiStatus.MPI_TAG;
157 TAG_TRACE (Probe, From, mpiStatus.MPI_SOURCE, receivedTag);
241 MPI_Init( &argc, &argv );
263 int provided, claimed;
265 MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided)
267 MPI_Query_thread( &claimed );
269 assert(provided == MPI_THREAD_MULTIPLE);
270 if (provided < MPI_THREAD_MULTIPLE)
272 std::cerr <<
"Error: the MPI library doesn't provide the required thread level" << std::endl;
273 MPI_Abort(MPI_COMM_WORLD, 0);
281 MPI_Get_processor_name(pprocName, &
namelen)
341 const int datatypeId,
355 const int datatypeId,
371 const int datatypeId,
378 MPI_Isend( buffer, count,
datatypes[datatypeId], dest, tag,
myComm, req )
388 const int datatypeId,
393 MPI_Status mpiStatus;
395 MPI_Recv( buffer, count,
datatypes[datatypeId], source, tag,
myComm, &mpiStatus )
408 MPI_Status mpiStatus;
412 MPI_Probe(source, MPI_ANY_TAG,
myComm, &mpiStatus)
418 MPI_Probe(source, tag,
myComm, &mpiStatus)
423 (*receivedTag) = mpiStatus.MPI_TAG;
424 TAG_TRACE (Probe, From, source, (*receivedTag));
429 assert( tag == mpiStatus.MPI_TAG );
430 (*receivedTag) = mpiStatus.MPI_TAG;
431 TAG_TRACE (Probe, From, source, (*receivedTag));
442 MPI_Status mpiStatus;
444 MPI_Probe(MPI_ANY_SOURCE, MPI_ANY_TAG,
myComm, &mpiStatus)
446 *source = mpiStatus.MPI_SOURCE;
447 *tag = mpiStatus.MPI_TAG;
459 MPI_Status mpiStatus;
463 MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG,
myComm, &flag, &mpiStatus)
470 MPI_Iprobe(MPI_ANY_SOURCE, *tag,
myComm, &flag, &mpiStatus)
475 *source = mpiStatus.MPI_SOURCE;
476 *tag = mpiStatus.MPI_TAG;
486 MPI_Datatype datatype,
491 MPI_Bcast( buffer, count, datatype, root,
myComm )
500 MPI_Datatype datatype,
506 MPI_Send( buffer, count, datatype, dest, tag,
myComm )
517 MPI_Datatype datatype,
524 MPI_Isend( buffer, count, datatype, dest, tag,
myComm, req )
535 MPI_Datatype datatype,
540 MPI_Status mpiStatus;
542 MPI_Recv( buffer, count, datatype, source, tag,
myComm, &mpiStatus )
double startTime
start time of this communicator
bool probe(int *source, int *tag)
probe function which waits a new message
virtual int send(void *bufer, int count, const int datatypeId, int dest, const int tag)
send function for standard ParaData types
bool iProbe(int *source, int *tag)
iProbe function which checks if a new message is arrived or not
void solverInit(ParaParamSet *paraParamSet)
initializer for Solvers
static MPI_Datatype datatypes[TYPE_LIST_SIZE]
data type mapping table to MPI data type
int receive(void *bufer, int count, const int datatypeId, int source, const int tag)
receive function for standard ParaData types
int token[2]
index 0: token index 1: token color -1: green > 0: yellow ( termination origin solver number ) -2: re...
MPI_Comm myComm
MPI communicator.
virtual bool tagStringTableIsSetUpCoorectly()
check if tag string table (for debugging) set up correctly
bool tagTraceFlag
indicate if tags are traced or not
std::deque< ParaIsendRequest * > iSendRequestDeque
int myRank
rank of this process
std::ostream * tos
output file stream for tag trace to change file name
virtual const char * getTagString(int tag)
get Tag string for debugging
int iSend(void *bufer, int count, const int datatypeId, int dest, const int tag, MPI_Request *req)
send function for standard ParaData types
virtual void passToken(int rank)
pass token to from the rank to the next
char procName[MPI_MAX_PROCESSOR_NAME]
process name
int ubcast(void *buffer, int count, MPI_Datatype datatype, int root)
User type bcast for created data type.
int namelen
length of this process name
static const char * tagStringTable[]
table for tag name string
int ureceive(void *bufer, int count, MPI_Datatype datatype, int source, int tag)
User type receive for created data type.
pthread_mutex_t tokenAccessLock
mutex for pthread thread
int iUsend(void *bufer, int count, MPI_Datatype datatype, int dest, int tag, MPI_Request *req)
User type send for created data type.
int getRank()
get rank of caller's thread
int myCommSize
communicator size : number of processes joined in this system
virtual void init(int argc, char **argv)
initializer of this communicator
virtual ~ParaCommMpi()
destructor of this communicator
void abort()
abort. How it works sometimes depends on communicator used
virtual bool passTermToken(int rank)
pass termination token from the rank to the next
int bcast(void *buffer, int count, const int datatypeId, int root)
broadcast function for standard ParaData types
void waitSpecTagFromSpecSource(const int source, const int tag, int *receivedTag)
wait function for a specific tag from a specific source coming from
int usend(void *bufer, int count, MPI_Datatype datatype, int dest, int tag)
User type send for created data type.
std::ofstream ofs
output file stream for tag trace
virtual bool waitToken(int rank)
wait token when UG runs with deterministic mode
static ScipParaParamSet * paraParamSet
static const int ParaUNSIGNED_LONG
static const int TagAckCompletion
static const int TagCompletionOfCalculation
static const int TagWinner
static const int TagSolution
static const int ParaUNSIGNED_SHORT
static const int TagToken
static const int TagTaskReceived
static const int TagInterruptRequest
static const int TagNotificationId
static const int TagIncumbentValue
static const int N_MPI_TAGS
-1 : no tag
static const int ParaLONG_DOUBLE
static const int TagTerminated
static const int ParaLONG
static const int TagTerminateRequest
static const int ParaBYTE
static const int ParaUNSIGNED
static const int TagRampUp
static const int TagSolverState
static const int TagHardTimeLimit
static const int Deterministic
static const int ParaFLOAT
static const int TYPE_LIST_SIZE
static const int TagTraceFileName
static const int ParaBOOL
static const int ParaCHAR
static const int TagDiffSubproblem
static const int ParaSHORT
static const int TagTrace
static const int ParaUNSIGNED_LONG_LONG
static const int ParaLONG_LONG
static const int ParaUNSIGNED_CHAR
static const int ParaDOUBLE
static const int ParaSIGNED_CHAR
#define TAG_TRACE(call, fromTo, sourceDest, tag)
ParaComm extension for MPI communication.
#define MPI_CALL(mpicall)
#define THROW_LOGICAL_ERROR4(msg1, msg2, msg3, msg4)
iSend request data structure
Fundamental Tag definitions.