Testing MPI on Linux Mint Machines in FH

From dftwiki3
Revision as of 12:21, 15 May 2014 by Thiebaut (talk | contribs) (Created page with "--~~~~ ---- =MPI Hosts= <onlysmith> * MPI Machines are in FH342 * 131.229.103.188 (345-02) * 131.229.101.176 (345-07) * 131.229.102.142 (345-08) </onlysmith> =Test #1= * Log...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

--D. Thiebaut (talk) 13:21, 15 May 2014 (EDT)


MPI Hosts


This section is only visible to computers located at Smith College

Test #1

  • Login for FH345-02
cat > helloWorld.c
/* C Example */
#include <stdio.h>
#include <mpi.h>


int main ( int argc, char *argv[] ) {
 int rank, size;

 MPI_Init (&argc, &argv);      /* starts MPI */
 MPI_Comm_rank (MPI_COMM_WORLD, &rank);        /* get current process id */
 MPI_Comm_size (MPI_COMM_WORLD, &size);        /* get number of processes */
 printf( "Hello world from process %d of %d\n", rank, size );
 MPI_Finalize();
 return 0;
}
[13:14:50] ~/mpi$: mpicc -o hello2 helloWorld.c
[13:16:15] ~/mpi$: mpiexec -np 2 -host localhost  ./hello2 
Hello world from process 0 of 2
Hello world from process 1 of 2