Fixed unused parameter warning wehn compiling without MPI.

This commit is contained in:
Markus Blatt 2019-10-18 16:21:41 +02:00
parent 42247105bf
commit 3dad4f21e8

View File

@ -46,7 +46,8 @@ std::size_t packSize(const T*, std::size_t l, Dune::MPIHelper::MPICommunicator c
MPI_Pack_size(l, Dune::MPITraits<T>::getType(), comm, &size); MPI_Pack_size(l, Dune::MPITraits<T>::getType(), comm, &size);
return totalSize + size; return totalSize + size;
#else #else
return 0; (void) comm;
return l-l;
#endif #endif
} }
@ -72,6 +73,7 @@ std::size_t packSize(const T&, Dune::MPIHelper::MPICommunicator comm,
MPI_Pack_size(1, Dune::MPITraits<T>::getType(), comm, &size); MPI_Pack_size(1, Dune::MPITraits<T>::getType(), comm, &size);
return size; return size;
#else #else
(void) comm;
return 0; return 0;
#endif #endif
} }
@ -112,6 +114,8 @@ std::size_t packSize(const char* str, Dune::MPIHelper::MPICommunicator comm)
MPI_Pack_size(strlen(str)+1, MPI_CHAR, comm, &size); MPI_Pack_size(strlen(str)+1, MPI_CHAR, comm, &size);
return totalSize + size; return totalSize + size;
#else #else
(void) str;
(void) comm;
return 0; return 0;
#endif #endif
} }
@ -220,6 +224,12 @@ void pack(const T* data, std::size_t l, std::vector<char>& buffer, int& position
buffer.size(), &position, comm); buffer.size(), &position, comm);
MPI_Pack(data, l, Dune::MPITraits<T>::getType(), buffer.data(), MPI_Pack(data, l, Dune::MPITraits<T>::getType(), buffer.data(),
buffer.size(), &position, comm); buffer.size(), &position, comm);
#else
(void) data;
(void) comm;
(void) l;
(void) buffer;
(void) position;
#endif #endif
} }
@ -244,6 +254,11 @@ void pack(const T& data, std::vector<char>& buffer, int& position,
#if HAVE_MPI #if HAVE_MPI
MPI_Pack(&data, 1, Dune::MPITraits<T>::getType(), buffer.data(), MPI_Pack(&data, 1, Dune::MPITraits<T>::getType(), buffer.data(),
buffer.size(), &position, comm); buffer.size(), &position, comm);
#else
(void) data;
(void) comm;
(void) buffer;
(void) position;
#endif #endif
} }
@ -288,6 +303,11 @@ void pack(const char* str, std::vector<char>& buffer, int& position,
buffer.size(), &position, comm); buffer.size(), &position, comm);
MPI_Pack(str, strlen(str)+1, MPI_CHAR, buffer.data(), buffer.size(), MPI_Pack(str, strlen(str)+1, MPI_CHAR, buffer.data(), buffer.size(),
&position, comm); &position, comm);
#else
(void) str;
(void) comm;
(void) buffer;
(void) position;
#endif #endif
} }
@ -413,6 +433,12 @@ void unpack(T* data, const std::size_t& l, std::vector<char>& buffer, int& posit
#if HAVE_MPI #if HAVE_MPI
MPI_Unpack(buffer.data(), buffer.size(), &position, data, l, MPI_Unpack(buffer.data(), buffer.size(), &position, data, l,
Dune::MPITraits<T>::getType(), comm); Dune::MPITraits<T>::getType(), comm);
#else
(void) data;
(void) comm;
(void) l;
(void) buffer;
(void) position;
#endif #endif
} }
@ -437,6 +463,11 @@ void unpack(T& data, std::vector<char>& buffer, int& position,
#if HAVE_MPI #if HAVE_MPI
MPI_Unpack(buffer.data(), buffer.size(), &position, &data, 1, MPI_Unpack(buffer.data(), buffer.size(), &position, &data, 1,
Dune::MPITraits<T>::getType(), comm); Dune::MPITraits<T>::getType(), comm);
#else
(void) data;
(void) comm;
(void) buffer;
(void) position;
#endif #endif
} }
@ -478,6 +509,12 @@ void unpack(char* str, std::size_t length, std::vector<char>& buffer, int& posit
{ {
#if HAVE_MPI #if HAVE_MPI
MPI_Unpack(buffer.data(), buffer.size(), &position, const_cast<char*>(str), length, MPI_CHAR, comm); MPI_Unpack(buffer.data(), buffer.size(), &position, const_cast<char*>(str), length, MPI_CHAR, comm);
#else
(void) str;
(void) comm;
(void) length;
(void) buffer;
(void) position;
#endif #endif
} }
@ -630,6 +667,7 @@ RestartValue loadParallelRestart(const EclipseIO* eclIO, SummaryState& summarySt
} }
return restartValues; return restartValues;
#else #else
(void) comm;
return eclIO->loadRestart(summaryState, solutionKeys, extraKeys); return eclIO->loadRestart(summaryState, solutionKeys, extraKeys);
#endif #endif
} }