Experiencing Cluster Computing Case Studies Class 8
Case Studies Class 8 Experiencing Cluster Computing
I Description Download the source from http://www.sci.hkbu.eduhk/tdac/tutorial/expcluster Comp/casestudy/casestudy. zip Unzip the package Follow the instructions from each example
Description • Download the source from http://www.sci.hkbu.edu.hk/tdgc/tutorial/ExpCluster Comp/casestudy/casestudy.zip • Unzip the package • Follow the instructions from each example
Hello world
Hello World
Hello World The sample program uses MPI and has each MPI process print Hello world from process i of n using the rank in MPI COMM WORLD for i and the size of mpi comm world for n you can assume that all processes support output for this example Note the order that the output appears in. Depending on your MPI implementation, characters from different lines may be intermixed. A subsequent exercise(7O master/slaves)will show how to order the output You may want to use these mpi routines in your solution MPI Init. MPI Comm size. MPI Comm rank, MPI Finalize
Hello World • The sample program uses MPI and has each MPI process print Hello world from process i of n • using the rank in MPI_COMM_WORLD for i and the size of MPI_COMM_WORLD for n. You can assume that all processes support output for this example. • Note the order that the output appears in. Depending on your MPI implementation, characters from different lines may be intermixed. A subsequent exercise (I/O master/slaves) will show how to order the output. • You may want to use these MPI routines in your solution: MPI_Init, MPI_Comm_size, MPI_Comm_rank, MPI_Finalize
Hello World Source casestudy/helloworld/helloworld.c casestudy/helloworld/Makefile Compile and run 8 picc -o helloworldhelloworld.c 8 mpirun -np 4 helloworld Sample output Hello world from process 0 of 4 Hello world from process 3 of 4 Hello world from process 1 of 4 Hello world from process 2 of 4
Hello World Source casestudy/helloworld/helloworld.c casestudy/helloworld/Makefile Compile and run % mpicc -o helloworld helloworld.c % mpirun -np 4 helloworld Sample output Hello world from process 0 of 4 Hello world from process 3 of 4 Hello world from process 1 of 4 Hello world from process 2 of 4