1 /* Copyright (c) 2007-2020. 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"
9 #include "src/simix/smx_private.hpp"
14 void Status::empty(MPI_Status * status)
16 if(status != MPI_STATUS_IGNORE) {
17 status->MPI_SOURCE = MPI_ANY_SOURCE;
18 status->MPI_TAG = MPI_ANY_TAG;
19 status->MPI_ERROR = MPI_SUCCESS;
25 int Status::cancelled(const MPI_Status * status)
27 return status->cancelled!=0;
30 void Status::set_cancelled(MPI_Status * status, int flag)
32 status->cancelled=flag;
35 void Status::set_elements(MPI_Status* status, const Datatype*, int count)
40 int Status::get_count(const MPI_Status* status, const Datatype* datatype)
42 return status->count / datatype->size();