45ScipParaInstanceMpi::createDatatype1(
48 const int nBlocks = 21;
49 MPI_Datatype prePreDatatype;
51 MPI_Aint startAddress = 0;
54 int blockLengths[nBlocks];
55 MPI_Aint displacements[nBlocks];
56 MPI_Datatype types[nBlocks];
58 for(
int i = 0; i < nBlocks; i++ ){
64 MPI_Get_address( &
lProbName, &startAddress )
69 MPI_Get_address( &
nCopies, &address )
71 displacements[1] = address - startAddress;
76 displacements[2] = address - startAddress;
79 MPI_Get_address( &
objScale, &address )
81 displacements[3] = address - startAddress;
82 types[3] = MPI_DOUBLE;
87 displacements[4] = address - startAddress;
88 types[4] = MPI_DOUBLE;
91 MPI_Get_address( &
nVars, &address )
93 displacements[5] = address - startAddress;
98 displacements[6] = address - startAddress;
103 displacements[7] = address - startAddress;
106 MPI_Get_address( &
nConss, &address )
108 displacements[8] = address - startAddress;
113 displacements[9] = address - startAddress;
118 displacements[10] = address - startAddress;
123 displacements[11] = address - startAddress;
128 displacements[12] = address - startAddress;
133 displacements[13] = address - startAddress;
138 displacements[14] = address - startAddress;
143 displacements[15] = address - startAddress;
148 displacements[16] = address - startAddress;
153 displacements[17] = address - startAddress;
158 displacements[18] = address - startAddress;
163 displacements[19] = address - startAddress;
168 displacements[20] = address - startAddress;
171 MPI_Type_create_struct(nBlocks, blockLengths, displacements, types, &prePreDatatype)
174 return prePreDatatype;
259 bool memAllocNecessary
262 const int nBlocks = 37;
263 MPI_Datatype datatype;
265 MPI_Aint startAddress = 0;
266 MPI_Aint address = 0;
268 if( memAllocNecessary )
273 int blockLengths[nBlocks];
274 MPI_Aint displacements[nBlocks];
275 MPI_Datatype types[nBlocks];
280 MPI_Get_address(
probName, &startAddress )
282 displacements[n] = 0;
284 types[n++] = MPI_CHAR;
289 MPI_Get_address(
varLbs, &address )
291 displacements[n] = address - startAddress;
292 blockLengths[n] =
nVars;
293 types[n++] = MPI_DOUBLE;
296 MPI_Get_address(
varUbs, &address )
298 displacements[n] = address - startAddress;
299 blockLengths[n] =
nVars;
300 types[n++] = MPI_DOUBLE;
303 MPI_Get_address(
objCoefs, &address )
305 displacements[n] = address - startAddress;
306 blockLengths[n] =
nVars;
307 types[n++] = MPI_DOUBLE;
310 MPI_Get_address(
varTypes, &address )
312 displacements[n] = address - startAddress;
313 blockLengths[n] =
nVars;
314 types[n++] = MPI_INT;
319 MPI_Get_address(
varNames, &address )
321 displacements[n] = address - startAddress;
323 types[n++] = MPI_CHAR;
329 displacements[n] = address - startAddress;
330 blockLengths[n] =
nVars;
331 types[n++] = MPI_INT;
341 displacements[n] = address - startAddress;
343 types[n++] = MPI_CHAR;
348 displacements[n] = address - startAddress;
350 types[n++] = MPI_INT;
358 displacements[n] = address - startAddress;
360 types[n++] = MPI_INT;
365 displacements[n] = address - startAddress;
367 types[n++] = MPI_DOUBLE;
372 displacements[n] = address - startAddress;
374 types[n++] = MPI_DOUBLE;
379 displacements[n] = address - startAddress;
381 types[n++] = MPI_INT;
389 displacements[n] = address - startAddress;
391 types[n++] = MPI_INT;
396 displacements[n] = address - startAddress;
398 types[n++] = MPI_INT;
403 displacements[n] = address - startAddress;
405 types[n++] = MPI_INT;
413 displacements[n] = address - startAddress;
415 types[n++] = MPI_INT;
419 displacements[n] = address - startAddress;
421 types[n++] = MPI_INT;
429 displacements[n] = address - startAddress;
431 types[n++] = MPI_INT;
436 displacements[n] = address - startAddress;
439 types[n++] = MPI_LONG;
441 types[n++] = MPI_LONG_LONG;
447 displacements[n] = address - startAddress;
449 types[n++] = MPI_INT;
457 displacements[n] = address - startAddress;
459 types[n++] = MPI_INT;
464 displacements[n] = address - startAddress;
466 types[n++] = MPI_DOUBLE;
471 displacements[n] = address - startAddress;
473 types[n++] = MPI_DOUBLE;
478 displacements[n] = address - startAddress;
480 types[n++] = MPI_INT;
485 displacements[n] = address - startAddress;
487 types[n++] = MPI_DOUBLE;
492 displacements[n] = address - startAddress;
494 types[n++] = MPI_INT;
502 displacements[n] = address - startAddress;
504 types[n++] = MPI_INT;
509 displacements[n] = address - startAddress;
511 types[n++] = MPI_INT;
519 displacements[n] = address - startAddress;
521 types[n++] = MPI_INT;
526 displacements[n] = address - startAddress;
528 types[n++] = MPI_INT;
536 displacements[n] = address - startAddress;
538 types[n++] = MPI_INT;
543 displacements[n] = address - startAddress;
545 types[n++] = MPI_INT;
555 displacements[n] = address - startAddress;
557 types[n++] = MPI_CHAR;
563 displacements[n] = address - startAddress;
565 types[n++] = MPI_INT;
572 displacements[n] = address - startAddress;
574 types[n++] = MPI_CHAR;
580 displacements[n] = address - startAddress;
582 types[n++] = MPI_INT;
587 displacements[n] = address - startAddress;
589 types[n++] = MPI_DOUBLE;
594 displacements[n] = address - startAddress;
596 types[n++] = MPI_INT;
600 MPI_Type_create_struct(n, blockLengths, displacements, types, &datatype)
693 bool memAllocNecessary
696 MPI_Datatype datatype;
698 MPI_Aint startAddress = 0;
699 MPI_Aint address = 0;
701 if( memAllocNecessary )
707 int *blockLengths =
new int[nArrays];
708 MPI_Aint *displacements =
new MPI_Aint[nArrays];
709 MPI_Datatype *types =
new MPI_Datatype[nArrays];
716 displacements[n] = 0;
718 types[n++] = MPI_INT;
727 displacements[n] = address - startAddress;
729 types[n++] = MPI_DOUBLE;
733 displacements[n] = address - startAddress;
735 types[n++] = MPI_INT;
746 displacements[n] = address - startAddress;
748 types[n++] = MPI_INT;
759 displacements[n] = address - startAddress;
761 types[n++] = MPI_INT;
771 displacements[n] = address - startAddress;
774 types[n++] = MPI_LONG;
776 types[n++] = MPI_LONG_LONG;
781 displacements[n] = address - startAddress;
783 types[n++] = MPI_INT;
793 displacements[n] = address - startAddress;
795 types[n++] = MPI_INT;
799 displacements[n] = address - startAddress;
801 types[n++] = MPI_INT;
805 displacements[n] = address - startAddress;
807 types[n++] = MPI_DOUBLE;
815 MPI_Get_address(
sos1Coefs[i], &address )
817 displacements[n] = address - startAddress;
819 types[n++] = MPI_DOUBLE;
823 displacements[n] = address - startAddress;
825 types[n++] = MPI_INT;
833 MPI_Get_address(
sos2Coefs[i], &address )
835 displacements[n] = address - startAddress;
837 types[n++] = MPI_DOUBLE;
841 displacements[n] = address - startAddress;
843 types[n++] = MPI_INT;
853 displacements[n] = address - startAddress;
855 types[n++] = MPI_DOUBLE;
859 displacements[n] = address - startAddress;
861 types[n++] = MPI_INT;
865 assert(n == nArrays);
868 MPI_Type_create_struct(n, blockLengths, displacements, types, &datatype)
871 delete [] blockLengths;
872 delete [] displacements;
893 MPI_Type_commit( &datatype )
896 commMpi->ubcast(&
lProbName, 1, datatype, root)
899 MPI_Type_free( &datatype )
902 if( commMpi->getRank() == root )
911 MPI_Type_commit( &datatype )
915 commMpi->ubcast(
probName, 1, datatype, root)
918 MPI_Type_free( &datatype )
921 if( commMpi->getRank() == root )
930 MPI_Type_commit( &datatype )
936 MPI_Type_free( &datatype )
945 MPI_Type_commit( &datatype )
948 commMpi->ubcast(&
lProbName, 1, datatype, root)
951 MPI_Type_free( &datatype )
955 char *probNameFromFileName;
956 char *temp =
new char[strlen(
fileName)+1];
958 SCIPsplitFilename(temp, NULL, &probNameFromFileName, NULL, NULL);
959 probName =
new char[strlen(probNameFromFileName)+1];
960 (void) strcpy(
probName, probNameFromFileName);
MPI_Datatype createDatatype3(bool memAllocNecessary)
void allocateMemoryForDatatype3()
MPI_Datatype createDatatype2(bool memAllocNecessary)
int bcast(UG::ParaComm *comm, int rank, int method)
void allocateMemoryForDatatype2()
MPI_Datatype createDatatype1()
int * nVarsBoundDisjunction
SCIP_Real * varboundCoef2s
int ** idxAggregatedCoefsVars
int * idxBoundDisjunctionConsNames
SCIP_Longint ** knapsackCoefs
char * aggregatedConsNames
int ** idxLinearCoefsVars
int * posAggregatedVarNames
int * idxLogicorConsNames
int * idxKnapsackConsNames
SCIP_BOUNDTYPE ** boundTypesBoundDisjunction
SCIP_Real ** boundsBoundDisjunction
int * posAggregatedConsNames
int * idxVarboundConsNames
int * idxVarboundCoefVar1s
int ** idxKnapsackCoefsVars
char * aggregatedVarNames
int nVarBoundDisjunctionConss
SCIP_Longint * capacities
SCIP_Real * aggregatedLhsAndLhss
int ** idxVarBoundDisjunction
int * idxVarboundCoefVar2s
SCIP_Real ** aggregatedCoefs
Base class of communicator object.
static ScipParaCommTh * comm
#define DEF_PARA_COMM(para_comm, comm)
#define MPI_CALL(mpicall)
#define PARA_COMM_CALL(paracommcall)
#define THROW_LOGICAL_ERROR1(msg1)
SCIP ParaComm extension for MPI communication.
ScipParaInstance extension for MPI communication.