Monday, December 02, 2013

Hands-on Lab Session 1

The purpose of the exercise is to get feeling with a parallel environemnt for Cluster Linux systems. Learning how a such software environment works. It is propaedeutic to the next labs which have the goal to teach how to install and efficiently setup a similar system.

The main difficuties of the exercise is the implementation of the submission scripts for running serial and parallel codes on the Java2 Linux Cluster (Java2 is host name of LIPI's cluster). The script must be implemnted and submitted for execution through the resource manager how presented during class. See elcture's slide for syntax details. Running the different code version and analyzing the obtained data output you are expected to reckon the performance improvement abtained while running in parallel.

A serial and a parallel code evolving the motion equation :

d/dx + d/dy = -d/dt,

are provide in both Fortran and Cversions (pick the one you like)

Temperature values are calculated over a grid and initialized with a Gaussin distribution. The points of the grid represent the local indexes (ix, iy) of the matrix that contains the temperature values. The domain is shown in orange in the picture below. Boundaries are represented in white. Data are evolved along Y=X direction, i.e. towards the up-right corner of the coordinate system.

Latihan

Download source code fortran-nya :
Download Lab-Day1.tar.gz dari http://nexus.lipi.go.id/lectures/day1/ ke folder lokal, misal folder Unduhan.
Dari folder lokal, copy ke master node
[igos@term-119 ~/Unduhan]$ scp -r Lab-Day1.tar.gz hpc07@192.168.222.2:/home/hpc07

[igos@term-119 ~]$ ssh -X hpc07@192.168.222.2
hpc07@192.168.222.2's password:
Permission denied, please try again.
hpc07@192.168.222.2's password:
Last login: Mon Dec  2 16:12:05 2013 from 192.168.228.211

Ekstrak file Lab-Day1.tar.gz
[hpc07@java2 ~]$ tar xvfz Lab-Day1.tar.gz

Compile
[hpc07@java2 Fortran_source]$ make
mpif90 -O3 -cpp -o transport_parallel.x transport_parallel.f90
make: mpif90: Command not found
make: *** [transport_parallel.x] Error 127

Pesan kesalahan mengatakan bahwa modul openmpi belum diaktifkan

Jalankan modul openmpi :
[hpc07@java2 Fortran_source]$ module load openmpi/1.6.5
[hpc07@java2 Fortran_source]$ module list
Currently Loaded Modulefiles:
  1) openmpi/1.6.5

Compile file transport_parallel.f90 dan file transport_serial.f90
[hpc07@java2 Fortran_source]$ make
mpif90 -O3 -cpp -o transport_parallel.x transport_parallel.f90
/tmp/cci6DcL0.o: In function `MAIN__':
transport_parallel.f90:(.text+0x5be): undefined reference to `update_boundaries_flat_'
transport_parallel.f90:(.text+0x641): undefined reference to `update_boundaries_flat_'
collect2: ld returned 1 exit status
make: *** [transport_parallel.x] Error 1

Ada kesalahan pada file fortrannya. Coba download file transport_parallel.f90 yang lain. Sebelumnya copy file lama ke transport_parallel.f90.old
[hpc07@java2 Fortran_source]$ cp transport_parallel.f90 transport_parallel.f90.old

Salin file transport_parallel.f90 yang bener
[hpc07@java2 Fortran_source]$ cp /tmp/transport_parallel.f90 .

Bandingkan file lama dan file baru
[hpc07@java2 Fortran_source]$ diff transport_parallel.f90 transport_parallel.f90.old
206c206
<   call update_boundaries_PBC
---
>   call update_boundaries_FLAT
228c228
<      call update_boundaries_PBC
---
>      call update_boundaries_FLAT

Compile lagi
[hpc07@java2 Fortran_source]$ make
mpif90 -03 -cpp -o transport_parallel.x transport_parallel.f90

Lihat isi script :
[hpc07@java2 Fortran_source]$ more sub_script.sh
#!/bin/bash
#PBS -N test_pbs
#PBS -l nodes=1:ppn=8
#PBS -l walltime=2:00:00
cd $PBS_O_WORKDIR
./transport_serial.x

Menjalankan script yang serial :
[hpc07@java2 Fortran_source]$ qsub sub_script.sh

Memantau pekerjaan :
[hpc07@java2 Fortran_source]$ qstat

Menampilkan plot :
[hpc07@java2 Fortran_source]$ gnuplot

gnuplot> splot 'transport.dat' w l, 'transport-end-serial.dat' w l"

Lihat isi script :
[hpc07@java2 Fortran_source]$ more sub_script.sh
#!/bin/bash
#PBS -N test_pbs
#PBS -l nodes=1:ppn=8
#PBS -l walltime=2:00:00
cd $PBS_O_WORKDIR
mpirun ./transport_parallel.x

Menjalankan script yang paralel:
[hpc07@java2 Fortran_source]$ qsub sub_script.sh

Memantau pekerjaan :
[hpc07@java2 Fortran_source]$ qstat

Menampilkan plot :
[hpc07@java2 Fortran_source]$ gnuplot

gnuplot> splot 'transport.dat' w l, 'transport-end-parallel.dat' w l"

No comments:

Post a Comment