|
VirtualFluids 0.2.0
Parallel CFD LBM Solver
|
class that is used to rearrange the arrays of node indices for communication between gpus. The rearrangement is needed for communication hiding with cuda streams More...
#include <IndexRearrangementForStreams.h>
Public Member Functions | |
| IndexRearrangementForStreams (std::shared_ptr< Parameter > para, std::shared_ptr< GridBuilder > builder, vf::parallel::Communicator &communicator) | |
| virtual | ~IndexRearrangementForStreams ()=default |
| virtual std::array< ProcessNeighbor27, 4 > | initCommunicationArraysForCommAfterFinetoCoarse (const ProcessNeighbor27 &sendNeighborHost, const ProcessNeighbor27 &sendNeighborDevice, const ProcessNeighbor27 &recvNeighborHost, const ProcessNeighbor27 &recvNeighborDevice, int level, int direction) const |
| Initialize the arrays for the communication after the interpolation from fine to coarse. | |
Protected Member Functions | |
| std::vector< uint > | exchangeIndicesForCommAfterFtoC (const ProcessNeighbor27 &sendNeighbor, const ProcessNeighbor27 &recvNeighbor, const std::vector< uint > &sendIndicesForCommAfterFtoCPositions) const |
| send sendIndicesForCommAfterFtoCPositions to receiving process and receive recvIndicesForCommAfterFtoCPositions from neighboring process | |
| std::vector< uint > | reorderSendIndicesForCommAfterFtoC (uint *indices, int direction, int level) const |
| The send indices are reordered for the communication after the interpolation from fine to coarse. | |
| std::vector< uint > | aggregateCoarseNodesForCtoF (int level) const |
| Aggregate all nodes in the coarse cells for the interpolation in coarse to fine. | |
| void | reorderRecvIndicesForCommAfterFtoC (uint *recvIndices, int direction, int level, const std::vector< uint > &recvIndicesForCommAfterFtoCPositions) const |
| Reorder the receive indices in the same way that the send indices were reordered. | |
Static Protected Member Functions | |
| static ProcessNeighbor27 | makeProcessNeighborToCommAfterFtoC (const ProcessNeighbor27 &neighbor, uint numberOfNodes) |
| Initializes pointers for reduced communication after the interpolation from fine to coarse by copying them from "normal" communication. | |
| static std::vector< uint > | findIndicesNotInCommAfterFtoC (uint numberOfIndices, const uint *indices, const std::vector< uint > &indicesAfterFtoC) |
| Find all indices which are not part of the communication after the interpolation from fine to coarse. | |
Friends | |
| class | IndexRearrangementForStreamsTest_reorderSendIndices |
| class | IndexRearrangementForStreamsTest_reorderRecvIndices |
| class | IndexRearrangementForStreamsTest_exchangeIndicesForCommAfterFtoC |
class that is used to rearrange the arrays of node indices for communication between gpus. The rearrangement is needed for communication hiding with cuda streams
This class changes the order of the node indices that are needed for communication between gpus. The indices are reordered so that they can be split into two groups: nodes that are part if the interpolation between grid levels, and nodes that are not. These groups are needed for communication hiding. For details see [master thesis of Anna Wellmann]
Definition at line 60 of file IndexRearrangementForStreams.h.
| vf::gpu::IndexRearrangementForStreams::IndexRearrangementForStreams | ( | std::shared_ptr< Parameter > | para, |
| std::shared_ptr< GridBuilder > | builder, | ||
| vf::parallel::Communicator & | communicator | ||
| ) |
Definition at line 62 of file IndexRearrangementForStreams.cpp.
|
virtualdefault |
|
protected |
Aggregate all nodes in the coarse cells for the interpolation in coarse to fine.
For the coarse cells in the interpolation from coarse to fine only one node is stored. This methods looks for the other nodes of each cell and puts them into vector. Duplicate nodes are only stored once.
Definition at line 211 of file IndexRearrangementForStreams.cpp.
|
protected |
send sendIndicesForCommAfterFtoCPositions to receiving process and receive recvIndicesForCommAfterFtoCPositions from neighboring process
Definition at line 141 of file IndexRearrangementForStreams.cpp.
|
staticprotected |
Find all indices which are not part of the communication after the interpolation from fine to coarse.
Definition at line 237 of file IndexRearrangementForStreams.cpp.
|
virtual |
Initialize the arrays for the communication after the interpolation from fine to coarse.
Only the nodes involved in the interpolation need to be exchanged. Therefore in this method all nodes, which are part of the interpolation as well as the communication, are identified. See [master thesis of Anna Wellmann (p. 59-62: "Reduzieren der auszutauschenden Knoten")]
Reimplemented in vf::gpu::grid_generator_test::IndexRearrangementForStreamsDouble.
Definition at line 70 of file IndexRearrangementForStreams.cpp.
|
staticprotected |
Initializes pointers for reduced communication after the interpolation from fine to coarse by copying them from "normal" communication.
Definition at line 200 of file IndexRearrangementForStreams.cpp.
|
protected |
Reorder the receive indices in the same way that the send indices were reordered.
When the send indices are reordered, the receive indices need to be reordered accordingly.
| recvIndices | is the pointer to the vector with the receive indices, which will be reordered in this function |
| recvIndicesForCommAfterFtoCPositions | stores the positions of the neighbors send indices before reordering and is used to reorder the receive indices in the same way |
Definition at line 166 of file IndexRearrangementForStreams.cpp.
|
protected |
The send indices are reordered for the communication after the interpolation from fine to coarse.
The indices of nodes which are part of the interpolation are moved to the front of vector with the send indices.
Definition at line 95 of file IndexRearrangementForStreams.cpp.
Definition at line 128 of file IndexRearrangementForStreams.h.
Definition at line 127 of file IndexRearrangementForStreams.h.
Definition at line 126 of file IndexRearrangementForStreams.h.