...
Dies kann beispielsweise auch genutzt werden um einen Performancevergleich zwischen unterschiedlichen Architekturen im Cluster für das eigene Programm zu machen.
Triviales Template
Codeblock |
---|
|
#!/bin/bash
#PBS -l select=3:ncpus=1:mem=20G
#PBS -l place=scatter
#PBS -l walltime=0:05:00
#PBS -A BenchMarking
cd $PBS_O_WORKDIR
pbsdsh -v -- bash -l $PWD/childs.sh |
Codeblock |
---|
language | bash |
---|
title | childs.sh |
---|
|
#!/bin/bash
echo "node: $PBS_NODENUM"
echo "task: $PBS_TASKNUM"
numnodes=$(wc -l $PBS_NODEFILE)
echo "node number: $numnodes"
index=$(expr $PBS_TASKNUM - 2)
master_info=/gpfs/scratch/$PBS_JOBID/master.info
echo "rank: $index"
if [[ $index -eq 0 ]] ; then
echo "running on master"
port=$(shuf -i 2000-65000 -n 1)
echo "" > $master_info
echo "master=$HOSTNAME-ib" >> $master_info
echo "port=$port" >> $master_info
echo "wrote master info to $master_info"
echo "starting master process"
.... now you call/module load
else
echo "running on slave"
echo "waiting for master for some seconds"
while [ ! -f $master_info ]
do
sleep 1 # or less like 0.2
done
echo "found info file $master_info"
sleep 1
master=$(grep master $master_info | awk -F'=' '{print $2}')
port=$(grep port $master_info | awk -F'=' '{print $2}')
echo "found master at $master:port"
... now your call/module load
f
|