/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "private.h"
+#include "private.hpp"
#include "smpi_comm.hpp"
#include "smpi_datatype.hpp"
-#include "smpi_request.hpp"
#include "smpi_process.hpp"
+#include "smpi_request.hpp"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi);
retval = MPI_ERR_TAG;
} else {
- int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
+ int rank = smpi_process()->index();
int src_traced = comm->group()->index(src);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
} else if(tag<0 && tag != MPI_ANY_TAG){
retval = MPI_ERR_TAG;
} else {
- int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
+ int rank = smpi_process()->index();
int dst_traced = comm->group()->index(dst);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_ISEND;
} else if(tag<0 && tag != MPI_ANY_TAG){
retval = MPI_ERR_TAG;
} else {
- int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
+ int rank = smpi_process()->index();
int dst_traced = comm->group()->index(dst);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_ISSEND;
} else if(tag<0 && tag != MPI_ANY_TAG){
retval = MPI_ERR_TAG;
} else {
- int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
+ int rank = smpi_process()->index();
int src_traced = comm->group()->index(src);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
extra->type = TRACING_RECV;
} else if(tag < 0 && tag != MPI_ANY_TAG){
retval = MPI_ERR_TAG;
} else {
- int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
+ int rank = smpi_process()->index();
int dst_traced = comm->group()->index(dst);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_SEND;
} else if(tag<0 && tag != MPI_ANY_TAG){
retval = MPI_ERR_TAG;
} else {
- int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
+ int rank = smpi_process()->index();
int dst_traced = comm->group()->index(dst);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
extra->type = TRACING_SSEND;
retval = MPI_ERR_TAG;
} else {
- int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1;
+ int rank = smpi_process()->index();
int dst_traced = comm->group()->index(dst);
int src_traced = comm->group()->index(src);
instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);
} else if (*request == MPI_REQUEST_NULL) {
retval = MPI_SUCCESS;
} else {
-
- int rank = (request!=nullptr && (*request)->comm() != MPI_COMM_NULL) ? smpi_process()->index() : -1;
+ int rank = (*request)->comm() != MPI_COMM_NULL ? smpi_process()->index() : -1;
int src_traced = (*request)->src();
int dst_traced = (*request)->dst();
if (index == nullptr)
return MPI_ERR_ARG;
+ if (count <= 0)
+ return MPI_SUCCESS;
+
smpi_bench_end();
//save requests information for tracing
typedef struct {
int tag;
MPI_Comm comm;
} savedvalstype;
- savedvalstype* savedvals=nullptr;
- if(count>0){
- savedvals = xbt_new0(savedvalstype, count);
- }
+ savedvalstype* savedvals = xbt_new0(savedvalstype, count);
+
for (int i = 0; i < count; i++) {
MPI_Request req = requests[i]; //already received requests are no longer valid
if (req) {