changing blocking-recive to non-blocking (in boundaryProcessor) to improve MPI run
This commit is contained in:
parent
a0c51e94e1
commit
5a25556b8a
|
@ -106,7 +106,7 @@ bool pFlow::MPI::processorBoundarySphereInteraction<cFM, gMM>::sphereSphereInter
|
|||
return true;
|
||||
}
|
||||
|
||||
if(iter % 1000 == 0u)
|
||||
if(iter % 100 == 0u)
|
||||
{
|
||||
pOutput<<"inter "<< inter_.totalTime()<<endl;
|
||||
pOutput<<"send "<< send_.totalTime()<<endl<<endl;;
|
||||
|
@ -144,7 +144,7 @@ bool pFlow::MPI::processorBoundarySphereInteraction<cFM, gMM>::sphereSphereInter
|
|||
return true;
|
||||
}
|
||||
|
||||
if(iter % 1000 == 0u)
|
||||
if(iter % 100 == 0u)
|
||||
{
|
||||
pOutput<<"recive "<< recv_.totalTime()<<endl;
|
||||
pOutput<<"add "<< add_.totalTime()<<endl<<endl;
|
||||
|
|
|
@ -65,12 +65,18 @@ pFlow::MPI::boundaryProcessor::boundaryProcessor(
|
|||
}
|
||||
|
||||
bool
|
||||
pFlow::MPI::boundaryProcessor::beforeIteration(uint32 iterNum, real t, real dt)
|
||||
pFlow::MPI::boundaryProcessor::beforeIteration(
|
||||
uint32 step,
|
||||
uint32 iterNum,
|
||||
real t,
|
||||
real dt)
|
||||
{
|
||||
|
||||
if(step == 1 )
|
||||
{
|
||||
thisNumPoints_ = size();
|
||||
|
||||
auto req = MPI_REQUEST_NULL;
|
||||
uint32 oldNeighborProcNumPoints = neighborProcNumPoints_;
|
||||
|
||||
MPI_Isend(
|
||||
&thisNumPoints_,
|
||||
1,
|
||||
|
@ -78,18 +84,29 @@ pFlow::MPI::boundaryProcessor::beforeIteration(uint32 iterNum, real t, real dt)
|
|||
neighborProcessorNo(),
|
||||
thisBoundaryIndex(),
|
||||
pFlowProcessors().localCommunicator(),
|
||||
&req);
|
||||
&numPointsRequest0_);
|
||||
|
||||
MPI_Recv(
|
||||
MPI_Irecv(
|
||||
&neighborProcNumPoints_,
|
||||
1,
|
||||
MPI_UNSIGNED,
|
||||
neighborProcessorNo(),
|
||||
mirrorBoundaryIndex(),
|
||||
pFlowProcessors().localCommunicator(),
|
||||
MPI_STATUS_IGNORE
|
||||
&numPointsRequest_
|
||||
);
|
||||
MPI_Request_free(&req);
|
||||
|
||||
}
|
||||
else if(step == 2 )
|
||||
{
|
||||
if(numPointsRequest_ != RequestNull)
|
||||
{
|
||||
MPI_Wait(&numPointsRequest_, MPI_STATUS_IGNORE);
|
||||
if(numPointsRequest0_!= RequestNull)
|
||||
{
|
||||
MPI_Request_free(&numPointsRequest0_);
|
||||
}
|
||||
}
|
||||
|
||||
anyList varList;
|
||||
message msg;
|
||||
|
@ -101,6 +118,7 @@ pFlow::MPI::boundaryProcessor::beforeIteration(uint32 iterNum, real t, real dt)
|
|||
fatalErrorInFunction;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -42,6 +42,10 @@ namespace pFlow::MPI
|
|||
|
||||
uint32 thisNumPoints_ = 0;
|
||||
|
||||
Request numPointsRequest_ = RequestNull;
|
||||
|
||||
Request numPointsRequest0_ = RequestNull;
|
||||
|
||||
realx3Vector_D neighborProcPoints_;
|
||||
|
||||
dataSender<realx3> sender_;
|
||||
|
@ -87,7 +91,7 @@ namespace pFlow::MPI
|
|||
boundaryProcessor,
|
||||
dictionary);
|
||||
|
||||
bool beforeIteration(uint32 iterNum, real t, real dt) override;
|
||||
bool beforeIteration(uint32 step, uint32 iterNum, real t, real dt) override;
|
||||
|
||||
bool iterate(uint32 iterNum, real t, real dt) override;
|
||||
|
||||
|
|
Loading…
Reference in New Issue