@@ -24,7 +24,7 @@ namespace Cereal_Func
2424 // every 2^exponent_align char concatenate to 1 word
2525 // <<exponent_align means *2^exponent_align
2626 // >>exponent_align means /2^exponent_align
27- static std::size_t align_stringstream (std::stringstream &ss)
27+ inline std::size_t align_stringstream (std::stringstream &ss)
2828 {
2929 #if MPI_VERSION>=4
3030 using int_type = MPI_Count;
@@ -34,18 +34,18 @@ namespace Cereal_Func
3434 const std::size_t size_old = ss.str ().size (); // Inefficient, should be optimized
3535 const std::size_t times = std::ceil ( double (size_old) / double (std::numeric_limits<int_type>::max ()) );
3636 const std::size_t exponent_align = std::ceil ( std::log (times) / std::log (2 ) );
37- const MPI_Datatype MPI_type = MPI_Wrapper::char_contiguous (exponent_align);
37+ MPI_Wrapper::char_contiguous (exponent_align);
3838 constexpr char c0 = 0 ;
3939 const std::size_t size_align = 1 <<exponent_align;
4040 if (size_old%size_align)
41- for (int i=size_old%size_align; i<size_align; ++i)
41+ for (std:: size_t i=size_old%size_align; i<size_align; ++i)
4242 ss<<c0;
4343 return exponent_align;
4444 }
4545
4646
4747 // Send str
48- static void mpi_send (const std::string &str, const std::size_t exponent_align, const int rank_recv, const int tag, const MPI_Comm &mpi_comm)
48+ inline void mpi_send (const std::string &str, const std::size_t exponent_align, const int rank_recv, const int tag, const MPI_Comm &mpi_comm)
4949 {
5050 #if MPI_VERSION>=4
5151 MPI_CHECK ( MPI_Send_c ( str.c_str (), str.size ()>>exponent_align, MPI_Wrapper::char_contiguous (exponent_align), rank_recv, tag, mpi_comm ) );
@@ -71,7 +71,7 @@ namespace Cereal_Func
7171
7272
7373 // Isend str
74- static void mpi_isend (const std::string &str, const std::size_t exponent_align, const int rank_recv, const int tag, const MPI_Comm &mpi_comm, MPI_Request &request)
74+ inline void mpi_isend (const std::string &str, const std::size_t exponent_align, const int rank_recv, const int tag, const MPI_Comm &mpi_comm, MPI_Request &request)
7575 {
7676 #if MPI_VERSION>=4
7777 MPI_CHECK ( MPI_Isend_c ( str.c_str (), str.size ()>>exponent_align, MPI_Wrapper::char_contiguous (exponent_align), rank_recv, tag, mpi_comm, &request ) );
@@ -98,7 +98,7 @@ namespace Cereal_Func
9898
9999
100100 // Recv to return
101- static std::vector<char > mpi_recv (const MPI_Comm &mpi_comm, MPI_Status &status)
101+ inline std::vector<char > mpi_recv (const MPI_Comm &mpi_comm, MPI_Status &status)
102102 {
103103 for (std::size_t exponent_align=0 ; ; ++exponent_align)
104104 {
@@ -142,7 +142,7 @@ namespace Cereal_Func
142142
143143
144144 // Mrecv to return
145- static std::vector<char > mpi_mrecv (MPI_Message &message_recv, const MPI_Status &status)
145+ inline std::vector<char > mpi_mrecv (MPI_Message &message_recv, const MPI_Status &status)
146146 {
147147 for (std::size_t exponent_align=0 ; ; ++exponent_align)
148148 {
0 commit comments