Ignore:
Timestamp:
05/31/17 10:51:06 (7 years ago)
Author:
yushan
Message:

bug fixed in mpi_comm_split. Key needs to be specifify.

Location:
XIOS/dev/branch_yushan_merged/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_yushan_merged/src/io/netCdfInterface.cpp

    r1146 r1149  
    128128int CNetCdfInterface::close(int ncId) 
    129129{ 
    130   int status = nc_close(ncId); 
     130  int status = NC_NOERR; 
     131  //#pragma omp critical (_netcdf) 
     132  #pragma omp master 
     133  { 
     134  status = nc_close(ncId); 
    131135  if (NC_NOERR != status) 
    132136  { 
     
    139143    throw CNetCdfException(e); 
    140144  } 
    141  
     145  } 
    142146  return status; 
    143147} 
  • XIOS/dev/branch_yushan_merged/src/node/field.cpp

    r1134 r1149  
    2626namespace xios{ 
    2727 
    28    /// ////////////////////// Définitions ////////////////////// /// 
     28   /// ////////////////////// Dfinitions ////////////////////// /// 
    2929 
    3030   CField::CField(void) 
     
    691691     CContext* context = CContext::getCurrent(); 
    692692     solveOnlyReferenceEnabledField(doSending2Server); 
     693     int myRank; 
     694     MPI_Comm_rank(context->client->intraComm, &myRank); 
    693695 
    694696     if (!areAllReferenceSolved) 
     
    711713     if (context->hasClient) 
    712714     { 
     715       MPI_Barrier(context->client->intraComm); 
     716       printf("Proc %d enters function\n", myRank); 
    713717       solveTransformedGrid(); 
     718       MPI_Barrier(context->client->intraComm); 
     719       printf("Proc %d exits function\n", myRank); 
    714720     } 
    715721 
  • XIOS/dev/branch_yushan_merged/src/node/file.cpp

    r1146 r1149  
    634634 
    635635     // Now everything is ok, close it 
    636      close(); 
     636     //close(); 
    637637   } 
    638638 
  • XIOS/dev/branch_yushan_merged/src/transformation/domain_algorithm_interpolate.cpp

    r1134 r1149  
    404404  CContext* context = CContext::getCurrent(); 
    405405  CContextClient* client=context->client; 
     406  int split_key; 
     407  ep_lib::MPI_Comm_rank(client->intraComm, &split_key); 
    406408 
    407409  ep_lib::MPI_Comm poleComme(MPI_COMM_NULL); 
    408   ep_lib::MPI_Comm_split(client->intraComm, interMapValuePole.empty() ? MPI_UNDEFINED : 1, 0, &poleComme); 
     410  ep_lib::MPI_Comm_split(client->intraComm, interMapValuePole.empty() ? 9 : 1, split_key, &poleComme); 
    409411  if (MPI_COMM_NULL != poleComme) 
    410412  { 
     
    421423    std::vector<int> recvCount(nbClientPole,0); 
    422424    std::vector<int> displ(nbClientPole,0); 
    423     MPI_Allgather(&nbWeight,1,MPI_INT,&recvCount[0],1,MPI_INT,poleComme) ; 
     425    ep_lib::MPI_Allgather(&nbWeight,1,MPI_INT,&recvCount[0],1,MPI_INT,poleComme) ; 
    424426 
    425427    displ[0]=0; 
    426428    for(int n=1;n<nbClientPole;++n) displ[n]=displ[n-1]+recvCount[n-1] ; 
    427429    int recvSize=displ[nbClientPole-1]+recvCount[nbClientPole-1] ; 
     430     
    428431 
    429432    std::vector<int> sendSourceIndexBuff(nbWeight); 
     
    444447 
    445448    // Gather all index and weight for pole 
    446     MPI_Allgatherv(&sendSourceIndexBuff[0],nbWeight,MPI_INT,&recvSourceIndexBuff[0],&recvCount[0],&displ[0],MPI_INT,poleComme); 
    447     MPI_Allgatherv(&sendSourceWeightBuff[0],nbWeight,MPI_DOUBLE,&recvSourceWeightBuff[0],&recvCount[0],&displ[0],MPI_DOUBLE,poleComme); 
     449    ep_lib::MPI_Allgatherv(&sendSourceIndexBuff[0],nbWeight,MPI_INT,&recvSourceIndexBuff[0],&recvCount[0],&displ[0],MPI_INT,poleComme); 
     450    ep_lib::MPI_Allgatherv(&sendSourceWeightBuff[0],nbWeight,MPI_DOUBLE,&recvSourceWeightBuff[0],&recvCount[0],&displ[0],MPI_DOUBLE,poleComme); 
    448451 
    449452    std::map<int,double> recvTemp; 
     
    567570 
    568571 
    569   MPI_Allreduce(sendBuff, recvBuff, nbClient, MPI_INT, MPI_SUM, client->intraComm); 
     572  ep_lib::MPI_Allreduce(sendBuff, recvBuff, nbClient, MPI_INT, MPI_SUM, client->intraComm); 
    570573 
    571574  int* sendIndexDestBuff = new int [sendBuffSize]; 
     
    595598 
    596599    sendRequest.push_back(ep_lib::MPI_Request()); 
    597     MPI_Isend(sendIndexDestBuff + sendOffSet, 
     600    ep_lib::MPI_Isend(sendIndexDestBuff + sendOffSet, 
    598601             k, 
    599602             MPI_INT, 
     
    603606             &sendRequest.back()); 
    604607    sendRequest.push_back(ep_lib::MPI_Request()); 
    605     MPI_Isend(sendIndexSrcBuff + sendOffSet, 
     608    ep_lib::MPI_Isend(sendIndexSrcBuff + sendOffSet, 
    606609             k, 
    607610             MPI_INT, 
     
    611614             &sendRequest.back()); 
    612615    sendRequest.push_back(ep_lib::MPI_Request()); 
    613     MPI_Isend(sendWeightBuff + sendOffSet, 
     616    ep_lib::MPI_Isend(sendWeightBuff + sendOffSet, 
    614617             k, 
    615618             MPI_DOUBLE, 
     
    630633  { 
    631634    ep_lib::MPI_Status recvStatus; 
    632     MPI_Recv((recvIndexDestBuff + receivedSize), 
     635    ep_lib::MPI_Recv((recvIndexDestBuff + receivedSize), 
    633636             recvBuffSize, 
    634637             MPI_INT, 
     
    639642 
    640643    int countBuff = 0; 
    641     MPI_Get_count(&recvStatus, MPI_INT, &countBuff); 
     644    ep_lib::MPI_Get_count(&recvStatus, MPI_INT, &countBuff); 
    642645    #ifdef _usingMPI 
    643646    clientSrcRank = recvStatus.MPI_SOURCE; 
     
    645648    clientSrcRank = recvStatus.ep_src; 
    646649    #endif 
    647     MPI_Recv((recvIndexSrcBuff + receivedSize), 
     650    ep_lib::MPI_Recv((recvIndexSrcBuff + receivedSize), 
    648651             recvBuffSize, 
    649652             MPI_INT, 
     
    653656             &recvStatus); 
    654657 
    655     MPI_Recv((recvWeightBuff + receivedSize), 
     658    ep_lib::MPI_Recv((recvWeightBuff + receivedSize), 
    656659             recvBuffSize, 
    657660             MPI_DOUBLE, 
     
    671674  std::vector<ep_lib::MPI_Status> requestStatus(sendRequest.size()); 
    672675  ep_lib::MPI_Status stat_ignore; 
    673   MPI_Waitall(sendRequest.size(), &sendRequest[0], &stat_ignore); 
     676  ep_lib::MPI_Waitall(sendRequest.size(), &sendRequest[0], &stat_ignore); 
    674677 
    675678  delete [] sendIndexDestBuff; 
     
    761764  } 
    762765 
    763   MPI_Allreduce(&localNbWeight, &globalNbWeight, 1, MPI_LONG, MPI_SUM, client->intraComm); 
     766  ep_lib::MPI_Allreduce(&localNbWeight, &globalNbWeight, 1, MPI_LONG, MPI_SUM, client->intraComm); 
    764767  ep_lib::MPI_Scan(&localNbWeight, &startIndex, 1, MPI_LONG, MPI_SUM, client->intraComm); 
    765768   
Note: See TracChangeset for help on using the changeset viewer.