Boost logo

Boost Users :

Subject: [Boost-users] [mpi] - how to split communicator correctly?
From: tomasz jankowski (tomasz_jacek_at_[hidden])
Date: 2009-11-12 03:14:35


ello group,

i think I know how to split communicators & how it works in pure c mpi.
but I have problems with boost::mpi.

assume that we want divide world communicator into 3 groups.
please look here:

  mpi::environment env(argc, argv);
  mpi::communicator world;
  mpi::communicator elloa;
  mpi::communicator elloc;
  mpi::communicator ellob;

  if(world.rank() == 0){ elloa = world.split(0); }
  if(world.rank() == 1){ elloa = world.split(0); }
  if(world.rank() == 2){ elloa = world.split(0); }
  if(world.rank() == 3){ ellob = world.split(1); }
  if(world.rank() == 4){ ellob = world.split(1); }
  if(world.rank() == 5){ ellob = world.split(1); }
  if(world.rank() == 6){ elloc = world.split(2); }
  if(world.rank() == 7){ elloc = world.split(2); }

  if(world.rank() == 0){
    std::cout<<"elloa " << elloa.size()<<std::endl;
    std::cout<<"ellob " << ellob.size()<<std::endl;
    std::cout<<"elloc " << elloc.size()<<std::endl;
  }

the code above gives me such results:

elloa 3
ellob 8
elloc 8

my question is why ellob and alloc communicators counts 8 members not 3
and 2 respetively?

what I'm doing incorrect?

tom

----------------------------------------------------
Pudzian czy Najman?
Najdro¿sza walka w historii polskiego MMA
Polecam 12 edycjê Gali KSW!
Sprawd¼: http://klik.wp.pl/?adr=http%3A%2F%2Fcorto.www.wp.pl%2Fas%2F12konfrontacja.html&sid=910


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net