I am running some computational calculations using my DFT software. To do so I need a job script that assigns the client node to my job.
My job file is here
#!/bin/sh
#SBATCH -J test
#SBATCH -p 52core
#SBATCH -N 1
#SBATCH -n 16
#SBATCH -o %x.o%j
#SBATCH -e %x.e%j
#export I_MPI_PMI_LIBRARY=/usr/lib64/libpmi.so #Do not change here!!
##### Notjing to worry about above part===============
export OMP_NUM_THREADS=1
# Use , as list seperator
IFS=','
# Convert string to array
hcpus=($SLURM_JOB_CPUS_PER_NODE)
unset IFS
declare -a conv
# Expand compressed slurm array
for cpu in ${hcpus[@]}; do
if [[ $cpu =~ (.*)\((.*)x\) ]]; then
# found compressed value
value=${BASH_REMATCH[1]}
factor=${BASH_REMATCH[2]}
for j in $(seq 1 $factor); do
conv=( ${conv[*]} $value )
done
else
conv=( ${conv[*]} $cpu )
fi
done
# Build .machines file
rm -f .machines
nhost=0
echo ${conv[@]};
IFS=','
for node in $SLURM_NODELIST
do
declare -i cpuspernode=${conv[$nhost]};
for ((i=0; i<${cpuspernode}; i++))
do
echo 1:$node >> .machines
done
let nhost+=1
done
echo 'granularity:1' >>.machines
echo 'extrafine:1' >>.machines
# .machines file complete
# Run your caclulation
run_lapw -p
This job file uses the bc on the client nodes and my client nodes are not having bc. There is no chance that I can install bc on the client nodes.
Is it possible to modify this script such that It uses the head node for bc and then assign the client node to my job file?
Basically it creates the .machine files. one .machine file for each core of the node and one .machines file which have the below format
1:node11
1:node11
1:node11
1:node11
1:node11
1:node11
1:node11
1:node11
1:node11
1:node11
1:node11
1:node11
1:node11
1:node11
1:node11
1:node11
granularity:1
extrafine:1