Previous protection was ignoring NULL as a buffer.
But some collective algorithms use chunks of data from the buffer, instead, trying to use NULL+offset as an address.
XBT_PUBLIC(int) xbt_replay_action_runner(int argc, char *argv[]);
+XBT_PUBLIC(int) _xbt_replay_is_active(void);
+
XBT_PUBLIC(void) _xbt_replay_action_init(void);
XBT_PUBLIC(void) _xbt_replay_action_exit(void);
request->refcount++;
if(request->old_type->has_subtype == 0){
oldbuf = request->buf;
- if (oldbuf && request->size!=0){
+ if (!_xbt_replay_is_active() && oldbuf && request->size!=0){
request->buf = xbt_malloc(request->size);
memcpy(request->buf,oldbuf,request->size);
}
#include "private.h"
#include "smpi_mpi_dt_private.h"
#include "mc/mc.h"
+#include "xbt/replay.h"
#include "surf/surf.h"
#include "simix/smx_private.h"
#include "simgrid/sg_config.h"
void *buff, size_t buff_size)
{
XBT_DEBUG("Copy the data over");
+ if(_xbt_replay_is_active()) return;
memcpy(comm->comm.dst_buff, buff, buff_size);
if (comm->comm.detached) {
// if this is a detached send, the source buffer was duplicated by SMPI
#include "private.h"
#include "smpi_mpi_dt_private.h"
#include "mc/mc.h"
+#include "xbt/replay.h"
#include "simgrid/modelchecker.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_mpi_dt, smpi,
count = sendcount < recvcount ? sendcount : recvcount;
if(sendtype->has_subtype == 0 && recvtype->has_subtype == 0) {
- memcpy(recvbuf, sendbuf, count);
+ if(!_xbt_replay_is_active()) memcpy(recvbuf, sendbuf, count);
}
else if (sendtype->has_subtype == 0)
{
void smpi_op_apply(MPI_Op op, void *invec, void *inoutvec, int *len,
MPI_Datatype * datatype)
{
+ if(!_xbt_replay_is_active())
op->func(invec, inoutvec, len, datatype);
}
static char *action_line = NULL;
static size_t action_len = 0;
+int is_replay_active = 0 ;
+
static char **action_get_action(char *name);
static char *str_tolower (const char *str)
return ret;
}
+int _xbt_replay_is_active(void){
+ return is_replay_active;
+}
xbt_replay_reader_t xbt_replay_reader_new(const char *filename)
{
void _xbt_replay_action_init(void)
{
+ is_replay_active = 1;
action_funs = xbt_dict_new_homogeneous(NULL);
action_queues = xbt_dict_new_homogeneous(NULL);
}