running on gcb part1 n.
Download
Skip this Video
Download Presentation
Running on GCB part1

Loading in 2 Seconds...

play fullscreen
1 / 7

Running on GCB part1 - PowerPoint PPT Presentation


  • 81 Views
  • Uploaded on

Running on GCB part1. By: Camilo Silva. Simple steps to run MPI. Use putty or the terminal SSH to gcb.fiu.edu Loggin by providing your username and password. You are in!. You should have a screen similar to this one:. Time to program!. /*

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Running on GCB part1' - lani-wade


Download Now An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
running on gcb part1

Running on GCBpart1

By: Camilo Silva

simple steps to run mpi
Simple steps to run MPI
  • Use putty or the terminal
  • SSH to gcb.fiu.edu
  • Loggin by providing your username and password
you are in
You are in!
  • You should have a screen similar to this one:
time to program
Time to program!

/*

"Hello World" example for 2 processors. Initially, both processors have status "I am alone!". Each sends out a "Hello World" to the other. Upon receiving each other's message, the status changes to what is received.

*/

#include "mpi.h"

#include <stdio.h>

int main(int argc, char** argv)

{

int MyProc, tag=0;

char msg[12]="Hello World";

char msg_recpt[12]="I am alone!";

MPI_Status status;

MPI_Init(&argc, &argv);

MPI_Comm_rank(MPI_COMM_WORLD, &MyProc);

printf("Process# %d started \n", MyProc);

MPI_Barrier(MPI_COMM_WORLD);

if (MyProc== 0)

{

printf("Proc#0: %s \n", msg_recpt) ;

printf("Sendingmessage to Proc #1: %s \n", msg) ;

MPI_Send(&msg, 12, MPI_CHAR, 1, tag, MPI_COMM_WORLD);

MPI_Recv(&msg_recpt, 12, MPI_CHAR, 1, tag, MPI_COMM_WORLD, &status);

printf("Receivedmessage from Proc #1: %s \n", msg_recpt) ;

}

else

{

printf("Proc#1: %s \n", msg_recpt) ;

MPI_Recv(&msg_recpt, 12, MPI_CHAR, 0, tag, MPI_COMM_WORLD, &status);

printf("Receivedmessage from Proc #0: %s \n", msg_recpt) ;

printf("Sendingmessage to Proc #0: %s \n", msg) ;

MPI_Send(&msg, 12, MPI_CHAR, 0, tag, MPI_COMM_WORLD);

}

MPI_Finalize();

}

Using vi, pico, or nano, or your favorite text editor code the following program:

what next
What next?
  • Submit the following command in the terminal: PATH=/opt/mpich/gnu/bin:$PATH
  • That line will add mpich to your path
one last step
One last step…
  • Before compiling and running you must sent the following command:
    • [username~]$lamboot –v

Then, compile the program:

  • mpicc –o hello hello.c

Finally run it:

  • mpirun –v –np 2 hello

Check the man for details of the functions and parameters