[mpich-discuss] Mapping process to specific node

Fernando Luz fernando_luz at tpn.usp.br
Fri Feb 3 14:31:50 CST 2012


Hello,

I create the follow program:

=========================================================
#include "mpi.h"
# include <cstdlib>
# include <iostream>
# include <iomanip>
# include <ctime>


int main ( int argc, char *argv[] )
{
  int rank;
  int size;
  char hostname[255];
  int size_hostname;
  double wtime;

  MPI::Init ( argc, argv );
  size = MPI::COMM_WORLD.Get_size();
  rank = MPI::COMM_WORLD.Get_rank();
  MPI::Get_processor_name(hostname, size_hostname);
  
  if ( rank == 0 ){
    std::cout << "  print size = " << size << std::endl;
  }

  std::cout << "I am rank=" << rank << " and my hostname=" << hostname
<< std::endl;
  
  MPI::Finalize();

  return 0;
}
=========================================================

In my execution test, I was planned run this program using this
command-line

$ mpiexec -n 10 -f host.txt ./hostname_test

and the host.txt
========================================================
machine01  # rank 0 run in machine01
machine02  # rank 1 run in machine02
machine03  # rank 2 run in machine03
machine03  # rank 3 run in machine03
machine02  # rank 4 run in machine02
machine03  # rank 5 run in machine03
machine01  # rank 6 run in machine01
machine01  # rank 7 run in machine01
machine03  # rank 8 run in machine03
machine01  # rank 9 run in machine01
========================================================

But I don't have success. 

It's possible to select a process to run in a specific node?

Regards

Fernando Luz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20120203/a7f7a924/attachment.htm>


More information about the mpich-discuss mailing list