void **tmpbufs;
char* sendtmpbuf = (char*) sendbuf;
- if( sendbuf == MPI_IN_PLACE ) {
- sendtmpbuf = (char *)smpi_get_tmp_sendbuffer(count*smpi_datatype_get_extent(datatype));
- smpi_datatype_copy(recvbuf, count, datatype,sendtmpbuf, count, datatype);
- }
+
rank = smpi_comm_rank(comm);
size = smpi_comm_size(comm);
smpi_coll_tuned_reduce_ompi_basic_linear(sendtmpbuf, recvbuf, count, datatype, op, root, comm);
return;
}
+
+ if( sendbuf == MPI_IN_PLACE ) {
+ sendtmpbuf = (char *)smpi_get_tmp_sendbuffer(count*smpi_datatype_get_extent(datatype));
+ smpi_datatype_copy(recvbuf, count, datatype,sendtmpbuf, count, datatype);
+ }
if(rank != root) {
// Send buffer to root
if(elem && elem->delete_fn)
elem->delete_fn(comm, *key, value, &flag);
}
+ xbt_dict_free(&comm->attributes);
}
}
tkey[keylen]='\0';
*ierr = MPI_Info_get(smpi_info_f2c(*info),tkey,*valuelen, value, flag);
xbt_free(tkey);
- int i = 0;
- for (i=strlen(value); i<*valuelen; i++)
- value[i]=' ';
+ if(*flag==true){
+ int replace=0, i=0;
+ for (i=0; i<*valuelen; i++){
+ if(value[i]=='\0')
+ replace=1;
+ if(replace)
+ value[i]=' ';
+ }
+ }
}
void mpi_info_free_(int* info, int* ierr){
return MPI_ERR_INFO_VALUE;
char* tmpvalue=(char*)xbt_dict_get_or_null(info->info_dict, key);
if(tmpvalue){
+ memset(value, 0, valuelen);
memcpy(value,tmpvalue, (strlen(tmpvalue) + 1 < static_cast<size_t>(valuelen)) ? strlen(tmpvalue) + 1 : valuelen);
*flag=true;
}