Opened 8 years ago

Last modified 6 years ago

#10998 new Support Requests

Error: Boost_MPI send(): explicit specialization must precede its first use

Reported by: anonymous Owned by: Matthias Troyer
Milestone: To Be Determined Component: mpi
Version: Boost 1.63.0 Severity: Problem
Keywords: explicit specialization Cc:

Description

Dear Boost-Support,

when compiling a file with NVCC 6.5.14 containing calls to isend() etc. of boost:mpi, the following error occ

nvcc -std=c++11 -arch=sm_20 -c file.cu boost/1.55.0-gnu4.8/include/boost/mpi/communicator.hpp(1612): error: explicit specialization of function "boost::mpi::communicator::send(int, int, const T &) const [with T=boost::mpi::packed_oarchive]" must precede its first use ( (1127): here)

boost/1.55.0-gnu4.8/include/boost/mpi/communicator.hpp(1635): error: explicit specialization of function "boost::mpi::communicator::recv(int, int, T &) const [with T=boost::mpi::packed_iarchive]" must precede its first use ( (1191): here)

boost/1.55.0-gnu4.8/include/boost/mpi/communicator.hpp(1670): error: explicit specialization of function "boost::mpi::communicator::isend(int, int, const T &) const [with T=boost::mpi::packed_oarchive]" must precede its first use ( (1276): here)

Could you please help me regarding the error above?

Best regards, Peter

Change History (4)

comment:1 by tferguson, 6 years ago

I have experienced the same issue in Boost 1.61.0 using the Intel 16 compiler. This error is not encountered when using GCC 5.3.0. I have found that I can remove the error if I move the function declarations for:

communicator::send_impl

communicator::recv_impl

communicator::isend_impl

communicator::irecv_impl

communicator::array_send_impl

communicator::array_recv_impl

communicator::array_isend_impl

in communicator.hpp to after the specialization lines (marked as INTERNAL ONLY, around lines 1600-1700), then the error is no longer experienced and the code compiles.

The source of the error appears to be that the above functions instantiate send/recv objects using packed_oarchive and packed_iarchive types, then the specialization becomes redundant according to the compiler and an error is encountered when reading the communicator.hpp header.

comment:2 by gnthibault, 6 years ago

Awesome, thank you very much tferguson for sharing your solution. I do experienced the same problem with cuda 8.0 and gcc 5.4. Would someone consider pushing that modification for the next release of boost ?

comment:3 by gnthibault@…, 6 years ago

Keywords: explicit specialization added
Version: Boost 1.55.0Boost 1.63.0

comment:3 by gnthibault@…, 6 years ago

Keywords: explicit specialization added
Version: Boost 1.55.0Boost 1.63.0
Note: See TracTickets for help on using tickets.