X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/86ad7bacaf8c0b206a62bf87193ca6800006a854..c897fb0d193bbe081581d7ea7f579f04df1b5b5d:/src/smpi/mpi/smpi_group.cpp diff --git a/src/smpi/mpi/smpi_group.cpp b/src/smpi/mpi/smpi_group.cpp index 89abd06941..bce418b066 100644 --- a/src/smpi/mpi/smpi_group.cpp +++ b/src/smpi/mpi/smpi_group.cpp @@ -73,10 +73,11 @@ int Group::rank(int index) { if (this == MPI_GROUP_EMPTY) return MPI_UNDEFINED; - if (index_to_rank_map_.find(index) == index_to_rank_map_.end()) - return MPI_UNDEFINED; - else + try { return index_to_rank_map_.at(index); + } catch (std::out_of_range& unfound) { + return MPI_UNDEFINED; + } } void Group::ref()