Table of Contents

Prihlasenie

ssh user@login.hpc.uniza.sk

Enviroment moduly

$module avail
--------------------------------------------------- /etc/modulefiles ---------------------------------------------------
adina/8.8-dmp          adina/8.8-smp          openmpi/1.6.3(default) openmpi-x86_64
$module show openmpi
-------------------------------------------------------------------
/etc/modulefiles/openmpi/1.6.3:

module-version   1.6.3 default
module-whatis    Open MPI v1.6.3 library
prepend-path     PATH /apps/openmpi-1.6.3/bin
prepend-path     LD_LIBRARY_PATH /apps/openmpi-1.6.3/lib
prepend-path     MANPATH /apps/openmpi-1.6.3/share/man
setenv           MPI_BIN /apps/openmpi-1.6.3/bin
setenv           MPI_SYSCONFIG /apps/openmpi-1.6.3/etc
setenv           MPI_INCLUDE /apps/openmpi-1.6.3/include
setenv           MPI_LIB /apps/openmpi-1.6.3/lib
setenv           MPI_MAN /apps/openmpi-1.6.3/share/man
setenv           MPI_COMPILER openmpi-1.3.6
setenv           MPI_SUFFIX _openmpi
setenv           MPI_HOME /apps/openmpi-1.6.3
-------------------------------------------------------------------
$module load openmpi

$module purge

Spustenie úlohy

Kompilácia

$module load openmpi
$mpicc program.c

Zadanie ulohy do fronty

$ qsub s1.pbs

Skript pre seriovu ulohu

#!/bin/sh
# nazov vo fronte
#PBS -N UNIZA_JOB

# skript ziada
#PBS -l nodes=1:ppn=1,pmem=100mb,walltime=00:10:00

# Nazov projektu
#PBS -A UNIZA_PROJ

# vypoctova fronta - batch
#PBS -q serial

# po ukonceni error file -  "Simple.err"
#PBS -e Simple.err

# stdout do suboru -  "Simple.result"
#PBS -o Simple.result

# zaslanie emailu -  b begin, e end, a abort,
# neposielat email (n/none).
#PBS -m ae

# zaslanie emailu na adresu
#PBS -M user@uniza.sk

# kopirovanie dat na vstupny disk (/localscratch)
##cp my_* $TMPDIR
##cd $TMPDIR

/apps/run/program

Skript pre paralelnu ulohu s openmpi

#!/bin/sh
# nazov vo fronte
#PBS -N UNIZA_JOB_xhpl

# skript ziada
#PBS -l nodes=4:ppn=12,pmem=2gb,walltime=1:10:00

# Nazov projektu
#PBS -A UNIZA_PROJ

# vypoctova fronta - batch
#PBS -q parallel

# po ukonceni error file -  "Simple.err"
#PBS -e Simple.err

# stdout do suboru -  "Simple.result"
#PBS -o Simple.result

# zaslanie emailu -b begin, -e end, -a abort
# neposielat email (-n/none).
#PBS -m ae

# zaslanie emailu na adresu
#PBS -M user@uniza.sk

options="> OUT"

cd /work/user/hpl

application="/work/user/hpl/xhpl"

. /etc/profile.d/modules.sh
module purge
module load openmpi/1.6.3

# Príklad využitia premenných (PBS/Torque)
np=$PBS_NP
ppn=$PBS_NUM_PPN
numnodes=$PBS_NUM_NODES

CMD="mpirun  $application $options"

###########################################
cd $PBS_O_WORKDIR
echo -e "Changed directory to `pwd`.n"
JOBID=`echo $PBS_JOBID | sed -e "s/..*$//"`

echo "workdir $PBS_O_WORKDIR , jobid: $PBS_JOBID , ":

echo -e "JobID: $JOBIDn======"
echo "Time: `date`"
echo "Running on master node: `hostname`"
echo "Current directory: `pwd`"

if [ -r "$PBS_NODEFILE" ]; then
        cat $PBS_NODEFILE | uniq > machfile
        echo -e "nNodes allocated:n================"
        echo `cat machfile`
fi

echo -e "nnumprocs=$np, numnodes=$numnodes, ppn=$ppn"
echo -e "nExecuting command:n==================n$CMDn"
echo "$CMD"

eval $CMD

Kontrola úloh

$ qstat -a, showq
$ showq -b

Vymazanie úlohy z fronty

$ qdel  jobid