Unused variables when compiling boost mpi code

Open
#1,133 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
cpp

Research direction

Start with the warning locations in boost/mpi/detail/request_handlers.hpp, boost/mpi/communicator.hpp, and boost/mpi/collectives/broadcast.hpp, reduce.hpp, and scan.hpp. Reproduce the MPI compilation with unused-parameter warnings enabled, inspect each reported parameter, and verify that the relevant warnings no longer appear without changing behavior.

Written by the indexing model from the issue text.

Description

When compiling I encounter the following

/opt/homebrew/include/boost/mpi/detail/request_handlers.hpp:220:39: warning: unused parameter 'comm' [-Wunused-parameter]
  220 |   serialized_data(communicator const& comm, packed_iarchive& ar) : m_archive(ar) {}
      |                                       ^
/opt/homebrew/include/boost/mpi/communicator.hpp:1424:71: warning: unused parameter 'primitive' [-Wunused-parameter]
 1424 |                                  std::vector<T,A>& values, mpl::true_ primitive) const
      |                                                                       ^
/opt/homebrew/include/boost/mpi/communicator.hpp:1548:39: warning: unused parameter 'primitive' [-Wunused-parameter]
 1548 |                            mpl::true_ primitive) const
      |                                       ^
/opt/homebrew/include/boost/mpi/communicator.hpp:1634:39: warning: unused parameter 'primitive' [-Wunused-parameter]
 1634 |                            mpl::true_ primitive) const
      |                                       ^
/opt/homebrew/include/boost/mpi/collectives/broadcast.hpp:107:30: warning: unused parameter 'non_mpi_datatype' [-Wunused-parameter]
  107 |                  mpl::false_ non_mpi_datatype)
      |                              ^
/opt/homebrew/include/boost/mpi/collectives/reduce.hpp:81:33: warning: unused parameter 'op' [-Wunused-parameter]
   81 |               T* out_values, Op op, int root, mpl::false_ /*is_mpi_op*/,
      |                                 ^
/opt/homebrew/include/boost/mpi/collectives/reduce.hpp:96:71: warning: unused parameter 'op' [-Wunused-parameter]
   96 |   reduce_impl(const communicator& comm, const T* in_values, int n, Op op,
      |                                                                       ^
/opt/homebrew/include/boost/mpi/collectives/scan.hpp:68:16: warning: unused parameter 'op' [-Wunused-parameter]
   68 |             Op op, mpl::false_ /*is_mpi_op*/, mpl::true_ /*is_mpi_datatype*/)
      |                ^

which is a little bit annoying.

Dominant language
HTML
Stars
8.6k
Forks
2k
Avg merge
9h 35m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/boost

All issues in boostorg/boost

Similar issues

More Distributed Systems issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.