Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
ok, I stop trying to please sonar.
[simgrid.git] / src / smpi / smpi_status.cpp
1 /* Copyright (c) 2007-2015. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include "private.h"
8 #include "src/simix/smx_private.h"
9
10 namespace simgrid{
11 namespace smpi{
12
13 void Status::empty(MPI_Status * status)
14 {
15   if(status != MPI_STATUS_IGNORE) {
16     status->MPI_SOURCE = MPI_ANY_SOURCE;
17     status->MPI_TAG = MPI_ANY_TAG;
18     status->MPI_ERROR = MPI_SUCCESS;
19     status->count=0;
20   }
21 }
22
23 int Status::get_count(MPI_Status * status, MPI_Datatype datatype)
24 {
25   return status->count / datatype->size();
26 }
27
28 }
29 }