1 /* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #include "smpi_status.hpp"
8 #include "smpi_datatype.hpp"
10 namespace simgrid::smpi {
12 void Status::empty(MPI_Status * status)
14 if(status != MPI_STATUS_IGNORE) {
15 status->MPI_SOURCE = MPI_ANY_SOURCE;
16 status->MPI_TAG = MPI_ANY_TAG;
17 status->MPI_ERROR = MPI_SUCCESS;
23 int Status::cancelled(const MPI_Status * status)
25 return status->cancelled!=0;
28 void Status::set_cancelled(MPI_Status * status, int flag)
30 status->cancelled=flag;
33 void Status::set_elements(MPI_Status* status, const Datatype*, int count)
38 int Status::get_count(const MPI_Status* status, const Datatype* datatype)
40 return status->count / datatype->size();
43 } // namespace simgrid::smpi