- Timestamp:
- 01/12/21 23:05:02 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/gatherer_connector.hpp
r1995 r2011 110 110 } 111 111 112 // hook for transfering mask in grid connector, maybe find an other way to doing that... 113 void transfer_or(int rank, CGathererConnector** connectors, int nConnectors, const bool* input, bool* output) 114 { 115 auto& connector = connector_[rank] ; // probably costly, find a better way to avoid the map 116 auto& mask = mask_[rank] ; 117 int srcSize = mask.size() ; 118 119 if (nConnectors==0) 120 { 121 for(int i=0, j=0; i<srcSize; i++) 122 if (mask[i]) 123 { 124 *(output+connector[j]) |= *(input + i) ; 125 j++ ; 126 } 127 128 } 129 else 130 { 131 int srcSliceSize = (*(connectors-1))->getSrcSliceSize(rank, connectors-1, nConnectors-1) ; 132 int dstSliceSize = (*(connectors-1))->getDstSliceSize(connectors-1, nConnectors-1) ; 133 134 const bool* in = input ; 135 for(int i=0,j=0;i<srcSize;i++) 136 { 137 if (mask[i]) 138 { 139 (*(connectors-1))->transfer_or(rank, connectors-1, nConnectors-1, in, output+connector[j]*dstSliceSize) ; // the multiplication must be avoid in further optimization 140 j++ ; 141 } 142 in += srcSliceSize ; 143 } 144 } 145 146 } 147 148 112 149 113 150 template<typename T>
Note: See TracChangeset
for help on using the changeset viewer.