send_chunk = smpi_datatype_get_extent(send_type);
recv_chunk = smpi_datatype_get_extent(recv_type);
- win=new simgrid::smpi::Win(recv_buff, num_procs * recv_chunk * send_count, recv_chunk, 0,
+ win=new Win(recv_buff, num_procs * recv_chunk * send_count, recv_chunk, 0,
comm);
send_chunk *= send_count;
recv_chunk *= recv_count;
int comm_keyval_id = 0;//avoid collisions
-simgrid::smpi::Comm mpi_MPI_COMM_UNINITIALIZED;
+ Comm mpi_MPI_COMM_UNINITIALIZED;
MPI_Comm MPI_COMM_UNINITIALIZED=&mpi_MPI_COMM_UNINITIALIZED;
/* Support for cartesian topology was added, but there are 2 other types of topology, graph et dist graph. In order to
if(smpi_privatize_global_variables){ //we need to switch as the called function may silently touch global variables
smpi_switch_data_segment(smpi_process_index());
}
- MPI_Group cp = new simgrid::smpi::Group(this->group());
- (*newcomm) = new simgrid::smpi::Comm(cp, this->topo());
+ MPI_Group cp = new Group(this->group());
+ (*newcomm) = new Comm(cp, this->topo());
int ret = MPI_SUCCESS;
if(attributes_ !=nullptr){
rankmap[2 * count + 1] = recvbuf[2 * i + 1];
count++;
qsort(rankmap, count, 2 * sizeof(int), &smpi_compare_rankmap);
- group_out = new simgrid::smpi::Group(count);
+ group_out = new Group(count);
if (i == 0) {
group_root = group_out; /* Save root's group */
}
int reqs = 0;
for (int j = 0; j < count; j++) {
if(rankmap[2 * j] != 0) {
- group_snd[reqs]=new simgrid::smpi::Group(group_out);
+ group_snd[reqs]=new Group(group_out);
requests[reqs] = Request::isend(&(group_snd[reqs]), 1, MPI_PTR, rankmap[2 * j], system_tag, this);
reqs++;
}
Request::recv(&group_out, 1, MPI_PTR, 0, system_tag, this, MPI_STATUS_IGNORE);
} /* otherwise, exit with group_out == nullptr */
}
- return group_out!=nullptr ? new simgrid::smpi::Comm(group_out, nullptr) : MPI_COMM_NULL;
+ return group_out!=nullptr ? new Comm(group_out, nullptr) : MPI_COMM_NULL;
}
void Comm::use(){
}
}
XBT_DEBUG("number of processes deployed on my node : %d", intra_comm_size);
- MPI_Group group_intra = new simgrid::smpi::Group(intra_comm_size);
+ MPI_Group group_intra = new Group(intra_comm_size);
i=0;
process = nullptr;
xbt_swag_foreach(process, process_list) {
}
}
- MPI_Comm comm_intra = new simgrid::smpi::Comm(group_intra, nullptr);
+ MPI_Comm comm_intra = new Comm(group_intra, nullptr);
leader=min_index;
int * leaders_map= static_cast<int*>(xbt_malloc0(sizeof(int)*comm_size));
}
qsort(leader_list, leader_group_size, sizeof(int),compare_ints);
- MPI_Group leaders_group = new simgrid::smpi::Group(leader_group_size);
+ MPI_Group leaders_group = new Group(leader_group_size);
MPI_Comm leader_comm = MPI_COMM_NULL;
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(leader_list[i], i);
- leader_comm = new simgrid::smpi::Comm(leaders_group, nullptr);
+ leader_comm = new Comm(leaders_group, nullptr);
this->set_leaders_comm(leader_comm);
this->set_intra_comm(comm_intra);
leaders_group->set_mapping(leader_list[i], i);
if(this->get_leaders_comm()==MPI_COMM_NULL){
- leader_comm = new simgrid::smpi::Comm(leaders_group, nullptr);
+ leader_comm = new Comm(leaders_group, nullptr);
this->set_leaders_comm(leader_comm);
}else{
leader_comm=this->get_leaders_comm();
xbt_assert(instance, "Error, unknown instance %s", instance_id);
if(instance->comm_world == MPI_COMM_NULL){
- MPI_Group group = new simgrid::smpi::Group(instance->size);
- instance->comm_world = new simgrid::smpi::Comm(group, nullptr);
+ MPI_Group group = new Group(instance->size);
+ instance->comm_world = new Comm(group, nullptr);
}
instance->present_processes++;
index_to_process_data[index]=instance->index+rank;
{
smpi_process_data_t data = smpi_process_data();
if(data->comm_self==MPI_COMM_NULL){
- MPI_Group group = new simgrid::smpi::Group(1);
- data->comm_self = new simgrid::smpi::Comm(group, nullptr);
+ MPI_Group group = new Group(1);
+ data->comm_self = new Comm(group, nullptr);
group->set_mapping(smpi_process_index(), 0);
}
//if the process was launched through smpirun script we generate a global mpi_comm_world
//if not, we let MPI_COMM_NULL, and the comm world will be private to each mpi instance
if(smpirun){
- group = new simgrid::smpi::Group(process_count);
- MPI_COMM_WORLD = new simgrid::smpi::Comm(group, nullptr);
+ group = new Group(process_count);
+ MPI_COMM_WORLD = new Comm(group, nullptr);
MPI_Attr_put(MPI_COMM_WORLD, MPI_UNIVERSE_SIZE, reinterpret_cast<void *>(process_count));
msg_bar_t bar = MSG_barrier_init(process_count);
#include "private.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_group, smpi, "Logging specific to SMPI (group)");
-simgrid::smpi::Group mpi_MPI_GROUP_EMPTY;
+ Group mpi_MPI_GROUP_EMPTY;
MPI_Group MPI_GROUP_EMPTY=&mpi_MPI_GROUP_EMPTY;
namespace simgrid{
if (size1 == 0) {
*newgroup = MPI_GROUP_EMPTY;
} else {
- *newgroup = new simgrid::smpi::Group(size1);
+ *newgroup = new Group(size1);
size2 = this->size();
for (int i = 0; i < size2; i++) {
int proc1 = this->index(i);
if (size2 == 0) {
*newgroup = MPI_GROUP_EMPTY;
} else {
- *newgroup = new simgrid::smpi::Group(size2);
+ *newgroup = new Group(size2);
int j=0;
for (int i = 0; i < group2->size(); i++) {
int proc2 = group2->index(i);
if (newsize == 0) {
*newgroup = MPI_GROUP_EMPTY;
} else {
- *newgroup = new simgrid::smpi::Group(newsize);
+ *newgroup = new Group(newsize);
for (int i = 0; i < size2; i++) {
int proc1 = this->index(i);
int proc2 = group2->rank(proc1);
int Group::excl(int n, int *ranks, MPI_Group * newgroup){
int oldsize = size_;
int newsize = oldsize - n;
- *newgroup = new simgrid::smpi::Group(newsize);
+ *newgroup = new Group(newsize);
int* to_exclude=xbt_new0(int, size_);
for (int i = 0; i < oldsize; i++)
to_exclude[i]=0;
}
}
}
- *newgroup = new simgrid::smpi::Group(newsize);
+ *newgroup = new Group(newsize);
int j = 0;
for (int i = 0; i < n; i++) {
for (int rank = ranges[i][0]; /* First */
if (newsize == 0) {
*newgroup = MPI_GROUP_EMPTY;
} else {
- *newgroup = new simgrid::smpi::Group(newsize);
+ *newgroup = new Group(newsize);
int newrank = 0;
int oldrank = 0;
while (newrank < newsize) {
return;
}
oldGroup = comm_old->group();
- newGroup = new simgrid::smpi::Group(newSize);
+ newGroup = new Group(newSize);
for (int i = 0 ; i < newSize ; i++) {
newGroup->set_mapping(oldGroup->index(i), i);
}
rank = rank % nranks;
}
- *comm_cart = new simgrid::smpi::Comm(newGroup, this);
+ *comm_cart = new Comm(newGroup, this);
} else {
if (rank == 0) {
- *comm_cart = new simgrid::smpi::Comm(new simgrid::smpi::Group(MPI_COMM_SELF->group()), this);
+ *comm_cart = new Comm(new Group(MPI_COMM_SELF->group()), this);
} else {
*comm_cart = MPI_COMM_NULL;
}