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édente | ||
| faq:chimie:namd [2019/10/10 13:18] – [Submission script NAMD] tjiang | faq:chimie:namd [2022/03/03 16:30] (Version actuelle) – [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=/ | + | if [[ -d "/ |
| - | # Using ramdisk as scratch | + | then |
| - | # SCRATCHDIR=/ | + | |
| + | elif [[ -d "/scratch/Lake" ]] | ||
| + | then | ||
| + | SCRATCHDIR="/scratch/ | ||
| + | elif [[ -d "/ | ||
| + | then | ||
| + | SCRATCHDIR="/ | ||
| - | /bin/mkdir -p $SCRATCHDIR | + | else |
| - | HOSTFILE=$TMPDIR/ | + | echo "/ |
| - | cp $HOSTFILE . | + | exit 1 |
| + | fi | ||
| + | |||
| + | echo " | ||
| + | /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}" |
| </ | </ | ||