File: BI_TransUserComm.c

package info (click to toggle)
scalapack 2.2.2-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 37,724 kB
  • sloc: fortran: 339,123; ansic: 74,530; makefile: 1,494; sh: 33
file content (22 lines) | stat: -rw-r--r-- 491 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "Bdef.h"

MPI_Comm BI_TransUserComm(Int Ucomm, Int Np, Int *pmap)
{
   MPI_Comm bcomm, ucomm;
   MPI_Group bgrp, ugrp;
   Int i;

   MpiInt *mpmap = (MpiInt *)malloc(Np * sizeof(MpiInt));
   for (i=0; i<Np; i++) mpmap[i] = pmap[i];

   ucomm = MPI_Comm_f2c(Ucomm);
   i=MPI_Comm_group(ucomm, &ugrp);
   i=MPI_Group_incl(ugrp, Np, mpmap, &bgrp);
   i=MPI_Comm_create(ucomm, bgrp, &bcomm);
   i=MPI_Group_free(&ugrp);
   i=MPI_Group_free(&bgrp);

   free(mpmap);

   return(bcomm);
}