Ignore:
Timestamp:
06/29/18 17:16:31 (6 years ago)
Author:
yushan
Message:

all netcdf routines inside critical section

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/src/transformation/domain_algorithm_interpolate.cpp

    r1545 r1555  
    807807   
    808808  int my_rank_loc = client->intraComm->ep_comm_ptr->size_rank_info[1].first; 
    809    
    810   cout<<"begin write weight info"<< endl; 
     809  int my_rank = client->intraComm->ep_comm_ptr->size_rank_info[0].first; 
     810   
     811   
    811812  
    812813  WriteNetCdf *netCdfWriter; 
    813814 
    814  
    815815  MPI_Barrier_local(client->intraComm); 
     816   
    816817  if(my_rank_loc==0) 
    817818  { 
    818    
     819    info(100)<<"rank "<< my_rank <<" create weight info file"<< std::endl; 
     820     
    819821    WriteNetCdf my_writer(filename, client->intraComm);   
     822    info(100)<<"rank "<< my_rank <<" file created"<< std::endl; 
    820823    netCdfWriter = &my_writer;  
    821824   
     
    824827    netCdfWriter->addDimensionWrite("n_dst", n_dst); 
    825828    netCdfWriter->addDimensionWrite("n_weight", globalNbWeight); 
     829    info(100)<<"rank "<< my_rank <<" addDimensionWrite : n_src, n_dst, n_weight"<< std::endl; 
    826830   
    827831    std::vector<StdString> dims(1,"n_weight"); 
     
    831835    netCdfWriter->addVariableWrite("dst_idx", NC_INT, dims); 
    832836    netCdfWriter->addVariableWrite("weight", NC_DOUBLE, dims); 
     837     
     838    info(100)<<"rank "<< my_rank <<" addVariableWrite : src_idx, dst_idx, weight"<< std::endl; 
    833839 
    834840    // End of definition 
    835841    netCdfWriter->endDefinition(); 
     842    info(100)<<"rank "<< my_rank <<" endDefinition"<< std::endl; 
    836843   
    837844    netCdfWriter->closeFile(); 
    838   } 
    839    
    840  
     845    info(100)<<"rank "<< my_rank <<" file closed"<< std::endl; 
     846  } 
     847   
    841848  MPI_Barrier_local(client->intraComm); 
    842849   
     
    844851  { 
    845852    // open file 
     853    info(100)<<"rank "<< my_rank <<" writing in weight info file"<< std::endl; 
     854     
    846855    WriteNetCdf my_writer(filename, true, client->intraComm);   
     856    info(100)<<"rank "<< my_rank <<" file opened"<< std::endl; 
    847857    netCdfWriter = &my_writer;  
    848858     
     
    853863      netCdfWriter->writeDataIndex(dst_idx, "dst_idx", false, 0, &start, &count); 
    854864      netCdfWriter->writeDataIndex(weights, "weight", false, 0, &start, &count); 
    855     } 
     865       
     866      info(100)<<"rank "<< my_rank <<" WriteDataIndex : src_idx, dst_idx, weight"<< std::endl; 
     867    } 
     868     
     869    netCdfWriter->closeFile(); 
     870    info(100)<<"rank "<< my_rank <<" file closed"<< std::endl; 
     871     
    856872  } 
    857873   
Note: See TracChangeset for help on using the changeset viewer.