Commit ae5f12d6 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

default initialize MPI_Requests

parent 9f35f6d0
......@@ -111,7 +111,7 @@ namespace Mpi
Request isend(std::string const& str, int to, Tag tag = {}) const
{
MPI_Request request;
MPI_Request request = nullptr;
MPI_Isend(to_void_ptr(str.data()), int(str.size()), MPI_CHAR, to, tag.value, comm_, &request);
return {request};
}
......@@ -199,7 +199,7 @@ namespace Mpi
MPI_Get_count(&status, MPI_CHAR, &size);
str.resize(size);
MPI_Request req;
MPI_Request req = nullptr;
MPI_Irecv(&str[0], size, MPI_CHAR, status.MPI_SOURCE, status.MPI_TAG, comm, &req);
return req;
......
......@@ -34,7 +34,7 @@ void Communicator::send(std::vector<T> const& vec, int to, Tag tag) const
template <class Data, REQUIRES_(not Concepts::RawPointer<Data>)>
Request Communicator::isend(Data const& data, int to, Tag tag) const
{
MPI_Request request;
MPI_Request request = nullptr;
MPI_Isend(to_void_ptr(&data), 1, type_to_mpi<Data>(), to, tag.value, comm_, &request);
return {request};
}
......@@ -44,7 +44,7 @@ Request Communicator::isend(Data const& data, int to, Tag tag) const
template <class Data>
Request Communicator::isend(Data const* data, std::size_t size, int to, Tag tag) const
{
MPI_Request request;
MPI_Request request = nullptr;
MPI_Isend(to_void_ptr(data), size, type_to_mpi<Data>(), to, tag.value, comm_, &request);
return {request};
}
......@@ -53,7 +53,7 @@ Request Communicator::isend(Data const* data, std::size_t size, int to, Tag tag)
template <class T>
Request Communicator::isend(std::vector<T> const& vec, int to, Tag tag) const
{
MPI_Request request;
MPI_Request request = nullptr;
MPI_Isend(to_void_ptr(vec.data()), int(vec.size()), type_to_mpi<T>(), to, tag.value, comm_, &request);
return {request};
}
......@@ -105,7 +105,7 @@ MPI_Status Communicator::recv(std::vector<T>& vec, int from, Tag tag) const
template <class Data, REQUIRES_(not Concepts::RawPointer<Data>)>
Request Communicator::irecv(Data& data, int from, Tag tag) const
{
MPI_Request request;
MPI_Request request = nullptr;
MPI_Irecv(&data, 1, type_to_mpi<Data>(), from, tag.value, comm_, &request);
return {request};
}
......@@ -115,7 +115,7 @@ Request Communicator::irecv(Data& data, int from, Tag tag) const
template <class Data>
Request Communicator::irecv(Data* data, std::size_t size, int from, Tag tag) const
{
MPI_Request request;
MPI_Request request = nullptr;
MPI_Irecv(data, size, type_to_mpi<Data>(), from, tag.value, comm_, &request);
return {request};
}
......@@ -132,7 +132,7 @@ Request Communicator::irecv(std::vector<T>& vec, int from, Tag tag) const
int min_size = std::max(size,1);
vec.resize(min_size);
MPI_Request req;
MPI_Request req = nullptr;
MPI_Irecv(vec.data(), min_size, type_to_mpi<T>(), status.MPI_SOURCE, status.MPI_TAG, comm, &req);
return req;
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment