Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
45fdd0e5
Commit
45fdd0e5
authored
Mar 01, 2010
by
mattijs
Browse files
ENH: use non-blocking comms
parent
27634a04
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/algorithms/MeshWave/FaceCellWave.C
View file @
45fdd0e5
...
...
@@ -466,40 +466,6 @@ void Foam::FaceCellWave<Type>::transform
}
// Send face info to neighbour.
template
<
class
Type
>
void
Foam
::
FaceCellWave
<
Type
>::
sendPatchInfo
(
const
label
neighbour
,
const
label
nFaces
,
const
labelList
&
faceLabels
,
const
List
<
Type
>&
faceInfo
)
const
{
OPstream
toNeighbour
(
Pstream
::
blocking
,
neighbour
);
writeFaces
(
nFaces
,
faceLabels
,
faceInfo
,
toNeighbour
);
}
// Receive face info from neighbour
template
<
class
Type
>
Foam
::
label
Foam
::
FaceCellWave
<
Type
>::
receivePatchInfo
(
const
label
neighbour
,
labelList
&
faceLabels
,
List
<
Type
>&
faceInfo
)
const
{
IPstream
fromNeighbour
(
Pstream
::
blocking
,
neighbour
);
label
nFaces
=
0
;
readFaces
(
nFaces
,
faceLabels
,
faceInfo
,
fromNeighbour
);
return
nFaces
;
}
// Offset mesh face. Used for transferring from one cyclic half to the other.
template
<
class
Type
>
void
Foam
::
FaceCellWave
<
Type
>::
offset
...
...
@@ -523,6 +489,8 @@ void Foam::FaceCellWave<Type>::handleProcPatches()
{
// Send all
PstreamBuffers
pBufs
(
Pstream
::
nonBlocking
);
forAll
(
mesh_
.
boundaryMesh
(),
patchI
)
{
const
polyPatch
&
patch
=
mesh_
.
boundaryMesh
()[
patchI
];
...
...
@@ -564,16 +532,13 @@ void Foam::FaceCellWave<Type>::handleProcPatches()
<<
endl
;
}
sendPatchInfo
(
procPatch
.
neighbProcNo
(),
nSendFaces
,
sendFaces
,
sendFacesInfo
);
UOPstream
toNeighbour
(
procPatch
.
neighbProcNo
(),
pBufs
);
writeFaces
(
nSendFaces
,
sendFaces
,
sendFacesInfo
,
toNeighbour
);
}
}
pBufs
.
finishedSends
();
// Receive all
forAll
(
mesh_
.
boundaryMesh
(),
patchI
)
...
...
@@ -586,16 +551,20 @@ void Foam::FaceCellWave<Type>::handleProcPatches()
refCast
<
const
processorPolyPatch
>
(
patch
);
// Allocate buffers
label
nReceiveFaces
;
label
nReceiveFaces
=
0
;
labelList
receiveFaces
(
patch
.
size
());
List
<
Type
>
receiveFacesInfo
(
patch
.
size
());
nReceiveFaces
=
receivePatchInfo
(
procPatch
.
neighbProcNo
(),
receiveFaces
,
receiveFacesInfo
);
{
UIPstream
fromNeighbour
(
procPatch
.
neighbProcNo
(),
pBufs
);
readFaces
(
nReceiveFaces
,
receiveFaces
,
receiveFacesInfo
,
fromNeighbour
);
}
if
(
debug
)
{
...
...
src/OpenFOAM/algorithms/MeshWave/FaceCellWave.H
View file @
45fdd0e5
...
...
@@ -225,23 +225,6 @@ class FaceCellWave
List
<
Type
>&
faceInfo
)
const
;
//- Send info to neighbour
void
sendPatchInfo
(
const
label
neighbour
,
const
label
nFaces
,
const
labelList
&
,
const
List
<
Type
>&
)
const
;
//- Receive info from neighbour. Returns number of faces received.
label
receivePatchInfo
(
const
label
neighbour
,
labelList
&
,
List
<
Type
>&
)
const
;
//- Offset face labels by constant value
static
void
offset
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment