Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
05322608
"README.md" did not exist on "c7604c8a7eef78957df3aff894146b768c9d64f0"
Commit
05322608
authored
2 years ago
by
Mark OLESEN
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Pstream waitRequest ignore placeholder (negative) requests
parent
4b94ac97
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H
+2
-0
2 additions, 0 deletions
src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H
src/Pstream/mpi/UPstream.C
+15
-15
15 additions, 15 deletions
src/Pstream/mpi/UPstream.C
with
17 additions
and
15 deletions
src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H
+
2
−
0
View file @
05322608
...
@@ -456,10 +456,12 @@ public:
...
@@ -456,10 +456,12 @@ public:
//- Wait until request i has finished.
//- Wait until request i has finished.
// A no-op if parRun() == false
// A no-op if parRun() == false
// or for placeholder (negative) request indices
static
void
waitRequest
(
const
label
i
);
static
void
waitRequest
(
const
label
i
);
//- Non-blocking comms: has request i finished?
//- Non-blocking comms: has request i finished?
// A no-op and returns true if parRun() == false
// A no-op and returns true if parRun() == false
// or for placeholder (negative) request indices
static
bool
finishedRequest
(
const
label
i
);
static
bool
finishedRequest
(
const
label
i
);
static
int
allocateTag
(
const
char
*
const
msg
=
nullptr
);
static
int
allocateTag
(
const
char
*
const
msg
=
nullptr
);
...
...
This diff is collapsed.
Click to expand it.
src/Pstream/mpi/UPstream.C
+
15
−
15
View file @
05322608
...
@@ -453,7 +453,7 @@ void Foam::UPstream::shutdown(int errNo)
...
@@ -453,7 +453,7 @@ void Foam::UPstream::shutdown(int errNo)
// Clean mpi communicators
// Clean mpi communicators
forAll
(
myProcNo_
,
communicator
)
forAll
(
myProcNo_
,
communicator
)
{
{
if
(
myProcNo_
[
communicator
]
!
=
-
1
)
if
(
myProcNo_
[
communicator
]
>
=
0
)
{
{
freePstreamCommunicator
(
communicator
);
freePstreamCommunicator
(
communicator
);
}
}
...
@@ -730,9 +730,9 @@ void Foam::UPstream::waitRequests(const label start)
...
@@ -730,9 +730,9 @@ void Foam::UPstream::waitRequests(const label start)
void
Foam
::
UPstream
::
waitRequest
(
const
label
i
)
void
Foam
::
UPstream
::
waitRequest
(
const
label
i
)
{
{
if
(
!
UPstream
::
parRun
())
if
(
!
UPstream
::
parRun
()
||
i
<
0
)
{
{
return
;
// No-op for non-parallel
return
;
// No-op for non-parallel
, or placeholder indices
}
}
if
(
debug
)
if
(
debug
)
...
@@ -741,13 +741,13 @@ void Foam::UPstream::waitRequest(const label i)
...
@@ -741,13 +741,13 @@ void Foam::UPstream::waitRequest(const label i)
<<
endl
;
<<
endl
;
}
}
if
(
i
<
0
||
i
>=
PstreamGlobals
::
outstandingRequests_
.
size
())
if
(
i
>=
PstreamGlobals
::
outstandingRequests_
.
size
())
{
{
FatalErrorInFunction
FatalErrorInFunction
<<
"
There are "
<<
PstreamGlobals
::
outstandingRequests_
.
size
()
<<
"
You asked for request="
<<
i
<<
"
outstanding send requests and you are asking for i="
<<
i
<<
"
from "
<<
PstreamGlobals
::
outstandingRequests_
.
size
()
<<
nl
<<
" outstanding requests!"
<<
nl
<<
"M
aybe you are mixing
blocking/non-blocking comms?"
<<
"M
ixing use of
blocking/non-blocking comms?"
<<
Foam
::
abort
(
FatalError
);
<<
Foam
::
abort
(
FatalError
);
}
}
...
@@ -781,9 +781,9 @@ void Foam::UPstream::waitRequest(const label i)
...
@@ -781,9 +781,9 @@ void Foam::UPstream::waitRequest(const label i)
bool
Foam
::
UPstream
::
finishedRequest
(
const
label
i
)
bool
Foam
::
UPstream
::
finishedRequest
(
const
label
i
)
{
{
if
(
!
UPstream
::
parRun
())
if
(
!
UPstream
::
parRun
()
||
i
<
0
)
{
{
return
true
;
// No-op for non-parallel
return
true
;
// No-op for non-parallel
, or placeholder indices
}
}
if
(
debug
)
if
(
debug
)
...
@@ -792,13 +792,13 @@ bool Foam::UPstream::finishedRequest(const label i)
...
@@ -792,13 +792,13 @@ bool Foam::UPstream::finishedRequest(const label i)
<<
endl
;
<<
endl
;
}
}
if
(
i
<
0
||
i
>=
PstreamGlobals
::
outstandingRequests_
.
size
())
if
(
i
>=
PstreamGlobals
::
outstandingRequests_
.
size
())
{
{
FatalErrorInFunction
FatalErrorInFunction
<<
"
There are "
<<
PstreamGlobals
::
outstandingRequests_
.
size
()
<<
"
You asked for request="
<<
i
<<
"
outstanding send requests and you are asking for i="
<<
i
<<
"
from "
<<
PstreamGlobals
::
outstandingRequests_
.
size
()
<<
nl
<<
" outstanding requests!"
<<
nl
<<
"M
aybe you are mixing
blocking/non-blocking comms?"
<<
"M
ixing use of
blocking/non-blocking comms?"
<<
Foam
::
abort
(
FatalError
);
<<
Foam
::
abort
(
FatalError
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment