Platform for Assignment

For assignments in this class, you will be using SERC's Tesla Cluster.

http://www.serc.iisc.ernet.in/ComputingFacilities/systems/Tesla_Cluster.htm

Follow the following steps:

Create .cshrc in your home directory with the following lines:

####
set path = (. /bin /usr/bin /usr/sbin /usr/local/bin)
set path = ($path /usr/pbs/default/bin /usr/pbs/default/sbin)
setenv PATH /usr/share/mpich2/bin64:$PATH
####

Then do:
source .cshrc
in your command line.

------------------

Use following commands given for password-less management:
$cd $HOME
$ssh-keygen -t rsa -N "" -f $HOME/.ssh/id_rsa
$cd .ssh
$touch authorized_keys
$cat id_rsa.pub >> authorized_keys
$chmod 600 authorized_keys

------------------

To use MPI:

Run the following commands given in
http://www.serc.iisc.ernet.in/ComputingFacilities/software/MPICH2.htm
for MPI setup:
$echo "secretword=ASecretWord" > ~/.mpd.conf
(where ASecretWord can be your choice of string)
$chmod 600 .mpd.conf
$mpd &
(before this last step, make sure you don't have any other mpd process running with your username.
i.e., no need to run multiple mpd daemons. one is enough per user)

First MPI program
-----------------

1. copy /home/staff/sec/secvss/tesla-cluster to your directory.
This contains a simple MPI program, a Makefile, and a submission script for
submitting to 12 cpus
2. Do
$ make
3. Edit last line of submission script. Specifically change
"/home/staff/sec/secvss/tesla-cluster/test-mpi" to
<your directory>/test-mpi
where your directory is the name of your directory containing test-mpi.c
4. Submit to PBS using
$qsub samplescript.12
5. Monitor your submitted job using
$qstat
6. After your program finishes, you will see 2 new files in your directory corresponding
to error and output of your program.
7. For running with 8 or 4 cpus, replace all occurrences of "12" with "8" or "4" in samplescript.12

Happy MPI!

First OpenMP program
------------------------

Add the following lines to your .cshrc in your home directory:
# for tesla and openmp
#C/C++ Compiler
source /opt/intel/Compiler/11.1/046/bin/intel64/iccvars_intel64.csh
#Fortran Compiler
source /opt/intel/Compiler/11.1/046/bin/intel64/ifortvars_intel64.csh

Then do:
source .cshrc
in your command line.

1. copy /home/staff/sec/secvss/tesla-cluster/openmp-test to your directory.
This contains a simple OpenMP program, a Makefile, and a submission script for
submitting to 12 cpus
2. Do
$ make
3. Edit last line of submission script. Specifically change
"/home/staff/sec/secvss/tesla-cluster/openmp-test/test-openmp" to
<your directory>/test-openmp
where your directory is the name of your directory containing test-openmp.c
4. Submit to PBS using
$qsub samplescript.12
5. Monitor your submitted job using
$qstat
6. After your program finishes, you will see 2 new files in your directory corresponding
to error and output of your program.

Happy OpenMP!

First GPU program
-------------------

Add the following lines to your .cshrc in your home directory:
# for tesla and cuda
setenv CUDA_INSTALL_PATH /usr/local/cuda
set path=($path /usr/local/cuda/bin)
setenv LD_LIBRARY_PATH /usr/local/cuda/lib64
set LD_LIBRARY_PATH=($LD_LIBRARY_PATH /usr/local/cuda/lib)

Then do:
source .cshrc
in your command line.

1. copy /home/staff/sec/secvss/tesla-cluster/cuda-test to your directory.
This contains a simple CUDA program (the .cu file), a Makefile, and a submission script
The program reverses an array of size 256 using 256 GPU threads.
2. Do
$ make
3. Edit last line of submission script. Specifically change
"/home/staff/sec/secvss/tesla-cluster/cuda-test/test-cuda" to
<your directory>/test-cuda
where your directory is the name of your directory containing test-cuda.c
4. Submit to PBS using
$qsub samplescript
5. Monitor your submitted job using
$qstat
6. After your program finishes, you will see 2 new files in your directory corresponding
to error and output of your program.
7. In your output file, you should see "Correct!"

Happy CUDA!