Changeset 1153 for XIOS/dev/branch_yushan_merged/src
- Timestamp:
- 06/02/17 17:53:25 (7 years ago)
- Location:
- XIOS/dev/branch_yushan_merged/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_yushan_merged/src/io/netCdfInterface.cpp
r1149 r1153 75 75 int CNetCdfInterface::open(const StdString& fileName, int oMode, int& ncId) 76 76 { 77 int status = nc_open(fileName.c_str(), oMode, &ncId); 77 int status = NC_NOERR; 78 #pragma omp critical (_netcdf) 79 status = nc_open(fileName.c_str(), oMode, &ncId); 80 78 81 if (NC_NOERR != status) 79 82 { … … 105 108 int status; 106 109 #pragma omp critical (_netcdf) 107 status = xios::nc_open_par(fileName.c_str(), oMode, comm, info, &ncId); 110 status = xios::nc_open_par(fileName.c_str(), oMode, comm, info, &ncId); // nc_open 108 111 if (NC_NOERR != status) 109 112 { … … 129 132 { 130 133 int status = NC_NOERR; 131 //#pragma omp critical (_netcdf)132 #pragma omp master134 #pragma omp critical (_netcdf) 135 //#pragma omp master 133 136 { 134 137 status = nc_close(ncId); -
XIOS/dev/branch_yushan_merged/src/node/field.cpp
r1149 r1153 713 713 if (context->hasClient) 714 714 { 715 MPI_Barrier(context->client->intraComm);716 printf("Proc %d enters function\n", myRank);715 //MPI_Barrier(context->client->intraComm); 716 //printf("Proc %d enters function\n", myRank); 717 717 solveTransformedGrid(); 718 MPI_Barrier(context->client->intraComm);719 printf("Proc %d exits function\n", myRank);718 //MPI_Barrier(context->client->intraComm); 719 //printf("Proc %d exits function\n", myRank); 720 720 } 721 721 -
XIOS/dev/branch_yushan_merged/src/node/file.cpp
r1149 r1153 578 578 bool isCollective = par_access.isEmpty() || par_access == par_access_attr::collective; 579 579 580 #ifdef _usingEP 581 if(omp_get_num_threads() != 1 ) multifile = true; 582 #endif 583 580 584 if (isOpen) data_out->closeFile(); 581 585 if (time_counter_name.isEmpty()) data_in = shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), static_cast< ::MPI_Comm >(fileComm.mpi_comm), multifile, isCollective)); … … 609 613 610 614 // It would probably be better to call initFile() somehow 615 611 616 MPI_Comm_dup(client->intraComm, &fileComm); 612 617 if (time_counter_name.isEmpty()) time_counter_name = "time_counter"; 613 618 614 //#pragma omp critical (_checkFile) 615 checkFile(); 619 //#pragma omp critical (_readAttributesOfEnabledFieldsInReadMode_) 620 //{ 621 checkFile(); // calls nc_open 616 622 617 623 for (int idx = 0; idx < enabledFields.size(); ++idx) … … 627 633 628 634 // Read necessary value from file 629 this->data_in->readFieldAttributesValues(enabledFields[idx]); 630 635 #pragma omp critical (_func) 636 { 637 //checkFile(); 638 this->data_in->readFieldAttributesValues(enabledFields[idx]); 639 //close(); 640 } 641 631 642 // Fill attributes for base reference 632 643 enabledFields[idx]->solveGridDomainAxisBaseRef(); … … 634 645 635 646 // Now everything is ok, close it 636 //close(); 647 close(); 648 //} 649 650 //if (fileComm != MPI_COMM_NULL) MPI_Comm_free(&fileComm); 651 637 652 } 638 653 -
XIOS/dev/branch_yushan_merged/src/test/test_remap_omp.f90
r1146 r1153 52 52 if(rank < size-2) then 53 53 54 !$omp parallel default(firstprivate) 54 !$omp parallel default(firstprivate) firstprivate(dtime) 55 55 56 56 !!! XIOS Initialization (get the local communicator) … … 59 59 CALL MPI_COMM_RANK(comm,rank,ierr) 60 60 CALL MPI_COMM_SIZE(comm,size,ierr) 61 62 rank = rank*omp_get_num_threads() + omp_get_thread_num() 63 size = size*omp_get_num_threads() 61 64 62 65 … … 202 205 203 206 CALL xios_close_context_definition() 207 208 CALL xios_get_domain_attr("src_domain_regular_read", ni=src_tmp_ni, nj=src_tmp_nj) 209 ALLOCATE(tmp_field_0(src_tmp_ni*src_tmp_nj)) 210 211 CALL xios_get_axis_attr("src_axis_curvilinear_read", n=src_tmp_n) 212 CALL xios_get_domain_attr("src_domain_curvilinear_read", ni=src_tmp_ni, nj=src_tmp_nj) 213 ALLOCATE(tmp_field_1(src_tmp_ni*src_tmp_nj*src_tmp_n)) 214 215 CALL xios_get_domain_attr("src_domain_unstructured_read", ni=src_tmp_ni, nj=src_tmp_nj) 216 ALLOCATE(tmp_field_2(src_tmp_ni*src_tmp_nj)) 217 218 CALL xios_recv_field("src_field_regular", tmp_field_0) 219 CALL xios_recv_field("src_field_curvilinear", tmp_field_1) 220 CALL xios_recv_field("src_field_unstructured", tmp_field_2) 221 222 DO ts=1,10 223 CALL xios_update_calendar(ts) 224 CALL xios_send_field("src_field_2D",src_field_2D) 225 226 DO i=1,src_ni 227 src_field_2D_clone(i) = src_field_2D(i) 228 IF ((23.5 * ts < src_lat(i)) .AND. (src_lat(i) < 65.5 *ts) .AND. (0 < src_lon(i)) .AND. (src_lon(i) < 30*ts)) THEN 229 src_field_2D_clone(i) = missing_value 230 ENDIF 231 ENDDO 232 233 CALL xios_send_field("src_field_2D_clone",src_field_2D_clone) 234 CALL xios_send_field("src_field_3D",src_field_3D) 235 CALL xios_send_field("src_field_3D_clone",src_field_3D) 236 CALL xios_send_field("src_field_4D",src_field_4D) 237 CALL xios_send_field("src_field_3D_pression",src_field_pression) 238 CALL xios_send_field("tmp_field_0",tmp_field_0) 239 CALL xios_send_field("tmp_field_1",tmp_field_1) 240 CALL xios_send_field("tmp_field_2",tmp_field_2) 241 CALL wait_us(5000) ; 242 ENDDO 204 243 205 244 CALL xios_context_finalize() 245 246 DEALLOCATE(src_lon, src_lat, src_boundslon,src_boundslat, src_field_2D) 247 DEALLOCATE(dst_lon, dst_lat, dst_boundslon,dst_boundslat) 248 DEALLOCATE(tmp_field_0, tmp_field_1, tmp_field_2) 206 249 207 250 CALL xios_finalize() -
XIOS/dev/branch_yushan_merged/src/transformation/Functions/reduction.cpp
r1134 r1153 50 50 (*CReductionAlgorithm::ReductionOperations_ptr)["average"] = TRANS_REDUCE_AVERAGE; 51 51 CAverageReductionAlgorithm::registerTrans(); 52 53 printf("*CReductionAlgorithm::ReductionOperations_ptr = %p\t %p\n", *CReductionAlgorithm::ReductionOperations_ptr, &(*CReductionAlgorithm::ReductionOperations_ptr)); 52 54 } 53 55 -
XIOS/dev/branch_yushan_merged/src/transformation/scalar_algorithm_reduce_axis.cpp
r1134 r1153 75 75 } 76 76 77 if ((*CReductionAlgorithm::ReductionOperations_ptr).end() == (*CReductionAlgorithm::ReductionOperations_ptr).find(op)) 78 ERROR("CScalarAlgorithmReduceAxis::CScalarAlgorithmReduceAxis(CAxis* axisDestination, CAxis* axisSource, CReduceAxisToScalar* algo)", 79 << "Operation '" << op << "' not found. Please make sure to use a supported one" 80 << "Axis source " <<axisSource->getId() << std::endl 81 << "Scalar destination " << scalarDestination->getId()); 77 //if ((*CReductionAlgorithm::ReductionOperations_ptr).end() == (*CReductionAlgorithm::ReductionOperations_ptr).find(op)) 78 // if ((CReductionAlgorithm::ReductionOperations_ptr)->end() == (CReductionAlgorithm::ReductionOperations_ptr)->find(op)) 79 // ERROR("CScalarAlgorithmReduceAxis::CScalarAlgorithmReduceAxis(CAxis* axisDestination, CAxis* axisSource, CReduceAxisToScalar* algo)", 80 // << "Operation '" << op << "' not found. Please make sure to use a supported one" 81 // << "Axis source " <<axisSource->getId() << std::endl 82 // << "Scalar destination " << scalarDestination->getId()); 82 83 83 84 reduction_ = CReductionAlgorithm::createOperation((*CReductionAlgorithm::ReductionOperations_ptr)[op]);
Note: See TracChangeset
for help on using the changeset viewer.