Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
08efeb1a
Commit
08efeb1a
authored
Dec 04, 2020
by
Mark Olesen
Browse files
ENH: define UPstream rangeType
- UPstream::rangeType as typedef for IntRange<int> for better use semantics
parent
e697ac27
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H
View file @
08efeb1a
...
...
@@ -63,6 +63,9 @@ class UPstream
{
public:
//- Int ranges are used for MPI ranks (processes)
typedef
IntRange
<
int
>
rangeType
;
//- Types of communications
enum
class
commsTypes
{
...
...
@@ -259,7 +262,7 @@ public:
ClassName
(
"UPstream"
);
// Static
d
ata
// Static
D
ata
//- Should compact transfer be used in which floats replace doubles
//- reducing the bandwidth requirement at the expense of some loss
...
...
@@ -421,7 +424,7 @@ public:
return
old
;
}
//-
Is
this a parallel run
?
//-
Test if
this a parallel run
, or allow modify access
static
bool
&
parRun
()
{
return
parRun_
;
...
...
@@ -439,7 +442,7 @@ public:
return
procIDs_
[
communicator
].
size
();
}
//- Process index of the master
//- Process index of the master
(always 0)
static
constexpr
int
masterNo
()
noexcept
{
return
0
;
...
...
@@ -469,17 +472,17 @@ public:
}
//- Range of process indices for all processes
static
IntRange
<
int
>
allProcs
(
const
label
communicator
=
0
)
static
rangeType
allProcs
(
const
label
communicator
=
0
)
{
// Proc 0 -> nProcs
return
IntRange
<
int
>
(
static_cast
<
int
>
(
nProcs
(
communicator
)));
// Proc 0 -> nProcs
(int value)
return
rangeType
(
static_cast
<
int
>
(
nProcs
(
communicator
)));
}
//- Range of process indices for sub-processes
static
IntRange
<
int
>
subProcs
(
const
label
communicator
=
0
)
static
rangeType
subProcs
(
const
label
communicator
=
0
)
{
// Proc 1 -> nProcs
return
IntRange
<
int
>
(
1
,
static_cast
<
int
>
(
nProcs
(
communicator
)
-
1
));
// Proc 1 -> nProcs
(int value)
return
rangeType
(
1
,
static_cast
<
int
>
(
nProcs
(
communicator
)
-
1
));
}
//- Communication schedule for linear all-to-master (proc 0)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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