// PMPI_Init is call only one time by only by SMPI process
int already_init;
MPI_Initialized(&already_init);
- if(!(already_init)){
+ if(already_init == 0){
smpi_process_init(argc, argv);
smpi_process_mark_as_initialized();
int rank = smpi_process_index();
retval = MPI_ERR_ARG;
} else {
retval = smpi_comm_dup(comm, newcomm);
- if(retval==MPI_SUCCESS)
- smpi_group_use(smpi_comm_group(*newcomm));
}
return retval;
}
smpi_bench_end();
//save requests information for tracing
int i;
- int *srcs = xbt_new0(int, count);
- int *dsts = xbt_new0(int, count);
- int *recvs = xbt_new0(int, count);
- MPI_Comm *comms = xbt_new0(MPI_Comm, count);
-
+ int *srcs = NULL, *dsts = NULL, *recvs = NULL;
+ MPI_Comm* comms = NULL;
+ if(count>0){
+ srcs = xbt_new0(int, count);
+ dsts = xbt_new0(int, count);
+ recvs = xbt_new0(int, count);
+ comms = xbt_new0(MPI_Comm, count);
+ }
for (i = 0; i < count; i++) {
MPI_Request req = requests[i]; //already received requests are no longer valid
if (req) {
dt_size_send = smpi_datatype_size(datatype);
extra->send_size = count*dt_size_send;
TRACE_smpi_collective_in(rank, root_traced, __FUNCTION__, extra);
-
+ if(smpi_comm_size(comm)>1)
mpi_coll_bcast_fun(buf, count, datatype, root, comm);
- retval = MPI_SUCCESS;
+ retval = MPI_SUCCESS;
- TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
+ TRACE_smpi_collective_out(rank, root_traced, __FUNCTION__);
}
smpi_bench_begin();
retval = MPI_ERR_WIN;
}else {
smpi_mpi_win_get_group(win, group);
+ smpi_group_use(*group);
}
return retval;
}
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;
}
return MPI_ERR_ARG;
*newinfo = xbt_new(s_smpi_mpi_info_t, 1);
(*newinfo)->info_dict= xbt_dict_new_homogeneous(NULL);
+ (*newinfo)->refcount=1;
xbt_dict_cursor_t cursor = NULL;
int *key;
void* data;
int num=0;
xbt_dict_foreach(info->info_dict,cursor,keyn,data){
if(num==n){
- strcpy(key,keyn);
+ strcpy(key,keyn);
+ xbt_dict_cursor_free(&cursor);
return MPI_SUCCESS;
}
num++;