#!/bin/csh # # General prologue script for PBS # This file is run only on the first node, so we must setup all # nodes in the parallel job. We will assume rhosts is setup for now. # # This script creates the scratch directory for the job on each node # # just create the directory locally since it is the first node mkdir /scratch/$1 chown $2.$3 /scratch/$1 if (-e /usr/spool/PBS/aux/$1) then set HOSTLIST set nmax=`wc -l /usr/spool/PBS/aux/$1` set nmax=$nmax[1] @ NODE=1 while ($NODE <= $nmax) set NODENAME=`sed -n -e "$NODE p" /usr/spool/PBS/aux/$1` set -f HOSTLIST=($HOSTLIST $NODENAME) @ NODE++ end @ NODE=2 while ($NODE <= $#HOSTLIST) /usr/bin/ssh $HOSTLIST[$NODE] "mkdir /scratch/$1; chown $2.$3 /scratch/$1" @ NODE++ end endif exit(0)