/* 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 <xbt/config.hpp>
+
#include "private.h"
#include "xbt/virtu.h"
#include "mc/mc.h"
int nb_values;
double values[4];//arbitrary set to 4
} s_smpi_factor_multival_t;
+
xbt_dynar_t smpi_os_values = NULL;
xbt_dynar_t smpi_or_values = NULL;
xbt_dynar_t smpi_ois_values = NULL;
-double smpi_wtime_sleep = 0.0;
-double smpi_iprobe_sleep = 1e-4;
-double smpi_test_sleep = 1e-4;
+static simgrid::config::Flag<double> smpi_wtime_sleep(
+ "smpi/wtime", "Minimum time to inject inside a call to MPI_Wtime", 0.0);
+static simgrid::config::Flag<double> smpi_iprobe_sleep(
+ "smpi/iprobe", "Minimum time to inject inside a call to MPI_Iprobe", 1e-4);
+static simgrid::config::Flag<double> smpi_test_sleep(
+ "smpi/test", "Minimum time to inject inside a call to MPI_Test", 1e-4);
static int factor_cmp(const void *pa, const void *pb)
{
if(req->flags & RECV)
subtype->unserialize(req->buf, req->old_buf, req->real_size/smpi_datatype_size(datatype) ,
datatype->substruct, req->op);
- if(req->detached == 0) free(req->buf);
+ xbt_free(req->buf);
}else if(req->flags & RECV){//apply op on contiguous buffer for accumulate
int n =req->real_size/smpi_datatype_size(datatype);
smpi_op_apply(req->op, req->buf, req->old_buf, &n, &datatype);
+ xbt_free(req->buf);
}
}
}
void **tmpbufs;
char* sendtmpbuf = (char*) sendbuf;
- if( sendbuf == MPI_IN_PLACE ) {
- sendtmpbuf = (char *)smpi_get_tmp_sendbuffer(count*smpi_datatype_get_extent(datatype));
- smpi_datatype_copy(recvbuf, count, datatype,sendtmpbuf, count, datatype);
- }
+
rank = smpi_comm_rank(comm);
size = smpi_comm_size(comm);
smpi_coll_tuned_reduce_ompi_basic_linear(sendtmpbuf, recvbuf, count, datatype, op, root, comm);
return;
}
+
+ if( sendbuf == MPI_IN_PLACE ) {
+ sendtmpbuf = (char *)smpi_get_tmp_sendbuffer(count*smpi_datatype_get_extent(datatype));
+ smpi_datatype_copy(recvbuf, count, datatype,sendtmpbuf, count, datatype);
+ }
if(rank != root) {
// Send buffer to root
xbt_free(tmpbufs);
xbt_free(requests);
- if( sendbuf == MPI_IN_PLACE ) {
- smpi_free_tmp_buffer(sendtmpbuf);
- }
+ }
+ if( sendbuf == MPI_IN_PLACE ) {
+ smpi_free_tmp_buffer(sendtmpbuf);
}
}