Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ADIOS2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
Podhorszki, Norbert
ADIOS2
Commits
9efcd34e
Commit
9efcd34e
authored
7 years ago
by
William F Godoy
Browse files
Options
Downloads
Patches
Plain Diff
Removing const in MPI functions first argument. Fix for Issue
#309
parent
5a8d1544
No related branches found
No related tags found
1 merge request
!310
Removing const in MPI functions first argument. Fix for Issue #309
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/adios2/helper/adiosMPIFunctions.tcc
+19
-16
19 additions, 16 deletions
source/adios2/helper/adiosMPIFunctions.tcc
with
19 additions
and
16 deletions
source/adios2/helper/adiosMPIFunctions.tcc
+
19
−
16
View file @
9efcd34e
...
...
@@ -15,7 +15,6 @@
#include "adiosMPIFunctions.h"
#include <algorithm> //std::foreach
#include <iostream> //TODO: remove
#include <numeric> //std::accumulate
#include "adios2/ADIOSMPI.h"
...
...
@@ -73,7 +72,7 @@ template <>
unsigned int ReduceValues(const unsigned int source, MPI_Comm mpiComm,
MPI_Op operation, const int rankDestination)
{
const
unsigned int sourceLocal = source;
unsigned int sourceLocal = source;
unsigned int reduceValue = 0;
MPI_Reduce(&sourceLocal, &reduceValue, 1, MPI_UNSIGNED, operation,
rankDestination, mpiComm);
...
...
@@ -84,7 +83,7 @@ template <>
unsigned long int ReduceValues(const unsigned long int source, MPI_Comm mpiComm,
MPI_Op operation, const int rankDestination)
{
const
unsigned long int sourceLocal = source;
unsigned long int sourceLocal = source;
unsigned long int reduceValue = 0;
MPI_Reduce(&sourceLocal, &reduceValue, 1, MPI_UNSIGNED_LONG, operation,
rankDestination, mpiComm);
...
...
@@ -96,7 +95,7 @@ unsigned long long int ReduceValues(const unsigned long long int source,
MPI_Comm mpiComm, MPI_Op operation,
const int rankDestination)
{
const
unsigned long long int sourceLocal = source;
unsigned long long int sourceLocal = source;
unsigned long long int reduceValue = 0;
MPI_Reduce(&sourceLocal, &reduceValue, 1, MPI_UNSIGNED_LONG_LONG, operation,
rankDestination, mpiComm);
...
...
@@ -136,9 +135,10 @@ void GatherArrays(const char *source, const size_t sourceCount,
char *destination, MPI_Comm mpiComm,
const int rankDestination)
{
const int countsInt = static_cast<int>(sourceCount);
int result = MPI_Gather(source, countsInt, MPI_CHAR, destination, countsInt,
MPI_CHAR, rankDestination, mpiComm);
int countsInt = static_cast<int>(sourceCount);
int result =
MPI_Gather(const_cast<char *>(source), countsInt, MPI_CHAR, destination,
countsInt, MPI_CHAR, rankDestination, mpiComm);
if (result != MPI_SUCCESS)
{
...
...
@@ -152,10 +152,10 @@ void GatherArrays(const size_t *source, const size_t sourceCount,
size_t *destination, MPI_Comm mpiComm,
const int rankDestination)
{
const
int countsInt = static_cast<int>(sourceCount);
int result =
MPI_Gather(source, countsInt,
ADIOS2_MPI_SIZE_T, destination, countsInt,
ADIOS2_MPI_SIZE_T, rankDestination, mpiComm);
int countsInt = static_cast<int>(sourceCount);
int result =
MPI_Gather(const_cast<size_t *>(source), countsInt,
ADIOS2_MPI_SIZE_T, destination, countsInt,
ADIOS2_MPI_SIZE_T, rankDestination, mpiComm);
if (result != MPI_SUCCESS)
{
...
...
@@ -183,7 +183,8 @@ void GathervArrays(const char *source, const size_t sourceCount,
displacementsInt = GetGathervDisplacements(counts, countsSize);
}
result = MPI_Gatherv(source, static_cast<int>(sourceCount), MPI_CHAR,
int sourceCountInt = static_cast<int>(sourceCount);
result = MPI_Gatherv(const_cast<char *>(source), sourceCountInt, MPI_CHAR,
destination, countsInt.data(), displacementsInt.data(),
MPI_CHAR, rankDestination, mpiComm);
...
...
@@ -210,10 +211,12 @@ void GathervArrays(const size_t *source, const size_t sourceCount,
std::vector<int> displacementsInt =
GetGathervDisplacements(counts, countsSize);
result =
MPI_Gatherv(source, static_cast<int>(sourceCount), ADIOS2_MPI_SIZE_T,
destination, countsInt.data(), displacementsInt.data(),
ADIOS2_MPI_SIZE_T, rankDestination, mpiComm);
int sourceCountInt = static_cast<int>(sourceCount);
result = MPI_Gatherv(const_cast<size_t *>(source), sourceCountInt,
ADIOS2_MPI_SIZE_T, destination, countsInt.data(),
displacementsInt.data(), ADIOS2_MPI_SIZE_T,
rankDestination, mpiComm);
if (result != MPI_SUCCESS)
{
...
...
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