24 int main(
int argc,
char* argv[] )
29 std::string readopts2(
"PARALLEL=READ_PART;PARTITION_METHOD=RCBZOLTAN" );
30 std::string
readopts(
"PARALLEL=READ_PART;PARTITION=PARALLEL_PARTITION;PARALLEL_RESOLVE_SHARED_ENTS" );
31 std::string readoptsLnd(
"PARALLEL=READ_PART;PARTITION=PARALLEL_PARTITION" );
32 std::string
filename = TestDir +
"unittest/SCRIPgrid_2x2_nomask_c210211.nc";
33 std::string
atmFilename = TestDir +
"unittest/wholeATM_T.h5m";
34 std::string rofInp = TestDir +
"unittest/wholeRof_06.h5m";
35 std::string seq_flds_r2x_fields(
36 "Forr_rofl:Forr_rofi:Firr_rofi:Flrr_flood:Flrr_volr:Flrr_volrmch:Flrr_supply:Flrr_deficit" );
37 int cmpAtm = 5, cmpRof = 21, cplRof = 22;
41 MPI_Init( &argc, &argv );
53 opts.
addOpt< std::string >(
"mosart,m",
" mosart with data", &rofInp );
55 opts.
addOpt< std::string >(
"scrip,s",
"scrip mesh file", &
filename );
57 opts.
addOpt<
int >(
"startAtm,a",
"start task for atmosphere layout", &
startG1 );
58 opts.
addOpt<
int >(
"endAtm,b",
"end task for atmosphere layout", &
endG1 );
60 opts.
addOpt<
int >(
"startOcn,c",
"start task for mosart layout", &
startG2 );
61 opts.
addOpt<
int >(
"endOcn,d",
"end task for mosart layout", &
endG2 );
63 opts.
addOpt<
int >(
"startCoupler,g",
"start task for coupler layout", &startG4 );
64 opts.
addOpt<
int >(
"endCoupler,j",
"end task for coupler layout", &endG4 );
71 <<
"\n mosart input file file: " << rofInp <<
"\n on tasks : " <<
startG2 <<
":" <<
endG2
72 <<
"\n scrip file on coupler: " <<
filename <<
"\n coupler on tasks : " << startG4 <<
":" << endG4
81 CHECKIERR(
ierr,
"Cannot create atm MPI group and communicator " )
86 CHECKIERR(
ierr,
"Cannot create rof MPI group and communicator " )
92 CHECKIERR(
ierr,
"Cannot create cpl MPI group and communicator " )
95 MPI_Group joinAtmCouGroup;
101 MPI_Group joinRofCouGroup;
104 CHECKIERR(
ierr,
"Cannot create joint rof cou communicator" )
111 if( rofComm != MPI_COMM_NULL )
117 int cmpAtmAppID = -1;
119 if( atmComm != MPI_COMM_NULL )
124 int cplAtmAppID = -1;
127 int cplRofAppID = -1;
130 int rankInCouComm = -1;
131 if( couComm != MPI_COMM_NULL )
133 MPI_Comm_rank( couComm, &rankInCouComm );
144 int repartitioner_scheme = 0;
145 #ifdef MOAB_HAVE_ZOLTAN
146 repartitioner_scheme = 2;
148 if( atmCouComm != MPI_COMM_NULL )
152 repartitioner_scheme );
155 int tagtype = 1, numco = 1, tagIndex = 0;
163 CHECKIERR(
ierr,
"failed to define the fields on mosart point cloud" )
166 if( couComm != MPI_COMM_NULL )
172 CHECKIERR(
ierr,
"failed to define the fields on mosart coupler mesh " )
174 char outputFileTgt[] =
"readCplRof.h5m";
180 if( MPI_COMM_NULL != rofCouComm )
186 ierr = iMOAB_ComputeCommGraph( rofPID, cplRofPID, &rofCouComm, &rofPEGroup, &couPEGroup, &
typeA, &
typeB,
195 ierr = iMOAB_SendElementTag( rofPID, seq_flds_r2x_fields.c_str(), &rofCouComm, &cplRof );
199 if( cplRofAppID >= 0 )
201 ierr = iMOAB_ReceiveElementTag( cplRofPID, seq_flds_r2x_fields.c_str(), &rofCouComm, &cmpRof );
203 char outputFileTgt[] =
"afterSend.h5m";
206 CHECKIERR(
ierr,
"cannot write Rof mesh with data on coupler" )
212 ierr = iMOAB_FreeSenderBuffers( rofPID, &cplRof );