6 std::string
example_eul = TestDir +
"unittest/io/eul3x48x96.t.3.nc";
10 std::string
example_fv = TestDir +
"unittest/io/fv3x46x72.t.3.nc";
12 std::string
example_mpas = TestDir +
"unittest/io/mpasx1.642.t.2.nc";
20 #ifdef MOAB_HAVE_PNETCDF
22 #define NCFUNC( func ) ncmpi_##func
23 #define NCDF_SIZE MPI_Offset
26 #define NCFUNC( func ) nc_##func
27 #define NCDF_SIZE size_t
64 void test_eul_read_write_ghosting();
65 void test_eul_check_ghosting();
73 const double eps = 1e-10;
77 int main(
int argc,
char* argv[] )
82 int fail = MPI_Init( &argc, &argv );
85 argv[0] = argv[argc - argc];
113 result +=
RUN_TEST( test_eul_read_write_ghosting );
114 result +=
RUN_TEST( test_eul_check_ghosting );
118 fail = MPI_Finalize();
134 #ifndef MOAB_HAVE_PNETCDF
135 if( procs > 1 )
return;
141 std::string read_opts;
148 read_opts +=
";VARIABLE=T,gw;DEBUG_IO=0";
152 std::string write_opts =
";;VARIABLE=T,gw;DEBUG_IO=0";
155 write_opts +=
";PARALLEL=WRITE_PART";
158 rval =
mb.
write_file(
"test_par_eul_T.nc", 0, write_opts.c_str(), &set, 1 );
175 #ifndef MOAB_HAVE_PNETCDF
176 if( procs > 1 )
return;
191 #ifdef MOAB_HAVE_PNETCDF
192 success =
NCFUNC( open )( MPI_COMM_SELF,
filename.c_str(), NC_NOWRITE, MPI_INFO_NULL, &ncid );
198 #ifdef MOAB_HAVE_PNETCDF
199 success =
NCFUNC( open )( MPI_COMM_SELF,
example_eul.c_str(), NC_NOWRITE, MPI_INFO_NULL, &ncid_ref );
206 success =
NCFUNC( inq_varid )( ncid,
"T", &T_id );
210 success =
NCFUNC( inq_varid )( ncid_ref,
"T", &T_id_ref );
214 success =
NCFUNC( inq_varid )( ncid,
"gw", &gw_id );
218 success =
NCFUNC( inq_varid )( ncid_ref,
"gw", &gw_id_ref );
221 #ifdef MOAB_HAVE_PNETCDF
223 success =
NCFUNC( begin_indep_data )( ncid );
227 #ifdef MOAB_HAVE_PNETCDF
229 success =
NCFUNC( begin_indep_data )( ncid_ref );
239 success =
NCFUNC( get_vara_double )( ncid, T_id, start, count, T_vals );
243 double T_vals_ref[
size];
244 success =
NCFUNC( get_vara_double )( ncid_ref, T_id_ref, start, count, T_vals_ref );
250 success =
NCFUNC( get_vara_double )( ncid, gw_id, start, count, gw_vals );
254 double gw_vals_ref[48];
255 success =
NCFUNC( get_vara_double )( ncid_ref, gw_id_ref, start, count, gw_vals_ref );
258 #ifdef MOAB_HAVE_PNETCDF
260 success =
NCFUNC( end_indep_data )( ncid );
264 #ifdef MOAB_HAVE_PNETCDF
266 success =
NCFUNC( end_indep_data )( ncid_ref );
270 success =
NCFUNC( close )( ncid );
273 success =
NCFUNC( close )( ncid_ref );
277 for(
int i = 0; i <
size; i++ )
281 for(
int i = 0; i < 48; i++ )
294 #ifndef MOAB_HAVE_PNETCDF
295 if( procs > 1 )
return;
301 std::string read_opts;
308 read_opts +=
";VARIABLE=T;DEBUG_IO=0";
312 std::string write_opts =
";;VARIABLE=T;DEBUG_IO=0";
315 write_opts +=
";PARALLEL=WRITE_PART";
318 rval =
mb.
write_file(
"test_par_fv_T.nc", 0, write_opts.c_str(), &set, 1 );
334 #ifndef MOAB_HAVE_PNETCDF
335 if( procs > 1 )
return;
350 #ifdef MOAB_HAVE_PNETCDF
351 success =
NCFUNC( open )( MPI_COMM_SELF,
filename.c_str(), NC_NOWRITE, MPI_INFO_NULL, &ncid );
357 #ifdef MOAB_HAVE_PNETCDF
358 success =
NCFUNC( open )( MPI_COMM_SELF,
example_fv.c_str(), NC_NOWRITE, MPI_INFO_NULL, &ncid_ref );
365 success =
NCFUNC( inq_varid )( ncid,
"T", &T_id );
369 success =
NCFUNC( inq_varid )( ncid_ref,
"T", &T_id_ref );
372 #ifdef MOAB_HAVE_PNETCDF
374 success =
NCFUNC( begin_indep_data )( ncid );
378 #ifdef MOAB_HAVE_PNETCDF
380 success =
NCFUNC( begin_indep_data )( ncid_ref );
390 success =
NCFUNC( get_vara_double )( ncid, T_id, start, count, T_vals );
394 double T_vals_ref[
size];
395 success =
NCFUNC( get_vara_double )( ncid_ref, T_id_ref, start, count, T_vals_ref );
398 #ifdef MOAB_HAVE_PNETCDF
400 success =
NCFUNC( end_indep_data )( ncid );
404 #ifdef MOAB_HAVE_PNETCDF
406 success =
NCFUNC( end_indep_data )( ncid_ref );
410 success =
NCFUNC( close )( ncid );
413 success =
NCFUNC( close )( ncid_ref );
417 for(
int i = 0; i <
size; i++ )
431 #ifndef MOAB_HAVE_PNETCDF
432 if( procs > 1 )
return;
438 std::string read_opts;
445 read_opts +=
";VARIABLE=T,lat;DEBUG_IO=0";
449 read_opts +=
";PARALLEL_RESOLVE_SHARED_ENTS;TRIVIAL_PARTITION_SHIFT=1";
454 std::string write_opts =
";;VARIABLE=T,lat;DEBUG_IO=0";
457 write_opts +=
";PARALLEL=WRITE_PART";
460 rval =
mb.
write_file(
"test_par_homme_T.nc", 0, write_opts.c_str(), &set, 1 );
477 #ifndef MOAB_HAVE_PNETCDF
478 if( procs > 1 )
return;
493 #ifdef MOAB_HAVE_PNETCDF
494 success =
NCFUNC( open )( MPI_COMM_SELF,
filename.c_str(), NC_NOWRITE, MPI_INFO_NULL, &ncid );
500 #ifdef MOAB_HAVE_PNETCDF
501 success =
NCFUNC( open )( MPI_COMM_SELF,
example_homme.c_str(), NC_NOWRITE, MPI_INFO_NULL, &ncid_ref );
508 success =
NCFUNC( inq_varid )( ncid,
"T", &T_id );
512 success =
NCFUNC( inq_varid )( ncid_ref,
"T", &T_id_ref );
516 success =
NCFUNC( inq_varid )( ncid,
"lat", &lat_id );
520 success =
NCFUNC( inq_varid )( ncid_ref,
"lat", &lat_id_ref );
523 #ifdef MOAB_HAVE_PNETCDF
525 success =
NCFUNC( begin_indep_data )( ncid );
529 #ifdef MOAB_HAVE_PNETCDF
531 success =
NCFUNC( begin_indep_data )( ncid_ref );
541 success =
NCFUNC( get_vara_double )( ncid, T_id, start, count, T_vals );
545 double T_vals_ref[
size];
546 success =
NCFUNC( get_vara_double )( ncid_ref, T_id_ref, start, count, T_vals_ref );
551 double lat_vals[3458];
552 success =
NCFUNC( get_vara_double )( ncid, lat_id, start, count, lat_vals );
556 double lat_vals_ref[3458];
557 success =
NCFUNC( get_vara_double )( ncid_ref, lat_id_ref, start, count, lat_vals_ref );
560 #ifdef MOAB_HAVE_PNETCDF
562 success =
NCFUNC( end_indep_data )( ncid );
566 #ifdef MOAB_HAVE_PNETCDF
568 success =
NCFUNC( end_indep_data )( ncid_ref );
572 success =
NCFUNC( close )( ncid );
575 success =
NCFUNC( close )( ncid_ref );
579 for(
int i = 0; i <
size; i++ )
583 for(
int i = 0; i < 3458; i++ )
597 #ifndef MOAB_HAVE_PNETCDF
598 if( procs > 1 )
return;
604 std::string read_opts;
611 read_opts +=
";VARIABLE=vorticity,u,ke;DEBUG_IO=0";
612 if( procs > 1 ) read_opts +=
";PARALLEL_RESOLVE_SHARED_ENTS";
616 std::string write_opts =
";;VARIABLE=vorticity,u,ke;DEBUG_IO=0";
619 write_opts +=
";PARALLEL=WRITE_PART";
622 rval =
mb.
write_file(
"test_par_mpas_vars.nc", 0, write_opts.c_str(), &set, 1 );
638 #ifndef MOAB_HAVE_PNETCDF
639 if( procs > 1 )
return;
654 #ifdef MOAB_HAVE_PNETCDF
655 success =
NCFUNC( open )( MPI_COMM_SELF,
filename.c_str(), NC_NOWRITE, MPI_INFO_NULL, &ncid );
661 #ifdef MOAB_HAVE_PNETCDF
662 success =
NCFUNC( open )( MPI_COMM_SELF,
example_mpas.c_str(), NC_NOWRITE, MPI_INFO_NULL, &ncid_ref );
669 success =
NCFUNC( inq_varid )( ncid,
"vorticity", &vorticity_id );
672 int vorticity_id_ref;
673 success =
NCFUNC( inq_varid )( ncid_ref,
"vorticity", &vorticity_id_ref );
677 success =
NCFUNC( inq_varid )( ncid,
"u", &u_id );
681 success =
NCFUNC( inq_varid )( ncid_ref,
"u", &u_id_ref );
685 success =
NCFUNC( inq_varid )( ncid,
"ke", &ke_id );
689 success =
NCFUNC( inq_varid )( ncid_ref,
"ke", &ke_id_ref );
692 #ifdef MOAB_HAVE_PNETCDF
694 success =
NCFUNC( begin_indep_data )( ncid );
698 #ifdef MOAB_HAVE_PNETCDF
700 success =
NCFUNC( begin_indep_data )( ncid_ref );
712 double vorticity_vals[size1];
713 success =
NCFUNC( get_vara_double )( ncid, vorticity_id, start, count, vorticity_vals );
717 double vorticity_vals_ref[size1];
718 success =
NCFUNC( get_vara_double )( ncid_ref, vorticity_id_ref, start, count, vorticity_vals_ref );
723 double u_vals[size2];
724 success =
NCFUNC( get_vara_double )( ncid, u_id, start, count, u_vals );
728 double u_vals_ref[size2];
729 success =
NCFUNC( get_vara_double )( ncid_ref, u_id_ref, start, count, u_vals_ref );
734 double ke_vals[size3];
735 success =
NCFUNC( get_vara_double )( ncid, ke_id, start, count, ke_vals );
739 double ke_vals_ref[size3];
740 success =
NCFUNC( get_vara_double )( ncid_ref, ke_id_ref, start, count, ke_vals_ref );
743 #ifdef MOAB_HAVE_PNETCDF
745 success =
NCFUNC( end_indep_data )( ncid );
749 #ifdef MOAB_HAVE_PNETCDF
751 success =
NCFUNC( end_indep_data )( ncid_ref );
755 success =
NCFUNC( close )( ncid );
758 success =
NCFUNC( close )( ncid_ref );
762 for(
int i = 0; i < size1; i++ )
766 for(
int i = 0; i < size2; i++ )
770 for(
int i = 0; i < size3; i++ )
785 #ifndef MOAB_HAVE_PNETCDF
786 if( procs > 1 )
return;
792 std::string read_opts;
800 read_opts +=
";VARIABLE=u,wind,vorticity,pressure;DEBUG_IO=0";
801 if( procs > 1 ) read_opts +=
";PARALLEL_RESOLVE_SHARED_ENTS";
805 std::string write_opts =
";;VARIABLE=u,wind,vorticity,pressure;DEBUG_IO=0";
808 write_opts +=
";PARALLEL=WRITE_PART";
811 rval =
mb.
write_file(
"test_par_gcrm_vars.nc", 0, write_opts.c_str(), &set, 1 );
828 #ifndef MOAB_HAVE_PNETCDF
829 if( procs > 1 )
return;
844 #ifdef MOAB_HAVE_PNETCDF
845 success =
NCFUNC( open )( MPI_COMM_SELF,
filename.c_str(), NC_NOWRITE, MPI_INFO_NULL, &ncid );
851 #ifdef MOAB_HAVE_PNETCDF
852 success =
NCFUNC( open )( MPI_COMM_SELF,
example_gcrm.c_str(), NC_NOWRITE, MPI_INFO_NULL, &ncid_ref );
859 success =
NCFUNC( inq_varid )( ncid,
"u", &u_id );
863 success =
NCFUNC( inq_varid )( ncid_ref,
"u", &u_id_ref );
867 success =
NCFUNC( inq_varid )( ncid,
"wind", &wind_id );
871 success =
NCFUNC( inq_varid )( ncid_ref,
"wind", &wind_id_ref );
875 success =
NCFUNC( inq_varid )( ncid,
"vorticity", &vorticity_id );
878 int vorticity_id_ref;
879 success =
NCFUNC( inq_varid )( ncid_ref,
"vorticity", &vorticity_id_ref );
883 success =
NCFUNC( inq_varid )( ncid,
"pressure", &pressure_id );
887 success =
NCFUNC( inq_varid )( ncid_ref,
"pressure", &pressure_id_ref );
890 #ifdef MOAB_HAVE_PNETCDF
892 success =
NCFUNC( begin_indep_data )( ncid );
896 #ifdef MOAB_HAVE_PNETCDF
898 success =
NCFUNC( begin_indep_data )( ncid_ref );
904 const int size1 = 2 * 1280 *
levels;
905 const int size2 = 2 * 1920 *
levels;
906 const int size3 = 2 * 642 *
levels;
910 double u_vals[size1];
911 success =
NCFUNC( get_vara_double )( ncid, u_id, start, count, u_vals );
915 double u_vals_ref[size1];
916 success =
NCFUNC( get_vara_double )( ncid_ref, u_id_ref, start, count, u_vals_ref );
921 double wind_vals[size2];
922 success =
NCFUNC( get_vara_double )( ncid, wind_id, start, count, wind_vals );
926 double wind_vals_ref[size2];
927 success =
NCFUNC( get_vara_double )( ncid_ref, wind_id_ref, start, count, wind_vals_ref );
932 double vorticity_vals[size3];
933 success =
NCFUNC( get_vara_double )( ncid, vorticity_id, start, count, vorticity_vals );
937 double vorticity_vals_ref[size3];
938 success =
NCFUNC( get_vara_double )( ncid_ref, vorticity_id_ref, start, count, vorticity_vals_ref );
942 double pressure_vals[size3];
943 success =
NCFUNC( get_vara_double )( ncid, pressure_id, start, count, pressure_vals );
947 double pressure_vals_ref[size3];
948 success =
NCFUNC( get_vara_double )( ncid_ref, pressure_id_ref, start, count, pressure_vals_ref );
951 #ifdef MOAB_HAVE_PNETCDF
953 success =
NCFUNC( end_indep_data )( ncid );
957 #ifdef MOAB_HAVE_PNETCDF
959 success =
NCFUNC( end_indep_data )( ncid_ref );
963 success =
NCFUNC( close )( ncid );
966 success =
NCFUNC( close )( ncid_ref );
970 for(
int i = 0; i < size1; i++ )
974 for(
int i = 0; i < size2; i++ )
978 for(
int i = 0; i < size3; i++ )
995 #ifndef MOAB_HAVE_PNETCDF
996 if( procs > 1 )
return;
1002 std::string read_opts;
1009 read_opts +=
";VARIABLE=T;DEBUG_IO=0";
1013 std::string write_opts =
";;VARIABLE=T;TIMESTEP=2;DEBUG_IO=0";
1014 #ifdef MOAB_HAVE_MPI
1016 write_opts +=
";PARALLEL=WRITE_PART";
1019 rval =
mb.
write_file(
"test_par_eul_T2.nc", 0, write_opts.c_str(), &set, 1 );
1028 #ifdef MOAB_HAVE_MPI
1034 #ifndef MOAB_HAVE_PNETCDF
1035 if( procs > 1 )
return;
1050 #ifdef MOAB_HAVE_PNETCDF
1051 success =
NCFUNC( open )( MPI_COMM_SELF,
filename.c_str(), NC_NOWRITE, MPI_INFO_NULL, &ncid );
1057 #ifdef MOAB_HAVE_PNETCDF
1058 success =
NCFUNC( open )( MPI_COMM_SELF,
example_eul.c_str(), NC_NOWRITE, MPI_INFO_NULL, &ncid_ref );
1065 success =
NCFUNC( inq_varid )( ncid,
"T", &T_id );
1069 success =
NCFUNC( inq_varid )( ncid_ref,
"T", &T_id_ref );
1072 #ifdef MOAB_HAVE_PNETCDF
1074 success =
NCFUNC( begin_indep_data )( ncid );
1078 #ifdef MOAB_HAVE_PNETCDF
1080 success =
NCFUNC( begin_indep_data )( ncid_ref );
1089 double T_vals[
size];
1090 success =
NCFUNC( get_vara_double )( ncid, T_id, start, count, T_vals );
1095 double T_vals_ref[
size];
1096 success =
NCFUNC( get_vara_double )( ncid_ref, T_id_ref, start, count, T_vals_ref );
1099 #ifdef MOAB_HAVE_PNETCDF
1101 success =
NCFUNC( end_indep_data )( ncid );
1105 #ifdef MOAB_HAVE_PNETCDF
1107 success =
NCFUNC( end_indep_data )( ncid_ref );
1111 success =
NCFUNC( close )( ncid );
1114 success =
NCFUNC( close )( ncid_ref );
1118 for(
int i = 0; i <
size; i++ )
1128 #ifdef MOAB_HAVE_MPI
1133 #ifndef MOAB_HAVE_PNETCDF
1134 if( procs > 1 )
return;
1140 std::string read_opts;
1147 read_opts +=
";VARIABLE=T,U,V;DEBUG_IO=0";
1151 std::string write_opts =
";;VARIABLE=T;DEBUG_IO=0";
1152 #ifdef MOAB_HAVE_MPI
1154 write_opts +=
";PARALLEL=WRITE_PART";
1157 rval =
mb.
write_file(
"test_par_eul_append.nc", 0, write_opts.c_str(), &set, 1 );
1162 write_opts =
";;VARIABLE=U;APPEND;DEBUG_IO=0";
1163 #ifdef MOAB_HAVE_MPI
1165 write_opts +=
";PARALLEL=WRITE_PART";
1168 rval =
mb.
write_file(
"test_par_eul_append.nc", 0, write_opts.c_str(), &set, 1 );
1173 write_opts =
";;VARIABLE=V;RENAME=VNEWNAME;APPEND;DEBUG_IO=0";
1174 #ifdef MOAB_HAVE_MPI
1176 write_opts +=
";PARALLEL=WRITE_PART";
1179 rval =
mb.
write_file(
"test_par_eul_append.nc", 0, write_opts.c_str(), &set, 1 );
1188 #ifdef MOAB_HAVE_MPI
1194 #ifndef MOAB_HAVE_PNETCDF
1195 if( procs > 1 )
return;
1206 filename =
"test_par_eul_append.nc";
1210 #ifdef MOAB_HAVE_PNETCDF
1211 success =
NCFUNC( open )( MPI_COMM_SELF,
filename.c_str(), NC_NOWRITE, MPI_INFO_NULL, &ncid );
1217 #ifdef MOAB_HAVE_PNETCDF
1218 success =
NCFUNC( open )( MPI_COMM_SELF,
example_eul.c_str(), NC_NOWRITE, MPI_INFO_NULL, &ncid_ref );
1225 success =
NCFUNC( inq_varid )( ncid,
"T", &T_id );
1229 success =
NCFUNC( inq_varid )( ncid_ref,
"T", &T_id_ref );
1233 success =
NCFUNC( inq_varid )( ncid,
"U", &U_id );
1237 success =
NCFUNC( inq_varid )( ncid_ref,
"U", &U_id_ref );
1241 success =
NCFUNC( inq_varid )( ncid,
"VNEWNAME", &V_id );
1245 success =
NCFUNC( inq_varid )( ncid_ref,
"V", &V_id_ref );
1248 #ifdef MOAB_HAVE_PNETCDF
1250 success =
NCFUNC( begin_indep_data )( ncid );
1254 #ifdef MOAB_HAVE_PNETCDF
1256 success =
NCFUNC( begin_indep_data )( ncid_ref );
1265 double T_vals[
size];
1266 success =
NCFUNC( get_vara_double )( ncid, T_id, start, count, T_vals );
1270 double T_vals_ref[
size];
1271 success =
NCFUNC( get_vara_double )( ncid_ref, T_id_ref, start, count, T_vals_ref );
1275 double U_vals[
size];
1276 success =
NCFUNC( get_vara_double )( ncid, U_id, start, count, U_vals );
1280 double U_vals_ref[
size];
1281 success =
NCFUNC( get_vara_double )( ncid_ref, U_id_ref, start, count, U_vals_ref );
1285 double V_vals[
size];
1286 success =
NCFUNC( get_vara_double )( ncid, V_id, start, count, V_vals );
1290 double V_vals_ref[
size];
1291 success =
NCFUNC( get_vara_double )( ncid_ref, V_id_ref, start, count, V_vals_ref );
1294 #ifdef MOAB_HAVE_PNETCDF
1296 success =
NCFUNC( end_indep_data )( ncid );
1300 #ifdef MOAB_HAVE_PNETCDF
1302 success =
NCFUNC( end_indep_data )( ncid_ref );
1306 success =
NCFUNC( close )( ncid );
1309 success =
NCFUNC( close )( ncid_ref );
1313 for(
int i = 0; i <
size; i++ )
1325 #ifdef MOAB_HAVE_MPI
1330 #ifndef MOAB_HAVE_PNETCDF
1331 if( procs > 1 )
return;
1337 std::string read_opts;
1345 read_opts +=
";VARIABLE=T;TIMESTEPBASE=2;DEBUG_IO=0";
1351 read_opts +=
";VARIABLE=T;TIMESTEPBASE=0;NOMESH;DEBUG_IO=0";
1357 read_opts +=
";VARIABLE=T;TIMESTEPBASE=1;NOMESH;DEBUG_IO=0";
1361 std::string write_opts =
";;VARIABLE=T;TIMESTEP=0,1,2;DEBUG_IO=0";
1362 #ifdef MOAB_HAVE_MPI
1364 write_opts +=
";PARALLEL=WRITE_PART";
1367 rval =
mb.
write_file(
"test_par_eul_across_files.nc", 0, write_opts.c_str(), &set, 1 );
1369 rval =
mb.
write_file(
"test_eul_across_files.nc", 0, write_opts.c_str(), &set, 1 );
CHECK_ERR( rval );
1376 #ifdef MOAB_HAVE_MPI
1382 #ifndef MOAB_HAVE_PNETCDF
1383 if( procs > 1 )
return;
1394 filename =
"test_par_eul_across_files.nc";
1396 filename =
"test_eul_across_files.nc";
1398 #ifdef MOAB_HAVE_PNETCDF
1399 success =
NCFUNC( open )( MPI_COMM_SELF,
filename.c_str(), NC_NOWRITE, MPI_INFO_NULL, &ncid );
1405 #ifdef MOAB_HAVE_PNETCDF
1406 success =
NCFUNC( open )( MPI_COMM_SELF,
example_eul.c_str(), NC_NOWRITE, MPI_INFO_NULL, &ncid_ref );
1413 success =
NCFUNC( inq_varid )( ncid,
"T", &T_id );
1417 success =
NCFUNC( inq_varid )( ncid_ref,
"T", &T_id_ref );
1420 #ifdef MOAB_HAVE_PNETCDF
1422 success =
NCFUNC( begin_indep_data )( ncid );
1426 #ifdef MOAB_HAVE_PNETCDF
1428 success =
NCFUNC( begin_indep_data )( ncid_ref );
1437 double T_vals[
size];
1438 success =
NCFUNC( get_vara_double )( ncid, T_id, start, count, T_vals );
1442 double T_vals_ref[
size];
1443 success =
NCFUNC( get_vara_double )( ncid_ref, T_id_ref, start, count, T_vals_ref );
1446 #ifdef MOAB_HAVE_PNETCDF
1448 success =
NCFUNC( end_indep_data )( ncid );
1452 #ifdef MOAB_HAVE_PNETCDF
1454 success =
NCFUNC( end_indep_data )( ncid_ref );
1458 success =
NCFUNC( close )( ncid );
1461 success =
NCFUNC( close )( ncid_ref );
1465 for(
int i = 0; i <
size; i++ )
1470 #ifdef MOAB_HAVE_MPI
1472 void test_eul_read_write_ghosting()
1478 #ifndef MOAB_HAVE_PNETCDF
1479 if( procs > 1 )
return;
1488 std::string read_opts =
"PARALLEL=READ_PART;PARTITION;PARALLEL_RESOLVE_SHARED_ENTS;PARALLEL_"
1489 "GHOSTS=2.0.1;PARTITION_METHOD=SQIJ;VARIABLE=";
1492 read_opts =
"PARALLEL=READ_PART;PARTITION;PARTITION_METHOD=SQIJ;VARIABLE=T;NOMESH";
1496 std::string write_opts =
";;PARALLEL=WRITE_PART;VARIABLE=T;DEBUG_IO=0";
1498 rval =
mb.
write_file(
"test_par_eul_ghosting.nc", 0, write_opts.c_str(), &set, 1 );
1503 void test_eul_check_ghosting()
1507 #ifdef MOAB_HAVE_MPI
1513 #ifndef MOAB_HAVE_PNETCDF
1514 if( procs > 1 )
return;
1525 filename =
"test_par_eul_ghosting.nc";
1529 #ifdef MOAB_HAVE_PNETCDF
1530 success =
NCFUNC( open )( MPI_COMM_SELF,
filename.c_str(), NC_NOWRITE, MPI_INFO_NULL, &ncid );
1536 #ifdef MOAB_HAVE_PNETCDF
1537 success =
NCFUNC( open )( MPI_COMM_SELF,
example_eul.c_str(), NC_NOWRITE, MPI_INFO_NULL, &ncid_ref );
1544 success =
NCFUNC( inq_varid )( ncid,
"T", &T_id );
1548 success =
NCFUNC( inq_varid )( ncid_ref,
"T", &T_id_ref );
1551 #ifdef MOAB_HAVE_PNETCDF
1553 success =
NCFUNC( begin_indep_data )( ncid );
1557 #ifdef MOAB_HAVE_PNETCDF
1559 success =
NCFUNC( begin_indep_data )( ncid_ref );
1568 double T_vals[
size];
1569 success =
NCFUNC( get_vara_double )( ncid, T_id, start, count, T_vals );
1573 double T_vals_ref[
size];
1574 success =
NCFUNC( get_vara_double )( ncid_ref, T_id_ref, start, count, T_vals_ref );
1577 #ifdef MOAB_HAVE_PNETCDF
1579 success =
NCFUNC( end_indep_data )( ncid );
1583 #ifdef MOAB_HAVE_PNETCDF
1585 success =
NCFUNC( end_indep_data )( ncid_ref );
1589 success =
NCFUNC( close )( ncid );
1592 success =
NCFUNC( close )( ncid_ref );
1596 for(
int i = 0; i <
size; i++ )
1604 #ifdef MOAB_HAVE_MPI
1606 opts =
";;PARALLEL=READ_PART;PARTITION_METHOD=SQIJ";
1614 #ifdef MOAB_HAVE_MPI
1616 opts =
";;PARALLEL=READ_PART;PARTITION_METHOD=SQIJ";
1624 #ifdef MOAB_HAVE_MPI
1626 opts =
";;PARALLEL=READ_PART;PARTITION_METHOD=TRIVIAL";
1634 #ifdef MOAB_HAVE_MPI
1636 #ifdef MOAB_HAVE_ZOLTAN
1637 opts =
";;PARALLEL=READ_PART;PARTITION_METHOD=RCBZOLTAN";
1639 opts =
";;PARALLEL=READ_PART;PARTITION_METHOD=TRIVIAL";