Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
S src
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 62
    • Issues 62
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Code Review
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OPAL
  • src
  • Issues
  • #485

Closed
Open
Created Mar 17, 2020 by snuverink_j@snuverink_jDeveloper

clang compiler errors for MPI_AllReduce (-Wtype-safety)

Summary

Clang compiler errors with MPI_AllReduce (-Wtype-safety)

Steps to reproduce

-- The C compiler identification is Clang 9.0.1
-- The CXX compiler identification is Clang 9.0.1
-- Check for working C compiler: /opt/local/bin/mpicc-mpich-clang90

Relevant logs and/or screenshots

src/Algorithms/ParallelSliceTracker.cpp:291:41: error: argument type
      'bool *' doesn't match specified 'MPI' type tag that requires 'int *' [-Werror,-Wtype-safety]
            MPI_Allreduce(MPI_IN_PLACE, &globalEOL_m, 1, MPI_INT, MPI_LAND, Ippl::getComm());
                                        ^~~~~~~~~~~~     ~~~~~~~
src/Algorithms/bet/EnvelopeBunch.cpp:1458:33: error: argument type
      'size_t *' (aka 'unsigned long *') doesn't match specified 'MPI' type tag that requires 'long *'
      [-Werror,-Wtype-safety]
    MPI_Allreduce(MPI_IN_PLACE, &count, 1, MPI_LONG, MPI_SUM, Ippl::getComm());
                                ^~~~~~     ~~~~~~~~
  1. some more similar to 2.

Possible fixes

https://gitlab.psi.ch/OPAL/src/blob/4868efe8cf31c3646c49387a293852acf215c2bb/src/Algorithms/ParallelSliceTracker.cpp#L291

MPI_Allreduce(MPI_IN_PLACE, &globalEOL_m, 1, MPI_INT, MPI_LAND, Ippl::getComm());

globalEOL_m is a boolean and this doesn't combine properly with MPI_INT.

Instead, the commented out line above:

reduce(&globalEOL_m, &globalEOL_m + 1, &globalEOL_m, OpBitwiseAndAssign());

compiles fine.

@kraus: there is a similar line in ParallelTTracker.cpp. Is that line correct in this case as well?

https://gitlab.psi.ch/OPAL/src/blob/4868efe8cf31c3646c49387a293852acf215c2bb/src/Algorithms/bet/EnvelopeBunch.cpp#L1458

MPI_Allreduce(MPI_IN_PLACE, &count, 1, MPI_LONG, MPI_SUM, Ippl::getComm());

should rather be:

MPI_Allreduce(MPI_IN_PLACE, &count, 1, MPI_UNSIGNED_LONG, MPI_SUM, Ippl::getComm());
Edited Mar 17, 2020 by snuverink_j
Assignee
Assign to
OPAL 2.4.0
Milestone
OPAL 2.4.0 (Past due)
Assign milestone
Time tracking