if(!known)
dt_size_recv = smpi_datatype_size(recvtype);
if((smpi_comm_rank(comm)==root)){
- extra->recvcounts= xbt_malloc(size*sizeof(int));
+ extra->recvcounts= xbt_new(int,size);
for(i=0; i< size; i++)//copy data to avoid bad free
extra->recvcounts[i] = recvcounts[i]*dt_size_recv;
}
int dt_size_recv = 1;
if(!known)
dt_size_recv = smpi_datatype_size(recvtype);
- extra->recvcounts= xbt_malloc(size*sizeof(int));
+ extra->recvcounts= xbt_new(int, size);
for(i=0; i< size; i++)//copy data to avoid bad free
extra->recvcounts[i] = recvcounts[i]*dt_size_recv;
if(!known)
dt_size_send = smpi_datatype_size(sendtype);
if((smpi_comm_rank(comm)==root)){
- extra->sendcounts= xbt_malloc(size*sizeof(int));
+ extra->sendcounts= xbt_new(int, size);
for(i=0; i< size; i++)//copy data to avoid bad free
extra->sendcounts[i] = sendcounts[i]*dt_size_send;
}
if(!known)
dt_size_send = smpi_datatype_size(datatype);
extra->send_size = 0;
- extra->recvcounts= xbt_malloc(size*sizeof(int));
+ extra->recvcounts= xbt_new(int, size);
for(i=0; i< size; i++)//copy data to avoid bad free
extra->recvcounts[i] = recvcounts[i]*dt_size_send;
TRACE_smpi_collective_in(rank, -1, __FUNCTION__,extra);
if(!known)
dt_size_send = smpi_datatype_size(datatype);
extra->send_size = 0;
- extra->recvcounts= xbt_malloc(count*sizeof(int));
+ extra->recvcounts= xbt_new(int, count);
for(i=0; i< count; i++)//copy data to avoid bad free
extra->recvcounts[i] = recvcount*dt_size_send;
extra->type = TRACING_ALLTOALLV;
extra->send_size = 0;
extra->recv_size = 0;
- extra->recvcounts= xbt_malloc(size*sizeof(int));
- extra->sendcounts= xbt_malloc(size*sizeof(int));
+ extra->recvcounts= xbt_new(int, size);
+ extra->sendcounts= xbt_new(int, size);
int known=0;
extra->datatype1 = encode_datatype(sendtype, &known);
int dt_size_send = 1;
*flag=FALSE;
char* tmpvalue=(char*)xbt_dict_get_or_null(info->info_dict, key);
if(tmpvalue){
- memcpy(value,tmpvalue, (strlen(tmpvalue) + 1 < valuelen) ?
+ memcpy(value,tmpvalue, (strlen(tmpvalue) + 1 < static_cast<size_t>(valuelen)) ?
strlen(tmpvalue) + 1 : valuelen);
*flag=TRUE;
}
}
int PMPI_Info_get_valuelen( MPI_Info info, char *key, int *valuelen, int *flag){
- if (info == NULL || key == NULL || valuelen <0)
+ if (info == NULL || key == NULL || *valuelen <0)
return MPI_ERR_ARG;
*flag=FALSE;
char* tmpvalue=(char*)xbt_dict_get_or_null(info->info_dict, key);