- if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
- return MPI_ERR_GROUP;
- } else {
- for (int i = 0; i < n; i++) {
- if(ranks1[i]==MPI_PROC_NULL){
- ranks2[i]=MPI_PROC_NULL;
- }else{
- simgrid::s4u::Actor* actor = group1->actor(ranks1[i]);
- ranks2[i] = group2->rank(actor);
- }
+ CHECK_GROUP(1, group1)
+ CHECK_GROUP(4, group2)
+ for (int i = 0; i < n; i++) {
+ if(ranks1[i]==MPI_PROC_NULL){
+ ranks2[i]=MPI_PROC_NULL;
+ }else{
+ simgrid::s4u::Actor* actor = group1->actor(ranks1[i]);
+ ranks2[i] = group2->rank(actor);