return (flags_ & DT_FLAG_COMMITED);
}
+bool Datatype::is_basic()
+{
+ return (flags_ & DT_FLAG_BASIC);
+}
+
size_t Datatype::size(){
return size_;
}
int Datatype::pack(void* inbuf, int incount, void* outbuf, int outcount, int* position,MPI_Comm comm){
if (outcount - *position < incount*static_cast<int>(size_))
return MPI_ERR_BUFFER;
- Datatype::copy(inbuf, incount, this, static_cast<char*>(outbuf) + *position, outcount, MPI_CHAR);
+ Datatype::copy(inbuf == MPI_BOTTOM ? nullptr : inbuf, incount, this, static_cast<char*>(outbuf) + *position, outcount,
+ MPI_CHAR);
*position += incount * size_;
return MPI_SUCCESS;
}
if (not smpi_process()->replaying())
memcpy(recvbuf, sendbuf, count);
} else if (not(sendtype->flags() & DT_FLAG_DERIVED)) {
- recvtype->unserialize( sendbuf, recvbuf, recvcount/recvtype->size(), MPI_REPLACE);
+ recvtype->unserialize(sendbuf, recvbuf, count / recvtype->size(), MPI_REPLACE);
} else if (not(recvtype->flags() & DT_FLAG_DERIVED)) {
- sendtype->serialize(sendbuf, recvbuf, sendcount/sendtype->size());
+ sendtype->serialize(sendbuf, recvbuf, count / sendtype->size());
}else{
void * buf_tmp = xbt_malloc(count);