45ParaParamSetMpi::allocateMemory(
81 int allStringParamValusesSize = 0;
90 allStringParamValusesSize += (std::strlen(paraParamString->
getValue()) + 1);
224 int len = (std::strlen(paraParamString->
getValue()) + 1);
310 const int nBlocks = 7;
312 MPI_Datatype datatype;
314 int blockLengths[nBlocks];
315 MPI_Aint displacements[nBlocks];
316 MPI_Datatype types[nBlocks];
318 MPI_Aint startAddress = 0;
319 MPI_Aint address = 0;
321 for(
int i = 0; i < nBlocks; i++ )
330 displacements[0] = 0;
334 displacements[1] = address - startAddress;
338 displacements[2] = address - startAddress;
342 displacements[3] = address - startAddress;
346 displacements[4] = address - startAddress;
350 displacements[5] = address - startAddress;
354 displacements[6] = address - startAddress;
357 MPI_Type_create_struct(nBlocks, blockLengths, displacements, types, &datatype)
367 bool reallocateStringParamValues
370 const int nMaxBlocks = 13;
372 MPI_Datatype datatype;
374 int blockLengths[nMaxBlocks];
375 MPI_Aint displacements[nMaxBlocks];
376 MPI_Datatype types[nMaxBlocks];
378 MPI_Aint startAddress = 0;
379 MPI_Aint address = 0;
386 blockLengths[nBlocks] = 1;
387 displacements[nBlocks] = 0;
388 types[nBlocks] = MPI_INT;
397 displacements[nBlocks] = address - startAddress;
398 types[nBlocks] = MPI_INT;
405 displacements[nBlocks] = address - startAddress;
406 types[nBlocks] = MPI_CHAR;
416 displacements[nBlocks] = address - startAddress;
417 types[nBlocks] = MPI_INT;
424 displacements[nBlocks] = address - startAddress;
425 types[nBlocks] = MPI_INT;
435 displacements[nBlocks] = address - startAddress;
437 types[nBlocks] = MPI_LONG;
439 types[nBlocks] = MPI_LONG_LONG;
446 displacements[nBlocks] = address - startAddress;
448 types[nBlocks] = MPI_LONG;
450 types[nBlocks] = MPI_LONG_LONG;
461 displacements[nBlocks] = address - startAddress;
462 types[nBlocks] = MPI_INT;
468 displacements[nBlocks] = address - startAddress;
469 types[nBlocks] = MPI_DOUBLE;
480 displacements[nBlocks] = address - startAddress;
481 types[nBlocks] = MPI_INT;
487 displacements[nBlocks] = address - startAddress;
488 types[nBlocks] = MPI_CHAR;
494 if( reallocateStringParamValues )
503 displacements[nBlocks] = address - startAddress;
504 types[nBlocks] = MPI_INT;
510 displacements[nBlocks] = address - startAddress;
511 types[nBlocks] = MPI_CHAR;
516 MPI_Type_create_struct(nBlocks, blockLengths, displacements, types, &datatype)
529 if( commMpi->getRank() == root )
534 MPI_Datatype datatype1;
537 MPI_Type_commit( &datatype1 )
543 MPI_Type_free( &datatype1 )
546 MPI_Datatype datatype2;
547 if( commMpi->getRank() == root )
556 MPI_Type_commit( &datatype2 )
562 MPI_Type_free( &datatype2 )
564 if( commMpi->getRank() != root )
Base class of communicator object.
bool isDefaultValue() const
check if current value is default value or not
bool getValue() const
get current parameter value
void setValue(bool value)
set parameter value
char getValue() const
get current value of this char parameter
bool isDefaultValue() const
check if current value is default value or not
void setValue(char value)
set current value of this char parameter
void setValue(int value)
set current value
bool isDefaultValue() const
check if current value is default value or not
int getValue() const
get current value of this int parameter
bool isDefaultValue() const
check if current value is default value or not
void setValue(long long value)
set current value of this long int parameter
long long getValue() const
get current value of this long int parameter
void setValue(double value)
set current value of this real parameter
bool isDefaultValue() const
check if current value is default value or not
double getValue() const
get current value of this real parameter
char * charParamValues
char parameter values
void createDiffParams()
create non default parameters for transfer
int nBoolParams
the number of bool parameters
char * stringParamValues
string parameter values: values are concatenated
MPI_Datatype createDatatype2(bool reallocateStringPramsValue)
create ParaParamSetDatatype2
int * charParams
char parameter ids
double * realParamValues
real parameter values
void setDiffParams()
set non default parameters transferred
void allocateMemory()
allocate temporary memory for transfer
int * stringParams
string parameter ids
int * intParams
int parameter ids
int * longintParams
long int parameter ids
char * boolParamValues
boolean parameter values
void freeMemory()
free allocated temporary memory for transfer
int nCharParams
the number of char parameters
int nIntParams
the number of int parameters
int bcast(ParaComm *comm, int root)
broadcast ParaParams
int * boolParams
boolean parameter ids
int nStringParams
the number of string parameters
MPI_Datatype createDatatype1()
create ParaParamSetDatatype1
int * intParamValues
int parameter values
int nRealParams
the number of real parameters
int * realParams
real parameter ids
int nLongintParams
the number of long int parameters
long long * longintParamValues
long int parameter values
int stringParamValuesSize
size of stringParameterValues area
size_t nParaParams
number of ParaParams
virtual size_t getNumCharParams()=0
get number of char parameters
ParaParam ** paraParams
array of ParaParams
virtual size_t getNumIntParams()=0
get number of int parameters
virtual size_t getNumRealParams()=0
get number of real parameters
virtual size_t getNumStringParams()=0
get number of string parameters
virtual size_t getNumBoolParams()=0
get number of bool parameters
virtual size_t getNumLongintParams()=0
get number of longint parameters
void setValue(const char *value)
set current value of this sting parameter
bool isDefaultValue() const
check if current value is default value or not
const char * getValue() const
get current value of this string parameter
static ScipParaCommTh * comm
static const int ParaParamTypeInt
integer values
static const int ParaParamTypeReal
real values
static const int ParaParamTypeLongint
long integer values
static const int ParaParamTypeChar
characters
static const int ParaParamTypeBool
Types of parameters.
static const int ParaParamTypeString
arrays of characters
static const int ParaParamsStringFirst
String parameters.
#define DEF_PARA_COMM(para_comm, comm)
ParaComm extension for MPI communication.
#define MPI_CALL(mpicall)
#define PARA_COMM_CALL(paracommcall)
#define THROW_LOGICAL_ERROR1(msg1)
ParaParamSet extension for MPI communication.