Changeset 698
- Timestamp:
- 10/30/09 05:36:47 (3 weeks ago)
- Location:
- trunk
- Files:
-
- 12 modified
-
src/lib/header.c (modified) (4 diffs)
-
src/lib/mpinetcdf.c (modified) (3 diffs)
-
src/lib/pnetcdf.h (modified) (3 diffs)
-
src/libf/Makefile.in (modified) (1 diff)
-
src/libf/createffiles (modified) (1 diff)
-
src/libf/defs (modified) (3 diffs)
-
src/libf/mpifnetcdf.h (modified) (2 diffs)
-
src/libf/mpinetcdf_impl.h (modified) (1 diff)
-
src/libf/put_mvara_allf.c (modified) (1 diff)
-
src/libf/waitallf.c (modified) (2 diffs)
-
src/libf/waitf.c (modified) (2 diffs)
-
test/Makefile.in (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/header.c
r687 r698 1120 1120 NCtype type = NC_UNSPECIFIED; 1121 1121 NC_var **vpp, **end; 1122 int i; 1122 1123 1123 1124 assert(gbp != NULL && gbp->pos != NULL); … … 1278 1279 } else { 1279 1280 for (i=0; i<nc_dim1->nelems; i++){ 1280 if (nc_dim1->value[i]->size != nc_dim2->value[i]->size) {1281 if (nc_dim1->value[i]->size != nc_dim2->value[i]->size) 1281 1282 return NC_EDIMS_SIZE_MULTIDEFINE; 1282 } else { 1283 #define METADATA_CONSISTENCY_CHECK 1284 #ifdef METADATA_CONSISTENCY_CHECK 1285 else { 1283 1286 if ((nc_dim1->value[i]->name->nchars != nc_dim1->value[i]->name->nchars)||(strcmp(nc_dim1->value[i]->name->cp, nc_dim2->value[i]->name->cp)!=0)){ 1284 printf("Warning: The dimination name of NC definations on multiprocesses conflict. \nNOTE: Definitions across all processes must agree with one another\n");1287 printf("Warning: The dimination name %s of NC definations on multiprocesses inconsistent.\n",nc_dim1->value[i]->name->cp); 1285 1288 } 1286 1289 } 1290 #endif 1287 1291 } 1288 1292 … … 1293 1297 int ncmpii_comp_attrs(NC_attrarray *nc_attr1, NC_attrarray *nc_attr2){ 1294 1298 int i; 1299 #ifdef METADATA_CONSISTENCY_CHECK 1295 1300 if (nc_attr1->nelems != nc_attr2->nelems){ 1296 printf("Warning: The number of attributes of NC definations on multiprocesses conflict. \nNOTE: Definitions across all processes must agree with one another\n");1301 printf("Warning: The number of attributes (root=%d != %d) of NC definations on multiprocesses inconsistent.\n",nc_attr1->nelems,nc_attr2->nelems); 1297 1302 } else { 1298 1303 for (i=0; i<nc_attr1->nelems; i++){ 1299 1304 if (nc_attr1->value[i]->xsz != nc_attr2->value[i]->xsz){ 1300 printf("Warning: The size of attribute of NC definations on multiprocesses conflict. \nNOTE: Definitions across all processes must agree with one another\n");1305 printf("Warning: The size of attribute (root=%d != %d) of NC definations on multiprocesses inconsistent.\n",nc_attr1->value[i]->xsz,nc_attr2->value[i]->xsz); 1301 1306 } 1302 1307 if ((nc_attr1->value[i]->name->nchars != nc_attr2->value[i]->name->nchars)||(strcmp(nc_attr1->value[i]->name->cp, nc_attr2->value[i]->name->cp))){ 1303 printf("Warning: The name of attribute of NC definations on multiprocesses conflict. \nNOTE: Definitions across all processes must agree with one another\n");1308 printf("Warning: The name of attribute (root=%s != %s) of NC definations on multiprocesses inconsistent.\n",nc_attr1->value[i]->name->cp,nc_attr2->value[i]->name->cp); 1304 1309 } 1305 1310 if (strcmp(nc_attr1->value[i]->xvalue, nc_attr2->value[i]->xvalue)){ 1306 printf("Warning: The value of attribute of NC definations on multiprocesses conflict. \nNOTE: Definitions across all processes must agree with one another\n");1311 printf("Warning: The value of attribute (root=%s !=%s) of NC definations on multiprocesses inconsistent.\n",nc_attr1->value[i]->xvalue, nc_attr2->value[i]->xvalue); 1307 1312 } 1308 1313 if (nc_attr1->value[i]->type != nc_attr2->value[i]->type){ 1309 printf("Warning: The type of attribute of NC definations on multiprocesses conflict. \nNOTE: Definitions across all processes must agree with one another\n");1314 printf("Warning: The type of attribute (root=%d != %d) of NC definations on multiprocesses inconsistent.\n",nc_attr1->value[i]->type,nc_attr2->value[i]->type); 1310 1315 } 1311 1316 if (nc_attr1->value[i]->nelems != nc_attr2->value[i]->nelems){ 1312 printf("Warning: The length of attribute of NC definations on multiprocesses conflict. \nNOTE: Definitions across all processes must agree with one another\n");1317 printf("Warning: The length of attribute (root=%d != %d) of NC definations on multiprocesses inconsistent.\n",nc_attr1->value[i]->nelems,nc_attr2->value[i]->nelems); 1313 1318 } 1314 1319 } 1315 1320 } 1321 #endif 1316 1322 return NC_NOERR; 1317 1323 } … … 1323 1329 } else { 1324 1330 for (i=0; i<nc_var1->nelems; i++){ 1331 #ifdef METADATA_CONSISTENCY_CHECK 1325 1332 if ((nc_var1->value[i]->name->nchars != nc_var2->value[i]->name->nchars)||strcmp(nc_var1->value[i]->name->cp,nc_var2->value[i]->name->cp)) 1326 1333 { 1327 printf("Warning: The name of variable of NC definations on multiprocesses conflict. \nNOTE: Definitions across all processes must agree with one another\n");1334 printf("Warning: The name of variable (root=%s) of NC definations on multiprocesses inconsistent.\n",nc_var1->value[i]->name->cp); 1328 1335 } 1336 #endif 1329 1337 if ((nc_var1->value[i]->ndims != nc_var2->value[i]->ndims)){ 1330 1338 return NC_EVARS_NDIMS_MULTIDEFINE; -
trunk/src/lib/mpinetcdf.c
r693 r698 13220 13220 (*request)->count[dim]=count[dim]; 13221 13221 } 13222 13222 (*request)->rw_flag = 1; 13223 return NC_NOERR; 13224 } 13225 13226 int 13227 ncmpi_iget_vara_all(int ncid, int varid, 13228 const MPI_Offset start[], const MPI_Offset count[], 13229 const void *buf, MPI_Offset bufcount, 13230 MPI_Datatype datatype, NCMPI_Request *request) { 13231 13232 NC_var *varp; 13233 NC *ncp; 13234 int status = NC_NOERR; 13235 int dim; 13236 13237 status = ncmpii_NC_check_id(ncid, &ncp); 13238 if(status != NC_NOERR) 13239 return status; 13240 13241 varp = ncmpii_NC_lookupvar(ncp, varid); 13242 if(varp == NULL) 13243 return NC_ENOTVAR; 13244 13245 13246 *request = (NCMPI_Request)malloc(sizeof(struct NCMPI_Req)); 13247 if (*request == NULL) printf("no memory buffer\n"); 13248 (*request)->indep = 0; 13249 (*request)->ncid = ncid; 13250 (*request)->varid = varid; 13251 (*request)->ndim = varp->ndims; 13252 (*request)->start = (MPI_Offset *)malloc(varp->ndims*sizeof(MPI_Offset)); 13253 (*request)->count = (MPI_Offset *)malloc(varp->ndims*sizeof(MPI_Offset)); 13254 (*request)->buf = (void *)buf; 13255 (*request)->bufcount = bufcount; 13256 (*request)->vartype = datatype; 13257 (*request)->next_req = NULL; 13258 for (dim = 0; dim < varp->ndims; dim++){ 13259 (*request)->start[dim]=start[dim]; 13260 (*request)->count[dim]=count[dim]; 13261 } 13262 (*request)->rw_flag = 0; 13223 13263 return NC_NOERR; 13224 13264 } … … 13227 13267 static int 13228 13268 ncmpi_coll_wait(NCMPI_Request request) { 13269 if (request->rw_flag == 1) 13229 13270 return (ncmpi_put_vara_all(request->ncid, request->varid, 13271 request->start, request->count, 13272 request->buf, request->bufcount, 13273 request->vartype)); 13274 if (request->rw_flag == 0) 13275 return (ncmpi_get_vara_all(request->ncid, request->varid, 13230 13276 request->start, request->count, 13231 13277 request->buf, request->bufcount, … … 13270 13316 datatype[i] = array_of_requests[i]->vartype; 13271 13317 } 13272 13318 if (array_of_requests[0]->rw_flag == 1) 13273 13319 ncmpi_put_mvara_all(ncid, count, varids, 13274 13320 starts, counts, 13275 13321 buf, bufcount, 13276 13322 datatype); 13323 13324 if (array_of_requests[0]->rw_flag == 0) 13325 ncmpi_get_mvara_all(ncid, count, varids, 13326 starts, counts, 13327 buf, bufcount, 13328 datatype); 13329 13330 free(starts); 13331 free(varids); 13332 free(counts); 13333 free(buf); 13334 free(bufcount); 13335 free(datatype); 13277 13336 return NC_NOERR; 13278 13337 } -
trunk/src/lib/pnetcdf.h
r691 r698 86 86 MPI_Offset* start; 87 87 MPI_Offset* count; 88 int rw_flag; 88 89 }; 89 90 typedef struct NCMPI_Req * NCMPI_Request; 91 90 92 #define NCMPI_REQUEST_NULL ((NCMPI_Request)NULL) 91 93 #define NCMPI_REQTYPE_READ 1 … … 698 700 void **buffers, MPI_Offset *bufcounts, 699 701 MPI_Datatype *datatypes); 700 int 701 ncmpi_iput_vara_all(int ncid, int varid,702 703 int ncmpi_iput_vara_all(int ncid, int varid, 702 704 const MPI_Offset start[], const MPI_Offset count[], 703 705 const void *buf, MPI_Offset bufcount, … … 713 715 void **buffers, MPI_Offset *bufcounts, 714 716 MPI_Datatype *datatypes); 717 718 int ncmpi_iget_vara_all(int ncid, int varid, 719 const MPI_Offset start[], const MPI_Offset count[], 720 const void *buf, MPI_Offset bufcount, 721 MPI_Datatype datatype, NCMPI_Request *request); 715 722 716 723 int ncmpi_put_vara(int ncid, int varid, -
trunk/src/libf/Makefile.in
r688 r698 100 100 issyserrf.c \ 101 101 get_file_infof.c \ 102 deletef.c 102 deletef.c \ 103 iput_vara_allf.c \ 104 iget_vara_allf.c \ 105 waitallf.c \ 106 waitf.c \ 107 mvar.c 103 108 104 109 LIB_FSRCS = strerrorf.f inq_libversf.f -
trunk/src/libf/createffiles
r449 r698 5 5 # It makes use of an interface builder developed for MPICH2 and a set of 6 6 # NetCDF-specific descriptions in the file "defs". 7 mpich2SourceDir=${MPICH2SRC:-/home/ gropp/projects/software/mpich2}7 mpich2SourceDir=${MPICH2SRC:-/home/kgao/ChomboIO/mpich2-1.1.1p1} 8 8 9 9 if [ ! -d "$mpich2SourceDir" ] ; then -
trunk/src/libf/defs
r635 r698 21 21 $free = "free"; 22 22 $header_file = "mpinetcdf_impl.h"; 23 24 $tof77{"NCMPI_Request*"} = "int *"; 25 $tof77{"NCMPI_Request*"} = "int *"; 26 $tof77{"NCMPI_Request\[\]"} = "int *"; 27 $tof77{"MPI_Offset**"} = "MPI_Offset *"; 23 28 24 29 # Error return handling … … 216 221 'get_vara_all-3' => 'in:intToSizeTOffsetArr:ncmpixVardim(*v1,*v2-1)', 217 222 'get_vara_all-4' => 'in:intToSizeTArr:ncmpixVardim(*v1,*v2-1)', 223 'iget_vara_all' => '2:3:4', 224 'iget_vara_all-2' => 'in:OffsetIndexIn', 225 'iget_vara_all-3' => 'in:intToSizeTOffsetArr:ncmpixVardim(*v1,*v2-1)', 226 'iget_vara_all-4' => 'in:intToSizeTArr:ncmpixVardim(*v1,*v2-1)', 218 227 'get_vara' => '2:3:4', 219 228 'get_vara-2' => 'in:OffsetIndexIn', … … 578 587 'put_vara_all-3' => 'in:intToSizeTOffsetArr:ncmpixVardim(*v1,*v2-1)', 579 588 'put_vara_all-4' => 'in:intToSizeTArr:ncmpixVardim(*v1,*v2-1)', 589 'put_mvara_all' => '3', 590 'put_mvara_all-3' => 'in:OffsetIndexIn', 591 'iput_vara_all' => '2:3:4', 592 'iput_vara_all-2' => 'in:OffsetIndexIn', 593 'iput_vara_all-3' => 'in:intToSizeTOffsetArr:ncmpixVardim(*v1,*v2-1)', 594 'iput_vara_all-4' => 'in:intToSizeTArr:ncmpixVardim(*v1,*v2-1)', 580 595 'put_vara' => '2:3:4', 581 596 'put_vara-2' => 'in:OffsetIndexIn', -
trunk/src/libf/mpifnetcdf.h
r696 r698 21 21 extern FORTRAN_API int FORT_CALL nfmpi_end_indep_data_ ( int *v1 ); 22 22 extern FORTRAN_API int FORT_CALL nfmpi_close_ ( int *v1 ); 23 extern FORTRAN_API int FORT_CALL nfmpi_wait_ ( NCMPI_Request*v1 );24 extern FORTRAN_API int FORT_CALL nfmpi_waitall_ ( int *v1, NCMPI_Request v2[]);23 extern FORTRAN_API int FORT_CALL nfmpi_wait_ ( MPI_Fint *v1 ); 24 extern FORTRAN_API int FORT_CALL nfmpi_waitall_ ( int *v1, MPI_Fint * v2 ); 25 25 extern FORTRAN_API int FORT_CALL nfmpi_set_fill_ ( int *v1, int *v2, MPI_Fint *v3 ); 26 26 extern FORTRAN_API int FORT_CALL nfmpi_def_dim_ ( int *v1, char *v2 FORT_MIXED_LEN(d2), MPI_Offset *v3, MPI_Fint *v4 FORT_END_LEN(d2) ); … … 101 101 extern FORTRAN_API int FORT_CALL nfmpi_get_var_double_all_ ( int *v1, int *v2, double*v3 ); 102 102 extern FORTRAN_API int FORT_CALL nfmpi_put_vara_all_ ( int *v1, int *v2, MPI_Offset v3[], MPI_Offset v4[], void*v5, MPI_Offset *v6, MPI_Fint *v7 ); 103 extern FORTRAN_API int FORT_CALL nfmpi_put_mvara_all_ ( int *v1, int *v2, MPI_Fint v3[], MPI_Offset**starts v4, MPI_Offset**counts v5, void**buffers v6, MPI_Offset*v7, MPI_Fint *v8 ); 103 extern FORTRAN_API int FORT_CALL nfmpi_put_mvara_all_ ( int *v1, int *v2, MPI_Fint v3[], MPI_Offset**v4, MPI_Offset**v5, void**v6, MPI_Offset*v7, MPI_Fint *v8 ); 104 extern FORTRAN_API int FORT_CALL nfmpi_iput_vara_all_ ( int *v1, int *v2, MPI_Offset v3[], MPI_Offset v4[], void*v5, MPI_Offset *v6, MPI_Fint *v7, MPI_Fint *v8 ); 104 105 extern FORTRAN_API int FORT_CALL nfmpi_get_vara_all_ ( int *v1, int *v2, MPI_Offset v3[], MPI_Offset v4[], void*v5, MPI_Offset *v6, MPI_Fint *v7 ); 105 extern FORTRAN_API int FORT_CALL nfmpi_get_mvara_all_ ( int *v1, int *v2, MPI_Fint v3[], MPI_Offset**starts v4, MPI_Offset**counts v5, void**buffers v6, MPI_Offset*v7, MPI_Fint *v8 ); 106 extern FORTRAN_API int FORT_CALL nfmpi_get_mvara_all_ ( int *v1, int *v2, MPI_Fint v3[], MPI_Offset**v4, MPI_Offset**v5, void**v6, MPI_Offset*v7, MPI_Fint *v8 ); 107 extern FORTRAN_API int FORT_CALL nfmpi_iget_vara_all_ ( int *v1, int *v2, MPI_Offset v3[], MPI_Offset v4[], void*v5, MPI_Offset *v6, MPI_Fint *v7, MPI_Fint *v8 ); 106 108 extern FORTRAN_API int FORT_CALL nfmpi_put_vara_ ( int *v1, int *v2, MPI_Offset v3[], MPI_Offset v4[], void*v5, MPI_Offset *v6, MPI_Fint *v7 ); 107 109 extern FORTRAN_API int FORT_CALL nfmpi_get_vara_ ( int *v1, int *v2, MPI_Offset v3[], MPI_Offset v4[], void*v5, MPI_Offset *v6, MPI_Fint *v7 ); -
trunk/src/libf/mpinetcdf_impl.h
r592 r698 66 66 /* Fortran logical values */ 67 67 68 68 69 #endif 69 70 -
trunk/src/libf/put_mvara_allf.c
r696 r698 22 22 /* Prototypes for the Fortran interfaces */ 23 23 #include "mpifnetcdf.h" 24 FORTRAN_API int FORT_CALL nfmpi_put_mvara_all_ ( int *v1, int *v2, MPI_Fint v3[], MPI_Offset** starts v4, MPI_Offset**counts v5, void**buffersv6, MPI_Offset*v7, MPI_Fint *v8 ){24 FORTRAN_API int FORT_CALL nfmpi_put_mvara_all_ ( int *v1, int *v2, MPI_Fint v3[], MPI_Offset** v4, MPI_Offset** v5, void** v6, MPI_Offset*v7, MPI_Fint *v8 ){ 25 25 int ierr; 26 ierr = ncmpi_put_mvara_all( *v1, *v2, v3, v4, v5, v6, v7, (fixme][ *)(v8) ); 26 int l3 = *v3 - 1; 27 ierr = ncmpi_put_mvara_all( *v1, *v2, l3, v4, v5, v6, v7, (fixme][ *)(v8) ); 27 28 return ierr; 28 29 } -
trunk/src/libf/waitallf.c
r696 r698 8 8 */ 9 9 #include "mpinetcdf_impl.h" 10 #include "mvar.h" 10 11 11 12 … … 22 23 /* Prototypes for the Fortran interfaces */ 23 24 #include "mpifnetcdf.h" 24 FORTRAN_API int FORT_CALL nfmpi_waitall_ ( int *v1, NCMPI_Request v2[] ){ 25 FORTRAN_API int FORT_CALL nfmpi_waitall_ ( int *v1, MPI_Fint * v2 ){ 26 extern lnc_req *req_head ; 27 extern lnc_req *req_tail ; 25 28 int ierr; 26 ierr = ncmpi_waitall( *v1, *v2 ); 29 NCMPI_Request *l2_req; 30 int i,j; 31 lnc_req *tmp_req = NULL; 32 l2_req = malloc((*v1)*sizeof(NCMPI_Request)); 33 tmp_req = req_head; 34 35 i = 0; 36 while(tmp_req != NULL){ 37 l2_req[i]= tmp_req->req; 38 tmp_req = tmp_req->next; 39 i++; 40 } 41 42 ierr = ncmpi_waitall( *v1, l2_req ); 43 44 while(req_head != NULL){ 45 tmp_req = req_head; 46 req_head = req_head->next; 47 free(tmp_req); 48 } 49 req_tail = NULL; 50 51 free(l2_req); 52 27 53 return ierr; 28 54 } -
trunk/src/libf/waitf.c
r696 r698 8 8 */ 9 9 #include "mpinetcdf_impl.h" 10 10 #include "mvar.h" 11 11 12 12 #ifdef F77_NAME_UPPER … … 22 22 /* Prototypes for the Fortran interfaces */ 23 23 #include "mpifnetcdf.h" 24 FORTRAN_API int FORT_CALL nfmpi_wait_ ( NCMPI_Request*v1 ){24 FORTRAN_API int FORT_CALL nfmpi_wait_ ( MPI_Fint *v1 ){ 25 25 int ierr; 26 ierr = ncmpi_wait( v1 ); 26 lnc_req *tmp_req1 = NULL; 27 lnc_req *tmp_req2 = NULL; 28 NCMPI_Request l1_req; 29 extern lnc_req *req_head ; 30 extern lnc_req *req_tail ; 31 // l1_req = nc_requset_list[*v1] ; 32 tmp_req1 = req_head; 33 while(tmp_req1 != NULL){ 34 if (tmp_req1->reqid == *v1){ 35 break; 36 } else { 37 tmp_req2 = tmp_req1; 38 tmp_req1 = tmp_req1->next; 39 } 40 } 41 l1_req = tmp_req1->req; 42 ierr = ncmpi_wait( &tmp_req1->req ); 43 if (req_head->reqid == *v1){ 44 if (req_head->next == NULL){ 45 req_head = NULL; 46 req_tail = NULL; 47 } else { 48 req_head = req_head->next; 49 } 50 free(tmp_req1); 51 } else { 52 if (req_tail->reqid == tmp_req1->reqid) 53 req_tail = tmp_req2; 54 else 55 tmp_req2 = tmp_req1->next; 56 free(tmp_req1); 57 } 58 27 59 return ierr; 60 28 61 } -
trunk/test/Makefile.in
r678 r698 1 1 srcdir = @srcdir@ 2 2 VPATH = @srcdir@ 3 SUBDIRS = common test_double test_double_int test_float test_int test_dtype nc_test fandc nf_test largefile C mcoll_perf test_check_header testcases3 SUBDIRS = common test_double test_double_int test_float test_int test_dtype nc_test fandc nf_test largefile C mcoll_perf mcoll_fortran test_check_header testcases 4 4 5 5 all:
![(please configure the [header_logo] section in trac.ini)](/projects/parallel-netcdf/chrome/common/trac_banner.png)