A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove useless check for null before free.
[simgrid.git]
/
src
/
smpi
/
mpi
/
smpi_comm.cpp
diff --git
a/src/smpi/mpi/smpi_comm.cpp
b/src/smpi/mpi/smpi_comm.cpp
index
b50587d
..
2a80d4c
100644
(file)
--- a/
src/smpi/mpi/smpi_comm.cpp
+++ b/
src/smpi/mpi/smpi_comm.cpp
@@
-265,10
+265,8
@@
void Comm::cleanup_smp(){
Comm::unref(intra_comm_);
if (leaders_comm_ != MPI_COMM_NULL)
Comm::unref(leaders_comm_);
Comm::unref(intra_comm_);
if (leaders_comm_ != MPI_COMM_NULL)
Comm::unref(leaders_comm_);
- if (non_uniform_map_ != nullptr)
- xbt_free(non_uniform_map_);
- if (leaders_map_ != nullptr)
- delete[] leaders_map_;
+ xbt_free(non_uniform_map_);
+ delete[] leaders_map_;
}
void Comm::unref(Comm* comm){
}
void Comm::unref(Comm* comm){
@@
-370,7
+368,7
@@
void Comm::init_smp(){
if(MPI_COMM_WORLD!=MPI_COMM_UNINITIALIZED && this!=MPI_COMM_WORLD){
//create leader_communicator
for (i=0; i< leader_group_size;i++)
if(MPI_COMM_WORLD!=MPI_COMM_UNINITIALIZED && this!=MPI_COMM_WORLD){
//create leader_communicator
for (i=0; i< leader_group_size;i++)
- leaders_group->set_mapping(simgrid::s4u::Actor::by
P
id(leader_list[i]), i);
+ leaders_group->set_mapping(simgrid::s4u::Actor::by
_p
id(leader_list[i]), i);
leader_comm = new Comm(leaders_group, nullptr);
this->set_leaders_comm(leader_comm);
this->set_intra_comm(comm_intra);
leader_comm = new Comm(leaders_group, nullptr);
this->set_leaders_comm(leader_comm);
this->set_intra_comm(comm_intra);
@@
-378,7
+376,7
@@
void Comm::init_smp(){
// create intracommunicator
}else{
for (i=0; i< leader_group_size;i++)
// create intracommunicator
}else{
for (i=0; i< leader_group_size;i++)
- leaders_group->set_mapping(simgrid::s4u::Actor::by
P
id(leader_list[i]), i);
+ leaders_group->set_mapping(simgrid::s4u::Actor::by
_p
id(leader_list[i]), i);
if(this->get_leaders_comm()==MPI_COMM_NULL){
leader_comm = new Comm(leaders_group, nullptr);
if(this->get_leaders_comm()==MPI_COMM_NULL){
leader_comm = new Comm(leaders_group, nullptr);
@@
-491,6
+489,17
@@
void Comm::finish_rma_calls(){
}
}
}
}
+MPI_Comm Comm::split_type(int type, int key, MPI_Info info)
+{
+ if(type != MPI_COMM_TYPE_SHARED){
+ return MPI_COMM_NULL;
+ }
+ this->init_smp();
+ this->ref();
+ this->get_intra_comm()->ref();
+ return this->get_intra_comm();
+}
+
}
}
}
}