2. To develop any distributed application using Message Passing Interface (MPI).

Download 

mpj-v0_44.tar.gz

MPIDemo.java
 

import mpi.*;
public class MPIDemo
{
public static void main(String[] args) throws Exception
{
MPI.Init(args);
int rank=MPI.COMM_WORLD.Rank();
int size=MPI.COMM_WORLD.Size();
System.out.println("Hi, I am process"+rank+" And My Size is"+size);
MPI.Finalize();
}
}


output

swlab2@swlab2-ThinkCentre-M70e:~/MPI$ export MPJ_HOME=/home/swlab2/MPI/mpj-v0_44
swlab2@swlab2-ThinkCentre-M70e:~/MPI$ javac -cp /home/swlab2/MPI/mpj-v0_44/lib/mpj.jar MPIDemo.java
swlab2@swlab2-ThinkCentre-M70e:~/MPI$ /home/swlab2/MPI/mpj-v0_44/bin/mpjrun.sh -np 4 MPIDemo
MPJ Express (0.44) is started in the multicore configuration
Hi, I am process3 And My Size is4
Hi, I am process2 And My Size is4
Hi, I am process1 And My Size is4
Hi, I am process0 And My Size is4

Comments

Popular posts from this blog

1. To develop any distributed application through implementing client-server communication programs based on Java Sockets and RMI techniques.