Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Chaofan Chen
ogs
Commits
63f86177
Commit
63f86177
authored
5 months ago
by
Dmitri Naumov
Committed by
Dmitri Naumov
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
[BL/MPI] Reduce ifdef range.
parent
b2817c6b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
BaseLib/MPI.h
+9
-9
9 additions, 9 deletions
BaseLib/MPI.h
with
9 additions
and
9 deletions
BaseLib/MPI.h
+
9
−
9
View file @
63f86177
...
...
@@ -5,28 +5,28 @@
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#pragma once
#ifdef USE_PETSC
#include
<mpi.h>
#endif
namespace
BaseLib
::
MPI
{
#ifdef USE_PETSC
// Reduce operations for interprocess communications while using Petsc
static
inline
int
reduceMin
(
int
val
)
static
inline
int
reduceMin
(
int
const
val
)
{
#ifdef USE_PETSC
// Reduce operations for interprocess communications while using Petsc
int
result
;
MPI_Allreduce
(
&
val
,
&
result
,
1
,
MPI_INTEGER
,
MPI_MIN
,
PETSC_COMM_WORLD
);
return
result
;
}
#else
// Reduce operations for interprocess communications without using Petsc
static
inline
int
reduceMin
(
int
val
)
{
// Reduce operations for interprocess communications without using Petsc
return
val
;
}
#endif
}
}
// namespace BaseLib::MPI
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