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
address FIXME and kill useless code
[simgrid.git]
/
src
/
smpi
/
mpi
/
smpi_group.cpp
diff --git
a/src/smpi/mpi/smpi_group.cpp
b/src/smpi/mpi/smpi_group.cpp
index
2128c4c
..
12c412c
100644
(file)
--- a/
src/smpi/mpi/smpi_group.cpp
+++ b/
src/smpi/mpi/smpi_group.cpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2010-201
7
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2010-201
8
. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
@@
-25,18
+25,16
@@
Group::Group()
refcount_ = 1; /* refcount_: start > 0 so that this group never gets freed */
}
refcount_ = 1; /* refcount_: start > 0 so that this group never gets freed */
}
-Group::Group(int n) : size_(n), rank_to_actor_map_(size_, nullptr)
, rank_to_index_map_(size_, MPI_UNDEFINED), index_to_rank_map_(size_, MPI_UNDEFINED)
+Group::Group(int n) : size_(n), rank_to_actor_map_(size_, nullptr)
{
refcount_ = 1;
}
{
refcount_ = 1;
}
-Group::Group(
MPI_Group
origin)
+Group::Group(
Group*
origin)
{
if (origin != MPI_GROUP_NULL && origin != MPI_GROUP_EMPTY) {
size_ = origin->size();
refcount_ = 1;
{
if (origin != MPI_GROUP_NULL && origin != MPI_GROUP_EMPTY) {
size_ = origin->size();
refcount_ = 1;
- rank_to_index_map_ = origin->rank_to_index_map_;
- index_to_rank_map_ = origin->index_to_rank_map_;
rank_to_actor_map_ = origin->rank_to_actor_map_;
actor_to_rank_map_ = origin->actor_to_rank_map_;
}
rank_to_actor_map_ = origin->rank_to_actor_map_;
actor_to_rank_map_ = origin->actor_to_rank_map_;
}
@@
-45,13
+43,7
@@
Group::Group(MPI_Group origin)
void Group::set_mapping(simgrid::s4u::ActorPtr actor, int rank)
{
if (0 <= rank && rank < size_) {
void Group::set_mapping(simgrid::s4u::ActorPtr actor, int rank)
{
if (0 <= rank && rank < size_) {
- int index = actor->getPid();
- rank_to_index_map_[rank] = index;
- if (index != MPI_UNDEFINED) {
- if ((unsigned)index >= index_to_rank_map_.size())
- index_to_rank_map_.resize(index + 1, MPI_UNDEFINED);
- index_to_rank_map_[index] = rank;
- }
+ int index = actor->get_pid();
rank_to_actor_map_[rank] = actor;
if (actor != nullptr) {
rank_to_actor_map_[rank] = actor;
if (actor != nullptr) {
@@
-60,17
+52,6
@@
void Group::set_mapping(simgrid::s4u::ActorPtr actor, int rank)
}
}
}
}
-int Group::rank(int index)
-{
- int rank;
- if (0 <= index && (unsigned)index < index_to_rank_map_.size())
- rank = index_to_rank_map_[index];
- else
- rank = MPI_UNDEFINED;
-
- return rank;
-}
-
simgrid::s4u::ActorPtr Group::actor(int rank) {
if (0 <= rank && rank < size_)
return rank_to_actor_map_[rank];
simgrid::s4u::ActorPtr Group::actor(int rank) {
if (0 <= rank && rank < size_)
return rank_to_actor_map_[rank];