Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédenteDernière révisionLes deux révisions suivantes | ||
faq:chimie:namd [2018/07/24 11:47] – tjiang | faq:chimie:namd [2021/10/08 13:51] – [Submission script NAMD] tjiang | ||
---|---|---|---|
Ligne 14: | Ligne 14: | ||
# Setting up home and scratch directories | # Setting up home and scratch directories | ||
- | HOMEDIR=$SGE_O_WORKDIR | + | HOMEDIR="${SGE_O_WORKDIR}" |
- | cd $HOMEDIR | + | cd "${HOMEDIR}" || { echo " |
- | SCRATCHDIR=/ | + | |
- | /bin/mkdir -p $SCRATCHDIR | + | if [[ -d "/ |
- | HOSTFILE=$TMPDIR/ | + | then |
- | cp $HOSTFILE . | + | SCRATCHDIR="/scratch/Chimie/${USER}/${JOB_ID}/" |
+ | elif [[ -d "/ | ||
+ | then | ||
+ | SCRATCHDIR="/ | ||
+ | elif [[ -d "/ | ||
+ | then | ||
+ | SCRATCHDIR="/ | ||
+ | |||
+ | else | ||
+ | echo "/ | ||
+ | exit 1 | ||
+ | fi | ||
+ | # Using /tmp as scratch instead | ||
+ | # SCRATCHDIR="/ | ||
+ | |||
+ | /bin/mkdir -p "${SCRATCHDIR}" | ||
+ | HOSTFILE="${TMPDIR}/machines" | ||
+ | cp "${HOSTFILE}" | ||
sed -i -e ' | sed -i -e ' | ||
# Please provide the following files for namd | # Please provide the following files for namd | ||
- | CONFIGFILE=run2.namd | + | CONFIGFILE="run2.namd" |
- | TOPFILE=DDB2_CT_hmr.prmtop | + | TOPFILE="DDB2_CT_hmr.prmtop" |
- | PDBFILE=DDB2_CT_run1_0.coor | + | PDBFILE="DDB2_CT_run1_0.coor" |
- | FIXFILE=DDB2_CT_new.fix | + | FIXFILE="DDB2_CT_new.fix" |
- | COLVARSFILE=dihedral_run1.in | + | COLVARSFILE="dihedral_run1.in" |
- | LOGFILE=run2.out | + | LOGFILE="run2.out" |
# Copying files to scratchdir | # Copying files to scratchdir | ||
- | rsync -c $CONFIGFILE $TOPFILE $PDBFILE $FIXFILE $COLVARSFILE machines runscript $SCRATCHDIR | + | rsync -c "${CONFIGFILE}" "${TOPFILE}" "${PDBFILE}" "${FIXFILE}" "${COLVARSFILE}" |
# The executables for mpirun and namd2 | # The executables for mpirun and namd2 | ||
- | MPIRUN=mpirun | + | MPIRUN="mpirun" |
# Go to scratch directory and run calculation there | # Go to scratch directory and run calculation there | ||
- | cd $SCRATCHDIR | + | cd "${SCRATCHDIR}" || { echo " |
echo 'group main ++shell ssh' > nodelist | echo 'group main ++shell ssh' > nodelist | ||
- | cat machines>> | + | cat machines >> nodelist |
- | namd2 +idlepoll +p $NSLOTS +devices 0,1 $CONFIGFILE> | + | namd2 +idlepoll +p "${NSLOTS}" |
# Copy back data | # Copy back data | ||
- | rsync -c --exclude | + | rsync -c --exclude |
- | cd $HOMEDIR | + | cd "${HOMEDIR}" || { echo " |
# Cleaning up scratch directory and hostfile | # Cleaning up scratch directory and hostfile | ||
- | rm -fr $SCRATCHDIR | + | rm -fr "${SCRATCHDIR}" |
</ | </ |