[mpich-discuss] Mapping process to specific node

Rajeev Thakur thakur at mcs.anl.gov
Fri Feb 3 14:43:51 CST 2012


What output do you get?

Rajeev

On Feb 3, 2012, at 2:31 PM, Fernando Luz wrote:

> 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
> _______________________________________________
> mpich-discuss mailing list     mpich-discuss at mcs.anl.gov
> To manage subscription options or unsubscribe:
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss



More information about the mpich-discuss mailing list