smpi_switch_data_segment(smpi_process()->index());
}
- if(!smpi_process()->replaying()){
+ if(!smpi_process()->replaying() && *len > 0){
if(! is_fortran_op_)
this->func_(invec, inoutvec, len, &datatype);
else{
if(((((flags & RECV) != 0) && ((flags & ACCUMULATE) !=0)) || (datatype->flags() & DT_FLAG_DERIVED)) && (!smpi_is_shared(buf_))){
// This part handles the problem of non-contiguous memory
old_buf = buf;
- buf_ = count==0 ? nullptr : xbt_malloc(count*datatype->size());
- if ((datatype->flags() & DT_FLAG_DERIVED) && ((flags & SEND) != 0)) {
- datatype->serialize(old_buf, buf_, count);
+ if (count==0){
+ buf_ = nullptr;
+ }else {
+ buf_ = xbt_malloc(count*datatype->size());
+ if ((datatype->flags() & DT_FLAG_DERIVED) && ((flags & SEND) != 0)) {
+ datatype->serialize(old_buf, buf_, count);
+ }
}
}
// This part handles the problem of non-contiguous memory (for the unserialisation at the reception)
static void run_test(int lock_mode, int lock_assert)
{
int nproc, test_iter, target_rank, data_size;
- int *buf, *win_buf;
+ char *buf, *win_buf;
MPI_Win win;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
t_acc = MPI_Wtime();
MPI_Win_lock(lock_mode, target_rank, lock_assert, win);
- MPI_Accumulate(buf, data_size / sizeof(int), MPI_INT, target_rank,
- 0, data_size / sizeof(int), MPI_INT, MPI_SUM, win);
+ MPI_Accumulate(buf, data_size, MPI_BYTE, target_rank,
+ 0, data_size, MPI_BYTE, MPI_SUM, win);
MPI_Win_unlock(target_rank, win);
}
t_acc = (MPI_Wtime() - t_acc) / num_iter;