From 198a6259727de39df5bb03861f67cb88f9a84373 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Mon, 8 Jul 2013 14:33:21 +0200 Subject: [PATCH 1/1] MPI_Translate_ranks should return MPI_PROC_NULL if we provide MPI_PROC_NULL as parameter --- src/smpi/smpi_pmpi.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/smpi/smpi_pmpi.c b/src/smpi/smpi_pmpi.c index e79d12669a..1c12d353be 100644 --- a/src/smpi/smpi_pmpi.c +++ b/src/smpi/smpi_pmpi.c @@ -350,14 +350,17 @@ int PMPI_Group_translate_ranks(MPI_Group group1, int n, int *ranks1, MPI_Group group2, int *ranks2) { int retval, i, index; - smpi_bench_end(); if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) { retval = MPI_ERR_GROUP; } else { for (i = 0; i < n; i++) { - index = smpi_group_index(group1, ranks1[i]); - ranks2[i] = smpi_group_rank(group2, index); + if(ranks1[i]==MPI_PROC_NULL){ + ranks2[i]=MPI_PROC_NULL; + }else{ + index = smpi_group_index(group1, ranks1[i]); + ranks2[i] = smpi_group_rank(group2, index); + } } retval = MPI_SUCCESS; } -- 2.20.1