Thought of the day!!

FAIL is like a steps ,PASS is Like a Lift ,a lift may fail sometimes But, steps will always get u 2 top....!!!
----------------------------------------"A.P.J Abdul Kalam"

Search now!!

Sunday, August 14, 2011

MPICH2 Configuration in UBUNTU 10.10 Meveric Meerkat


Step 1: Go to System->About Ubuntu check the version, whether it is mentioned above or not??

Step 2:
Go to the following link and download the MPICH2 package

change user to root or user super user privilege on every command

sudo -i


cd to the package location :
#cd /location

Then uncompress the package
# tar xzvf filename.tar.gz

go to the 'package root' :
# cd filename

then configure environment
#./configure
 If you are getting the error regarding the gcc compiler or c++ compiler then write following command in terminal
sudo apt-get install build-essential

compile the package
# make


install the compiled package
#make install

Another small thing to do to start the mpich2 daemon:


then, make the user specific configuration file:
cd $HOME
touch .mpd.conf
chmod 600 .mpd.conf
gedit .mpd.conf

add the following line to the newly created .mpd.conf file

MPD_SECRETWORD=secret

now do the following steps

type the command mpd or mpd &
now create the example file to run

#include
#include "mpi.h"


int main(int argc,char** argv)
{
int p_id,size;
MPI_Init(&argc,&argv);
MPI_Comm_rank(MPI_COMM_WORLD,&p_id);
MPI_Comm_size(MPI_COMM_WORLD,&size);
printf("Hello from prpcess %d of %d \n",p_id,size);
MPI_Finalize();
return 0;
}




save this in a 'hpc.c' file.

compile the application

mpicc hpc.c -o hello

change access to executable of the output file

chmod +x ./hello

run the application

mpirun -np 4 ./hello

Ads

Popular Posts