Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

convert bash to tcsh

3 views
Skip to first unread message

alberto

unread,
Oct 2, 2019, 1:37:37 PM10/2/19
to
hi,
I would convert in tcsh this script
how I could fix it

regards

## Script for parallel LAMMPS17 job by Alberto
## Run script with 2 arguments:
## $1 = Name of input-file, without extension
## $2 = Numbers of nodes to use (ncpus=nodes*20)


if [ -z "$1" -o -z "$2" ]; then
echo "Usage: $0 <input_file> <np>"
fi

if [ $2 -ge 8 ]; then
NODES=$(($2/20))
CPUS=20
else
NODES=1
CPUS=$2
fi

cat<<EOF>$1.job
#!/bin/bash
#PBS -l nodes=$NODES:ppn=$CPUS:xeon20
#PBS -l walltime=9999:00:00
#PBS -N $1
#PBS -e $1.err
#PBS -o $1.sum
#PBS -j oe
job=$1 # Name of input file, no extension
project=\$PBS_O_WORKDIR
cd \$project
cat \$PBS_NODEFILE > \$PBS_O_WORKDIR/nodes.txt
# define the environment variable OMP_NUM_THREADS to indicate the number of threads that we want per program
export OMP_NUM_THREADS=$3
time /opt/openmpi-1.4.5/bin/mpirun -machinefile ./nodes.txt -np $2 /opt/lammps-31Mar17/src/lmp_al_mpi < $1.lmps > $1.lmpslog
EOF

qsub $1.job
0 new messages