*ret = MPI_SUCCESS;
if(datatype->name_)
name_ = xbt_strdup(datatype->name_);
- if(!(datatype->attributes_.empty())){
+
+ if(!(datatype->attributes()->empty())){
int flag;
void* value_out;
- for(auto it = datatype->attributes_.begin(); it != datatype->attributes_.end(); it++){
+ for(auto it = datatype->attributes()->begin(); it != datatype->attributes()->end(); it++){
smpi_key_elem elem = keyvals_.at((*it).first);
if (elem != nullptr && elem->copy_fn.type_copy_fn != MPI_NULL_COPY_FN) {
}
if (flag){
elem->refcount++;
- attributes_.insert({(*it).first, value_out});
+ attributes()->insert({(*it).first, value_out});
}
}
}
return flags_;
}
+int Datatype::refcount(){
+ return refcount_;
+}
+
void Datatype::addflag(int flag){
flags_ &= flag;
}
}
int Datatype::unpack(void* inbuf, int insize, int* position, void* outbuf, int outcount,MPI_Comm comm){
- if (outcount*(int)size_> insize)
+ if (outcount*static_cast<int>(size_)> insize)
return MPI_ERR_BUFFER;
Datatype::copy(static_cast<char*>(inbuf) + *position, insize, MPI_CHAR, outbuf, outcount, this);
*position += outcount * size_;
void *recvbuf, int recvcount, MPI_Datatype recvtype){
int count;
if(smpi_privatize_global_variables){
- smpi_switch_data_segment(smpi_process_index());
+ smpi_switch_data_segment(smpi_process()->index());
}
/* First check if we really have something to do */
if (recvcount > 0 && recvbuf != sendbuf) {
count = sendcount < recvcount ? sendcount : recvcount;
if(!(sendtype->flags() & DT_FLAG_DERIVED) && !(recvtype->flags() & DT_FLAG_DERIVED)) {
- if(!smpi_process_get_replaying())
+ if(!smpi_process()->replaying())
memcpy(recvbuf, sendbuf, count);
}
else if (!(sendtype->flags() & DT_FLAG_DERIVED))