// Make sure that the shared memory host has copied the data before we try to
// access it.
- MPI_Barrier(shmem_group_communicator);
+ const int ierr = MPI_Barrier(shmem_group_communicator);
+ AssertThrowMPI(ierr);
// **** Step 7 ****
// Finally, we need to set the pointers of this object to what we just
std::vector<int> size_all_data(n_procs, 0);
// Exchanging the size of each buffer
- MPI_Allgather(
+ int ierr = MPI_Allgather(
&n_local_data, 1, MPI_INT, size_all_data.data(), 1, MPI_INT, comm);
+ AssertThrowMPI(ierr);
// Now computing the displacement, relative to recvbuf,
// at which to store the incoming buffer
std::vector<char> received_unrolled_buffer(rdispls.back() +
size_all_data.back());
- MPI_Allgatherv(buffer.data(),
- n_local_data,
- MPI_CHAR,
- received_unrolled_buffer.data(),
- size_all_data.data(),
- rdispls.data(),
- MPI_CHAR,
- comm);
+ ierr = MPI_Allgatherv(buffer.data(),
+ n_local_data,
+ MPI_CHAR,
+ received_unrolled_buffer.data(),
+ size_all_data.data(),
+ rdispls.data(),
+ MPI_CHAR,
+ comm);
+ AssertThrowMPI(ierr);
std::vector<T> received_objects(n_procs);
for (unsigned int i = 0; i < n_procs; ++i)
{
// wait for an incoming message
MPI_Status status;
- auto ierr =
+ int ierr =
MPI_Probe(MPI_ANY_SOURCE, mpi_tag, comm, &status);
AssertThrowMPI(ierr);
++c)
{
// wait for an incoming message
- MPI_Status status;
- unsigned int ierr =
- MPI_Probe(MPI_ANY_SOURCE, mpi_tag, comm, &status);
+ MPI_Status status;
+ int ierr = MPI_Probe(MPI_ANY_SOURCE, mpi_tag, comm, &status);
AssertThrowMPI(ierr);
// retrieve size of incoming message
}
- const int ierr = MPI_Wait(&barrier_request, MPI_STATUS_IGNORE);
+ int ierr = MPI_Wait(&barrier_request, MPI_STATUS_IGNORE);
AssertThrowMPI(ierr);
for (auto &i : request_requests)
{
- const auto ierr = MPI_Wait(i.get(), MPI_STATUS_IGNORE);
+ ierr = MPI_Wait(i.get(), MPI_STATUS_IGNORE);
AssertThrowMPI(ierr);
}
# ifdef DEBUG
// note: IBarrier seems to make problem during testing, this
// additional Barrier seems to help
- MPI_Barrier(this->comm);
+ ierr = MPI_Barrier(this->comm);
+ AssertThrowMPI(ierr);
# endif
}
AssertIndexRange(recv_ranks.size(), recv_ptr.size());
for (types::global_dof_index i = 0; i < recv_ranks.size(); i++)
{
- const auto ierr =
+ const int ierr =
MPI_Irecv(buffers.data() + recv_ptr[i],
recv_ptr[i + 1] - recv_ptr[i],
Utilities::MPI::internal::mpi_type_id(buffers.data()),
(send_ptr[i] == buffers.size() &&
send_ptr[i + 1] == send_ptr[i]),
ExcMessage("The input buffer doesn't contain enough entries"));
- const auto ierr =
+ const int ierr =
MPI_Isend(buffers.data() + send_ptr[i],
send_ptr[i + 1] - send_ptr[i],
Utilities::MPI::internal::mpi_type_id(buffers.data()),
}
// wait that all data packages have been sent
- const auto ierr =
+ const int ierr =
MPI_Waitall(send_ranks.size(), requests.data(), MPI_STATUSES_IGNORE);
AssertThrowMPI(ierr);
#endif
requests.push_back(MPI_Request());
- MPI_Isend(buffer.data(),
- buffer.size(),
- MPI_CHAR,
- send_ranks[i],
- internal::Tags::remote_point_evaluation,
- tria->get_communicator(),
- &requests.back());
+ const int ierr = MPI_Isend(buffer.data(),
+ buffer.size(),
+ MPI_CHAR,
+ send_ranks[i],
+ internal::Tags::remote_point_evaluation,
+ tria->get_communicator(),
+ &requests.back());
+ AssertThrowMPI(ierr);
}
for (const auto recv_rank : recv_ranks)
continue;
MPI_Status status;
- MPI_Probe(MPI_ANY_SOURCE,
- internal::Tags::remote_point_evaluation,
- tria->get_communicator(),
- &status);
+ int ierr = MPI_Probe(MPI_ANY_SOURCE,
+ internal::Tags::remote_point_evaluation,
+ tria->get_communicator(),
+ &status);
+ AssertThrowMPI(ierr);
int message_length;
- MPI_Get_count(&status, MPI_CHAR, &message_length);
+ ierr = MPI_Get_count(&status, MPI_CHAR, &message_length);
+ AssertThrowMPI(ierr);
std::vector<char> buffer(message_length);
- MPI_Recv(buffer.data(),
- buffer.size(),
- MPI_CHAR,
- status.MPI_SOURCE,
- internal::Tags::remote_point_evaluation,
- tria->get_communicator(),
- MPI_STATUS_IGNORE);
+ ierr = MPI_Recv(buffer.data(),
+ buffer.size(),
+ MPI_CHAR,
+ status.MPI_SOURCE,
+ internal::Tags::remote_point_evaluation,
+ tria->get_communicator(),
+ MPI_STATUS_IGNORE);
+ AssertThrowMPI(ierr);
temp_recv_map[status.MPI_SOURCE] =
Utilities::unpack<std::vector<T>>(buffer, false);
}
// make sure all messages have been sent
- MPI_Waitall(requests.size(), requests.data(), MPI_STATUSES_IGNORE);
+ const int ierr =
+ MPI_Waitall(requests.size(), requests.data(), MPI_STATUSES_IGNORE);
+ AssertThrowMPI(ierr);
// copy received data into output vector
auto it = recv_permutation.begin();
requests.push_back(MPI_Request());
- MPI_Isend(buffer_send.data(),
- buffer_send.size(),
- MPI_CHAR,
- recv_rank,
- internal::Tags::remote_point_evaluation,
- tria->get_communicator(),
- &requests.back());
+ const int ierr = MPI_Isend(buffer_send.data(),
+ buffer_send.size(),
+ MPI_CHAR,
+ recv_rank,
+ internal::Tags::remote_point_evaluation,
+ tria->get_communicator(),
+ &requests.back());
+ AssertThrowMPI(ierr);
}
for (unsigned int i = 0; i < send_ranks.size(); ++i)
}
MPI_Status status;
- MPI_Probe(MPI_ANY_SOURCE,
- internal::Tags::remote_point_evaluation,
- tria->get_communicator(),
- &status);
+ int ierr = MPI_Probe(MPI_ANY_SOURCE,
+ internal::Tags::remote_point_evaluation,
+ tria->get_communicator(),
+ &status);
+ AssertThrowMPI(ierr);
int message_length;
- MPI_Get_count(&status, MPI_CHAR, &message_length);
+ ierr = MPI_Get_count(&status, MPI_CHAR, &message_length);
+ AssertThrowMPI(ierr);
std::vector<char> recv_buffer(message_length);
- MPI_Recv(recv_buffer.data(),
- recv_buffer.size(),
- MPI_CHAR,
- status.MPI_SOURCE,
- internal::Tags::remote_point_evaluation,
- tria->get_communicator(),
- MPI_STATUS_IGNORE);
-
+ ierr = MPI_Recv(recv_buffer.data(),
+ recv_buffer.size(),
+ MPI_CHAR,
+ status.MPI_SOURCE,
+ internal::Tags::remote_point_evaluation,
+ tria->get_communicator(),
+ MPI_STATUS_IGNORE);
+ AssertThrowMPI(ierr);
const auto recv_buffer_unpacked =
Utilities::unpack<std::vector<T>>(recv_buffer, false);
}
}
- MPI_Waitall(requests.size(), requests.data(), MPI_STATUSES_IGNORE);
+ const int ierr =
+ MPI_Waitall(requests.size(), requests.data(), MPI_STATUSES_IGNORE);
+ AssertThrowMPI(ierr);
// sort for easy access during function call
for (unsigned int i = 0; i < send_permutation.size(); ++i)
std::vector<Number *> others(size_sm);
MPI_Info info;
- MPI_Info_create(&info);
+ int ierr = MPI_Info_create(&info);
+ AssertThrowMPI(ierr);
- MPI_Info_set(info, "alloc_shared_noncontig", "true");
+ ierr = MPI_Info_set(info, "alloc_shared_noncontig", "true");
+ AssertThrowMPI(ierr);
const std::size_t align_by = 64;
sizeof(Number)) *
sizeof(Number);
- auto ierr = MPI_Win_allocate_shared(
+ ierr = MPI_Win_allocate_shared(
s, sizeof(Number), info, comm_shared, &data_this, &mpi_window);
AssertThrowMPI(ierr);
MPI_Status status;
unsigned int mysize = inner_face.second.shared_faces.size();
unsigned int othersize = numbers::invalid_unsigned_int;
- MPI_Sendrecv(&mysize,
- 1,
- MPI_UNSIGNED,
- inner_face.first,
- 600 + my_domain,
- &othersize,
- 1,
- MPI_UNSIGNED,
- inner_face.first,
- 600 + inner_face.first,
- comm,
- &status);
+
+ int ierr = MPI_Sendrecv(&mysize,
+ 1,
+ MPI_UNSIGNED,
+ inner_face.first,
+ 600 + my_domain,
+ &othersize,
+ 1,
+ MPI_UNSIGNED,
+ inner_face.first,
+ 600 + inner_face.first,
+ comm,
+ &status);
+ AssertThrowMPI(ierr);
AssertDimension(mysize, othersize);
mysize = inner_face.second.n_hanging_faces_smaller_subdomain;
- MPI_Sendrecv(&mysize,
- 1,
- MPI_UNSIGNED,
- inner_face.first,
- 700 + my_domain,
- &othersize,
- 1,
- MPI_UNSIGNED,
- inner_face.first,
- 700 + inner_face.first,
- comm,
- &status);
+ ierr = MPI_Sendrecv(&mysize,
+ 1,
+ MPI_UNSIGNED,
+ inner_face.first,
+ 700 + my_domain,
+ &othersize,
+ 1,
+ MPI_UNSIGNED,
+ inner_face.first,
+ 700 + inner_face.first,
+ comm,
+ &status);
+ AssertThrowMPI(ierr);
AssertDimension(mysize, othersize);
mysize = inner_face.second.n_hanging_faces_larger_subdomain;
- MPI_Sendrecv(&mysize,
- 1,
- MPI_UNSIGNED,
- inner_face.first,
- 800 + my_domain,
- &othersize,
- 1,
- MPI_UNSIGNED,
- inner_face.first,
- 800 + inner_face.first,
- comm,
- &status);
+ ierr = MPI_Sendrecv(&mysize,
+ 1,
+ MPI_UNSIGNED,
+ inner_face.first,
+ 800 + my_domain,
+ &othersize,
+ 1,
+ MPI_UNSIGNED,
+ inner_face.first,
+ 800 + inner_face.first,
+ comm,
+ &status);
+ AssertThrowMPI(ierr);
AssertDimension(mysize, othersize);
# endif
// make sure the splitting is consistent between both sides
# if defined(DEAL_II_WITH_MPI) && defined(DEBUG)
- MPI_Sendrecv(&split_index,
- 1,
- MPI_UNSIGNED,
- inner_face.first,
- 900 + my_domain,
- &othersize,
- 1,
- MPI_UNSIGNED,
- inner_face.first,
- 900 + inner_face.first,
- comm,
- &status);
+ ierr = MPI_Sendrecv(&split_index,
+ 1,
+ MPI_UNSIGNED,
+ inner_face.first,
+ 900 + my_domain,
+ &othersize,
+ 1,
+ MPI_UNSIGNED,
+ inner_face.first,
+ 900 + inner_face.first,
+ comm,
+ &status);
+ AssertThrowMPI(ierr);
AssertDimension(split_index, othersize);
- MPI_Sendrecv(&n_faces_lower_proc,
- 1,
- MPI_UNSIGNED,
- inner_face.first,
- 1000 + my_domain,
- &othersize,
- 1,
- MPI_UNSIGNED,
- inner_face.first,
- 1000 + inner_face.first,
- comm,
- &status);
+ ierr = MPI_Sendrecv(&n_faces_lower_proc,
+ 1,
+ MPI_UNSIGNED,
+ inner_face.first,
+ 1000 + my_domain,
+ &othersize,
+ 1,
+ MPI_UNSIGNED,
+ inner_face.first,
+ 1000 + inner_face.first,
+ comm,
+ &status);
+ AssertThrowMPI(ierr);
AssertDimension(n_faces_lower_proc, othersize);
- MPI_Sendrecv(&n_faces_higher_proc,
- 1,
- MPI_UNSIGNED,
- inner_face.first,
- 1100 + my_domain,
- &othersize,
- 1,
- MPI_UNSIGNED,
- inner_face.first,
- 1100 + inner_face.first,
- comm,
- &status);
+ ierr = MPI_Sendrecv(&n_faces_higher_proc,
+ 1,
+ MPI_UNSIGNED,
+ inner_face.first,
+ 1100 + my_domain,
+ &othersize,
+ 1,
+ MPI_UNSIGNED,
+ inner_face.first,
+ 1100 + inner_face.first,
+ comm,
+ &status);
+ AssertThrowMPI(ierr);
AssertDimension(n_faces_higher_proc, othersize);
# endif
}
if (Utilities::MPI::job_supports_mpi())
- MPI_Barrier(matrix_free.get_task_info().communicator_sm);
+ {
+ const int ierr =
+ MPI_Barrier(matrix_free.get_task_info().communicator_sm);
+ AssertThrowMPI(ierr);
+ }
# endif
}
}
for (unsigned int i = 0; i < ranks.size(); ++i)
{
MPI_Status status;
- const auto ierr_1 = MPI_Probe(
+ const int ierr_1 = MPI_Probe(
MPI_ANY_SOURCE,
Utilities::MPI::internal::Tags::fine_dof_handler_view_reinit,
communicator,
std::vector<types::global_dof_index> buffer;
- int message_length;
- const auto ierr_2 =
+ int message_length;
+ const int ierr_2 =
MPI_Get_count(&status,
Utilities::MPI::internal::mpi_type_id(
buffer.data()),
buffer.resize(message_length);
- const auto ierr_3 = MPI_Recv(
+ const int ierr_3 = MPI_Recv(
buffer.data(),
buffer.size(),
Utilities::MPI::internal::mpi_type_id(buffer.data()),
}
}
- const auto ierr_1 =
+ const int ierr_1 =
MPI_Waitall(requests.size(), requests.data(), MPI_STATUSES_IGNORE);
AssertThrowMPI(ierr_1);
}