Ignore:
Timestamp:
07/12/21 20:02:30 (3 years ago)
Author:
ymipsl
Message:

Improve performance of CGridRemoteConnector when grid source and/or destination are non distributed.

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/grid_remote_connector.hpp

    r1999 r2179  
    2020      CGridRemoteConnector(vector<CLocalView*>& srcView, vector<CDistributedView*>& dstView, MPI_Comm localComm, int remoteSize) ; 
    2121      CGridRemoteConnector(vector<CLocalView*>& srcView, vector<CLocalView*>& dstView, MPI_Comm localComm, int remoteSize) ; 
     22      void computeViewDistribution(void) ; 
    2223      void computeConnector(void) ; 
    23       void computeGenericMethod(void) ; 
     24      void computeGenericMethod(vector<CLocalView*>& srcView, vector<CDistributedView*>& dstView, vector<int>& indElements) ; 
     25      void computeSrcDstNonDistributed(int i, map<int,bool>& ranks) ; 
     26      void computeDstNonDistributed(int i, map<int,bool>& ranks) ; 
     27      void computeSrcNonDistributed(int i) ; 
     28      void removeRedondantRanks(void) ; 
    2429      std::map<int, CArray<size_t,1>>& getDistributedGlobalIndex(int pos) { return elements_[pos] ;}  
    2530 
    2631    private: 
     32   
     33    /**  
     34     * Source views composing the source grid. The vector store an internal copy of pointer elements composing the grid.  
     35     * It is feed at construction time 
     36     */ 
     37      vector<CLocalView*> srcView_ ; 
     38 
     39    /**  
     40     * Destination views composing the source grid. The vector store an internal copy of pointer elements composing the grid 
     41     * It is feed at construction time 
     42     */ 
     43      vector<CDistributedView*> dstView_ ; 
     44 
     45    /**   
     46     * The list of global indices to send to each rank of the remote view (servers). The vector store the information for each element, and the map  
     47     * specify a list of global indices to send to each rank of the remote view. 
     48     * size of element_[] -> number of elements composing the grids (source/destination) 
     49     * element[i][rank] == CArray<size_t,1> -> list of global indices  to send to the remote process of rank \b rank for the view \b i 
     50     * The is computed when calling computeConnector internal methods 
     51     * map can be returned trough the public accessor : getDistributedGlobalIndex(int) 
     52     */ 
    2753      vector<map<int, CArray<size_t,1>>> elements_ ; 
    28       vector<CLocalView*> srcView_ ; 
    29       vector<CDistributedView*> dstView_ ; 
     54     
     55      /** 
     56      /* internal copy of the local communicator (client workflow). Feed at construction time. 
     57       */ 
    3058      MPI_Comm localComm_ ; 
     59 
     60      /** 
     61      /* size of the remote communicator (== nb of servers). Feed at consctruction time 
     62       */ 
    3163      int remoteSize_ ; 
    3264 
     65      /** 
     66      /* for each view composing the source grid, the vector store the information about the distribution of the element, i.e.  
     67       * if each ranks of the local view has exactly the same global indices than each other. This is computed when calling   
     68       * \b computeViewDistribution method.   
     69       */ 
     70      vector<bool> isSrcViewDistributed_ ; 
     71 
     72     /** 
     73      /* for each view composing the destination grid, the vector store the information about the distribution of the element, i.e.  
     74       * if each ranks of the remote view has exactly the same global indices than each other. This is computed when calling   
     75       * \b computeViewDistribution method.  
     76       */ 
     77      vector<bool> isDstViewDistributed_ ; 
     78       
     79     
    3380  } ; 
    3481 
Note: See TracChangeset for help on using the changeset viewer.