Bugfix: IPstream and OPstream on local comm

This commit is contained in:
Hrvoje Jasak 2016-09-23 18:42:20 +01:00
parent 74933ca82b
commit 0c1fa2853e

View file

@ -246,7 +246,10 @@ Foam::ggiAMGInterface::ggiAMGInterface
// each processor only to perform the analysis on locally created coarse // each processor only to perform the analysis on locally created coarse
// faces // faces
// HJ, 13/Jun/2016 // HJ, 13/Jun/2016
Info<< "Start ggiAMGInterface constructor " << lTime_.elapsedCpuTime() << endl; Info<< "Start ggiAMGInterface constructor for size "
<< fineGgiInterface_.interfaceSize() << ": "
<< lTime_.elapsedCpuTime() << endl;
// Note: local addressing contains only local faces // Note: local addressing contains only local faces
const labelList& fineZa = fineGgiInterface_.zoneAddressing(); const labelList& fineZa = fineGgiInterface_.zoneAddressing();
@ -266,7 +269,7 @@ Foam::ggiAMGInterface::ggiAMGInterface
neighbourExpandAddressing neighbourExpandAddressing
); );
} }
Info<< "ggiAMGInterface expandToAddr1 " << lTime_.elapsedCpuTime() << endl;
// Create addressing for neighbour processors. Note: expandAddrToZone will // Create addressing for neighbour processors. Note: expandAddrToZone will
// expand the addressing to zone size. HJ, 13/Jun/2016 // expand the addressing to zone size. HJ, 13/Jun/2016
labelField neighbourExpandProc labelField neighbourExpandProc
@ -285,7 +288,7 @@ Foam::ggiAMGInterface::ggiAMGInterface
neighbourExpandProc neighbourExpandProc
); );
} }
Info<< "ggiAMGInterface expandToAddr2 " << lTime_.elapsedCpuTime() << endl;
// Note: neighbourExpandAddressing and neighbourExpandProc // Note: neighbourExpandAddressing and neighbourExpandProc
// will be filled with NaNs for faces which are not local // will be filled with NaNs for faces which are not local
@ -711,7 +714,7 @@ Foam::ggiAMGInterface::ggiAMGInterface
fineAddressing_.setSize(nAgglomPairs, -1); fineAddressing_.setSize(nAgglomPairs, -1);
restrictAddressing_.setSize(nAgglomPairs, -1); restrictAddressing_.setSize(nAgglomPairs, -1);
restrictWeights_.setSize(nAgglomPairs); restrictWeights_.setSize(nAgglomPairs);
Info<< "ggiAMGInterface end Addr " << lTime_.elapsedCpuTime() << endl;
// In order to assemble the coarse global face zone, find out // In order to assemble the coarse global face zone, find out
// how many faces have been created on each processor. // how many faces have been created on each processor.
// Note that masters and slaves both count faces so we will // Note that masters and slaves both count faces so we will
@ -726,7 +729,7 @@ Foam::ggiAMGInterface::ggiAMGInterface
// This needs to be handled separately in the initFastReduce // This needs to be handled separately in the initFastReduce
// HJ, 20/Sep/2016 // HJ, 20/Sep/2016
reduce(nCoarseFacesPerProc, sumOp<labelList>(), tag(), comm()); reduce(nCoarseFacesPerProc, sumOp<labelList>(), tag(), comm());
Info<< "ggiAMGInterface end reduce 1 " << lTime_.elapsedCpuTime() << endl;
// Coarse global face zone is assembled by adding all faces from proc0, // Coarse global face zone is assembled by adding all faces from proc0,
// followed by all faces from proc1 etc. // followed by all faces from proc1 etc.
// Therefore, on procN, my master offset // Therefore, on procN, my master offset
@ -904,12 +907,26 @@ Foam::ggiAMGInterface::ggiAMGInterface
if (Pstream::myProcNo() == sendProc) if (Pstream::myProcNo() == sendProc)
{ {
OPstream toNbr(Pstream::scheduled, recvProc); OPstream toNbr
(
Pstream::scheduled,
recvProc,
0,
tag(),
comm()
);
toNbr << labelList(procMasterFacesLL[recvProc]); toNbr << labelList(procMasterFacesLL[recvProc]);
} }
else if (Pstream::myProcNo() == recvProc) else if (Pstream::myProcNo() == recvProc)
{ {
IPstream fromNbr(Pstream::scheduled, sendProc); IPstream fromNbr
(
Pstream::scheduled,
sendProc,
0,
tag(),
comm()
);
procMasterFaces_[sendProc] = labelList(fromNbr); procMasterFaces_[sendProc] = labelList(fromNbr);
} }
@ -1047,6 +1064,7 @@ Foam::ggiAMGInterface::ggiAMGInterface
} }
Info<< "ggiAMGInterface end agglom slave " << lTime_.elapsedCpuTime() << endl; Info<< "ggiAMGInterface end agglom slave " << lTime_.elapsedCpuTime() << endl;
} }
Info<< "End ggiAMGInterface constructor " << lTime_.elapsedCpuTime() << endl;
} }