Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
14e5e305
Commit
14e5e305
authored
Jun 17, 2020
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Use static_assert indepedently of MPI presence
parent
ec4cd3ba
No related branches found
No related tags found
1 merge request
!37
Feature/language
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/utils/Messenger.hpp
+5
-3
5 additions, 3 deletions
src/utils/Messenger.hpp
with
5 additions
and
3 deletions
src/utils/Messenger.hpp
+
5
−
3
View file @
14e5e305
...
...
@@ -298,10 +298,10 @@ class Messenger
DataType
allReduceMin
(
const
DataType
&
data
)
const
{
#ifdef PUGS_HAS_MPI
static_assert
(
not
std
::
is_const_v
<
DataType
>
);
static_assert
(
std
::
is_arithmetic_v
<
DataType
>
);
#ifdef PUGS_HAS_MPI
MPI_Datatype
mpi_datatype
=
Messenger
::
helper
::
mpiType
<
DataType
>
();
DataType
min_data
=
data
;
...
...
@@ -317,10 +317,10 @@ class Messenger
DataType
allReduceMax
(
const
DataType
&
data
)
const
{
#ifdef PUGS_HAS_MPI
static_assert
(
not
std
::
is_const_v
<
DataType
>
);
static_assert
(
std
::
is_arithmetic_v
<
DataType
>
);
#ifdef PUGS_HAS_MPI
MPI_Datatype
mpi_datatype
=
Messenger
::
helper
::
mpiType
<
DataType
>
();
DataType
max_data
=
data
;
...
...
@@ -336,8 +336,10 @@ class Messenger
DataType
allReduceSum
(
const
DataType
&
data
)
const
{
#ifdef PUGS_HAS_MPI
static_assert
(
not
std
::
is_const_v
<
DataType
>
);
static_assert
(
std
::
is_arithmetic_v
<
DataType
>
);
#ifdef PUGS_HAS_MPI
if
constexpr
(
std
::
is_arithmetic_v
<
DataType
>
)
{
MPI_Datatype
mpi_datatype
=
Messenger
::
helper
::
mpiType
<
DataType
>
();
...
...
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