Changeset 1339


Ignore:
Timestamp:
11/21/17 13:42:35 (7 years ago)
Author:
yushan
Message:

dev_omp OK

Location:
XIOS/dev/branch_openmp
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/extern/remap/src/mapper.cpp

    r1338 r1339  
    243243  int *nbRecvElement = new int[mpiSize]; 
    244244  MPI_Alltoall(nbSendElement, 1, MPI_INT, nbRecvElement, 1, MPI_INT, communicator); 
     245   
    245246 
    246247  /* communicate indices of source elements on other ranks whoes value and gradient we need (since intersection) */ 
     
    315316      MPI_Issend(sendValue[rank],  nbRecvElement[rank], MPI_DOUBLE, rank, 0, communicator, &sendRequest[nbSendRequest]); 
    316317      nbSendRequest++; 
    317       MPI_Issend(sendArea[rank],  nbRecvElement[rank], MPI_DOUBLE, rank, 0, communicator, &sendRequest[nbSendRequest]); 
     318      MPI_Issend(sendArea[rank],  nbRecvElement[rank], MPI_DOUBLE, rank, 1, communicator, &sendRequest[nbSendRequest]); 
    318319      nbSendRequest++; 
    319320      if (order == 2) 
    320321      { 
    321         MPI_Issend(sendGrad[rank], 3*nbRecvElement[rank]*(NMAX+1), MPI_DOUBLE, rank, 0, communicator, &sendRequest[nbSendRequest]); 
     322        MPI_Issend(sendGrad[rank], 3*nbRecvElement[rank]*(NMAX+1), MPI_DOUBLE, rank, 2, communicator, &sendRequest[nbSendRequest]); 
    322323        nbSendRequest++; 
    323         MPI_Issend(sendNeighIds[rank], 4*nbRecvElement[rank]*(NMAX+1), MPI_INT, rank, 0, communicator, &sendRequest[nbSendRequest]); 
     324        MPI_Issend(sendNeighIds[rank], 4*nbRecvElement[rank]*(NMAX+1), MPI_INT, rank, 3, communicator, &sendRequest[nbSendRequest]); 
    324325//ym  --> attention taille GloId 
    325326        nbSendRequest++; 
     
    327328      else 
    328329      { 
    329         MPI_Issend(sendNeighIds[rank], 4*nbRecvElement[rank], MPI_INT, rank, 0, communicator, &sendRequest[nbSendRequest]); 
     330        MPI_Issend(sendNeighIds[rank], 4*nbRecvElement[rank], MPI_INT, rank, 4, communicator, &sendRequest[nbSendRequest]); 
    330331//ym  --> attention taille GloId 
    331332        nbSendRequest++; 
     
    336337      MPI_Irecv(recvValue[rank],  nbSendElement[rank], MPI_DOUBLE, rank, 0, communicator, &recvRequest[nbRecvRequest]); 
    337338      nbRecvRequest++; 
    338       MPI_Irecv(recvArea[rank],  nbSendElement[rank], MPI_DOUBLE, rank, 0, communicator, &recvRequest[nbRecvRequest]); 
     339      MPI_Irecv(recvArea[rank],  nbSendElement[rank], MPI_DOUBLE, rank, 1, communicator, &recvRequest[nbRecvRequest]); 
    339340      nbRecvRequest++; 
    340341      if (order == 2) 
    341342      { 
    342         MPI_Irecv(recvGrad[rank], 3*nbSendElement[rank]*(NMAX+1), MPI_DOUBLE, rank, 0, communicator, &recvRequest[nbRecvRequest]); 
     343        MPI_Irecv(recvGrad[rank], 3*nbSendElement[rank]*(NMAX+1), MPI_DOUBLE, rank, 2, communicator, &recvRequest[nbRecvRequest]); 
    343344        nbRecvRequest++; 
    344         MPI_Irecv(recvNeighIds[rank], 4*nbSendElement[rank]*(NMAX+1), MPI_INT, rank, 0, communicator, &recvRequest[nbRecvRequest]); 
     345        MPI_Irecv(recvNeighIds[rank], 4*nbSendElement[rank]*(NMAX+1), MPI_INT, rank, 3, communicator, &recvRequest[nbRecvRequest]); 
    345346//ym  --> attention taille GloId 
    346347        nbRecvRequest++; 
     
    348349      else 
    349350      { 
    350         MPI_Irecv(recvNeighIds[rank], 4*nbSendElement[rank], MPI_INT, rank, 0, communicator, &recvRequest[nbRecvRequest]); 
     351        MPI_Irecv(recvNeighIds[rank], 4*nbSendElement[rank], MPI_INT, rank, 4, communicator, &recvRequest[nbRecvRequest]); 
    351352//ym  --> attention taille GloId 
    352353        nbRecvRequest++; 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_alltoall.cpp

    r1295 r1339  
    5959      delete[] tmp_sendbuf; 
    6060    } 
     61     
     62    MPI_Barrier(comm); 
    6163 
    6264    return 0; 
  • XIOS/dev/branch_openmp/inputs/REMAP/iodef.xml

    r1338 r1339  
    5858          <field field_ref="dst_field_2D_regular_pole" name="field_dst_regular_2" enabled=".TRUE."/> 
    5959          <field field_ref="dst_field_2D_clone" name="field_dst_regular_3" detect_missing_value=".false." default_value="100000" enabled=".FALSE."/> 
    60           <field field_ref="dst_field_2D_extract" name="field_dst_regular_4" enabled=".FALSE."/> 
     60          <field field_ref="dst_field_2D_extract" name="field_dst_regular_4" enabled=".TRUE."/> 
    6161        </file>  
    6262       <file id="output_3D" name="output_3D" enabled=".TRUE."> 
     
    6868       <file id="output_4D" name="output_4D" enabled=".TRUE."> 
    6969          <field field_ref="src_field_4D" name="field_4D" /> 
    70           <field field_ref="dst_field_4D_extract" name="field_4D_extract" enabled=".FALSE."/> 
     70          <field field_ref="dst_field_4D_extract" name="field_4D_extract" enabled=".TRUE."/> 
    7171        </file> 
    7272     </file_group> 
  • XIOS/dev/branch_openmp/src/transformation/Functions/reduction.cpp

    r1328 r1339  
    99 
    1010CReductionAlgorithm::CallBackMap* CReductionAlgorithm::reductionCreationCallBacks_ = 0; 
    11 //std::map<StdString,EReductionType> CReductionAlgorithm::ReductionOperations = std::map<StdString,EReductionType>(); 
    1211std::map<StdString,EReductionType> *CReductionAlgorithm::ReductionOperations_ptr = 0; 
    1312 
     
    5251 
    5352//bool CReductionAlgorithm::_dummyInit = CReductionAlgorithm::initReductionOperation(CReductionAlgorithm::ReductionOperations); 
    54 bool CReductionAlgorithm::_dummyInit = CReductionAlgorithm::initReductionOperation(); 
     53//bool CReductionAlgorithm::_dummyInit = CReductionAlgorithm::initReductionOperation(); 
    5554 
    5655CReductionAlgorithm* CReductionAlgorithm::createOperation(EReductionType reduceType) 
  • XIOS/dev/branch_openmp/src/transformation/Functions/reduction.hpp

    r1331 r1339  
    1616namespace xios { 
    1717 
    18 /*! 
     18/*!   
    1919  \class CReductionAlgorithm 
    2020  Interface for all reduction alogrithms. 
  • XIOS/dev/branch_openmp/src/transformation/axis_algorithm_extract_domain.cpp

    r1328 r1339  
    1313#include "grid.hpp" 
    1414#include "grid_transformation_factory_impl.hpp" 
    15 #include "reduction.hpp" 
    1615 
    1716namespace xios { 
     
    6261 
    6362  pos_ = algo->position; 
    64   //reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 
     63  if(CReductionAlgorithm::ReductionOperations_ptr == 0)  
     64  { 
     65    CReductionAlgorithm::initReductionOperation(); 
     66  } 
    6567  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations_ptr->at(op)); 
    6668} 
  • XIOS/dev/branch_openmp/src/transformation/axis_algorithm_extract_domain.hpp

    r1328 r1339  
    1313#include "transformation.hpp" 
    1414 
     15#include "reduction.hpp" 
    1516namespace xios { 
    1617 
     
    2526  Extract a domain to an axis 
    2627*/ 
    27 class CAxisAlgorithmExtractDomain : public CAxisAlgorithmTransformation 
     28class CAxisAlgorithmExtractDomain : public CAxisAlgorithmTransformation, public CReductionAlgorithm 
    2829{ 
    2930public: 
  • XIOS/dev/branch_openmp/src/transformation/axis_algorithm_reduce_domain.cpp

    r1328 r1339  
    1313#include "grid.hpp" 
    1414#include "grid_transformation_factory_impl.hpp" 
    15 #include "reduction.hpp" 
    1615 
    1716namespace xios { 
     
    7069 
    7170  dir_ = (CReduceDomainToAxis::direction_attr::iDir == algo->direction)  ? iDir : jDir; 
    72   //reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 
     71  if(CReductionAlgorithm::ReductionOperations_ptr == 0)  
     72  { 
     73    CReductionAlgorithm::initReductionOperation(); 
     74  } 
    7375  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations_ptr->at(op)); 
    7476} 
  • XIOS/dev/branch_openmp/src/transformation/axis_algorithm_reduce_domain.hpp

    r1328 r1339  
    1212#include "axis_algorithm_transformation.hpp" 
    1313#include "transformation.hpp" 
     14#include "reduction.hpp" 
    1415 
    1516namespace xios { 
     
    2425  Reduce a domain to an axis 
    2526*/ 
    26 class CAxisAlgorithmReduceDomain : public CAxisAlgorithmTransformation 
     27class CAxisAlgorithmReduceDomain : public CAxisAlgorithmTransformation, public CReductionAlgorithm 
    2728{ 
    2829public: 
  • XIOS/dev/branch_openmp/src/transformation/scalar_algorithm_extract_axis.cpp

    r1328 r1339  
    1414#include "grid_transformation_factory_impl.hpp" 
    1515 
    16 #include "reduction.hpp" 
    1716 
    1817namespace xios { 
     
    4948  StdString op = "extract"; 
    5049  pos_ = algo->position; 
    51   //reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 
     50  if(CReductionAlgorithm::ReductionOperations_ptr == 0)  
     51  { 
     52    CReductionAlgorithm::initReductionOperation(); 
     53  } 
    5254  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations_ptr->at(op)); 
    5355} 
  • XIOS/dev/branch_openmp/src/transformation/scalar_algorithm_extract_axis.hpp

    r1328 r1339  
    1212#include "scalar_algorithm_transformation.hpp" 
    1313#include "transformation.hpp" 
     14#include "reduction.hpp" 
    1415 
    1516namespace xios { 
     
    2425  Extract a scalar from an axis 
    2526*/ 
    26 class CScalarAlgorithmExtractAxis : public CScalarAlgorithmTransformation 
     27class CScalarAlgorithmExtractAxis : public CScalarAlgorithmTransformation, public CReductionAlgorithm 
    2728{ 
    2829public: 
  • XIOS/dev/branch_openmp/src/transformation/scalar_algorithm_reduce_axis.cpp

    r1334 r1339  
    1313#include "grid.hpp" 
    1414#include "grid_transformation_factory_impl.hpp" 
    15 #include "reduction.hpp" 
    1615 
    1716namespace xios { 
     
    7372  } 
    7473   
     74  if(CReductionAlgorithm::ReductionOperations_ptr == 0)  
     75  { 
     76    CReductionAlgorithm::initReductionOperation(); 
     77  } 
     78   
    7579  //if (CReductionAlgorithm::ReductionOperations.end() == CReductionAlgorithm::ReductionOperations.find(op)) 
    76   if (CReductionAlgorithm::ReductionOperations_ptr->end() == CReductionAlgorithm::ReductionOperations_ptr->find(op)) 
     80  if ((*CReductionAlgorithm::ReductionOperations_ptr).end() == (*CReductionAlgorithm::ReductionOperations_ptr).find(op)) 
    7781    ERROR("CScalarAlgorithmReduceAxis::CScalarAlgorithmReduceAxis(CAxis* axisDestination, CAxis* axisSource, CReduceAxisToScalar* algo)", 
    7882       << "Operation '" << op << "' not found. Please make sure to use a supported one" 
     
    8185 
    8286  //reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 
    83   reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations_ptr->at(op)); 
     87  reduction_ = CReductionAlgorithm::createOperation((*CReductionAlgorithm::ReductionOperations_ptr)[op]); 
    8488} 
    8589 
  • XIOS/dev/branch_openmp/src/transformation/scalar_algorithm_reduce_axis.hpp

    r1328 r1339  
    1212#include "scalar_algorithm_transformation.hpp" 
    1313#include "transformation.hpp" 
     14#include "reduction.hpp" 
    1415 
    1516namespace xios { 
     
    2425  Reducing an axis to a scalar 
    2526*/ 
    26 class CScalarAlgorithmReduceAxis : public CScalarAlgorithmTransformation 
     27class CScalarAlgorithmReduceAxis : public CScalarAlgorithmTransformation, public CReductionAlgorithm 
    2728{ 
    2829public: 
  • XIOS/dev/branch_openmp/src/transformation/scalar_algorithm_reduce_domain.cpp

    r1328 r1339  
    1414#include "grid_transformation_factory_impl.hpp" 
    1515 
    16 #include "reduction.hpp" 
    1716 
    1817namespace xios { 
     
    6968  } 
    7069   
    71   // if(CReductionAlgorithm::ReductionOperations_ptr == 0)  
    72   //   CReductionAlgorithm::initReductionOperation(); 
     70  if(CReductionAlgorithm::ReductionOperations_ptr == 0)  
     71  { 
     72    CReductionAlgorithm::initReductionOperation(); 
     73  } 
    7374 
    7475  //if (CReductionAlgorithm::ReductionOperations.end() == CReductionAlgorithm::ReductionOperations.find(op)) 
  • XIOS/dev/branch_openmp/src/transformation/scalar_algorithm_reduce_domain.hpp

    r1328 r1339  
    1212#include "scalar_algorithm_transformation.hpp" 
    1313#include "transformation.hpp" 
     14#include "reduction.hpp" 
    1415 
    1516namespace xios { 
     
    2425  Reducing an DOMAIN to a scalar 
    2526*/ 
    26 class CScalarAlgorithmReduceDomain : public CScalarAlgorithmTransformation 
     27class CScalarAlgorithmReduceDomain : public CScalarAlgorithmTransformation, public CReductionAlgorithm 
    2728{ 
    2829public: 
Note: See TracChangeset for help on using the changeset viewer.