Fixes lots of Petsc tests, especially vec/is/sf/tests/ex14.c.
The buffer was lost after the first communication, and no more data could
be transfered effectively.
Request::Request(const void* buf, int count, MPI_Datatype datatype, aid_t src, aid_t dst, int tag, MPI_Comm comm,
unsigned flags, MPI_Op op)
: buf_(const_cast<void*>(buf))
Request::Request(const void* buf, int count, MPI_Datatype datatype, aid_t src, aid_t dst, int tag, MPI_Comm comm,
unsigned flags, MPI_Op op)
: buf_(const_cast<void*>(buf))
, type_(datatype)
, size_(datatype->size() * count)
, src_(src)
, type_(datatype)
, size_(datatype->size() * count)
, src_(src)
}
void Request::init_buffer(int count){
}
void Request::init_buffer(int count){
- void *old_buf = nullptr;
// FIXME Handle the case of a partial shared malloc.
// This part handles the problem of non-contiguous memory (for the unserialization at the reception)
if ((((flags_ & MPI_REQ_RECV) != 0) && ((flags_ & MPI_REQ_ACCUMULATE) != 0)) || (type_->flags() & DT_FLAG_DERIVED)) {
// This part handles the problem of non-contiguous memory
// FIXME Handle the case of a partial shared malloc.
// This part handles the problem of non-contiguous memory (for the unserialization at the reception)
if ((((flags_ & MPI_REQ_RECV) != 0) && ((flags_ & MPI_REQ_ACCUMULATE) != 0)) || (type_->flags() & DT_FLAG_DERIVED)) {
// This part handles the problem of non-contiguous memory
if (count==0){
buf_ = nullptr;
}else {
buf_ = xbt_malloc(count*type_->size());
if ((type_->flags() & DT_FLAG_DERIVED) && ((flags_ & MPI_REQ_SEND) != 0)) {
if (count==0){
buf_ = nullptr;
}else {
buf_ = xbt_malloc(count*type_->size());
if ((type_->flags() & DT_FLAG_DERIVED) && ((flags_ & MPI_REQ_SEND) != 0)) {
- type_->serialize(old_buf, buf_, count);
+ type_->serialize(old_buf_, buf_, count);
}
bool Request::match_recv(void* a, void* b, simgrid::kernel::activity::CommImpl*)
}
bool Request::match_recv(void* a, void* b, simgrid::kernel::activity::CommImpl*)