34 | | > Under Construction |
| 34 | [[CollapsibleStart(Submission of Post Processing)]] |
| 35 | |
| 36 | - Creates post processing directories in your out directory. |
| 37 | - Edits and submits the jobs for your executable. |
| 38 | - You do have to manually move the simulation into the directory once the job has completed. |
| 39 | |
| 40 | {{{ |
| 41 | #!/bin/bash |
| 42 | |
| 43 | ## INITIALIZING INVARIANTS ## |
| 44 | |
| 45 | #Put the name of your executable here! |
| 46 | EXECUTABLE="astrobear_Bvn" |
| 47 | #Put the name of your bash script here! |
| 48 | SUBMISSION_SCRIPT="job.sh" |
| 49 | |
| 50 | ## FINDING RUN DIRECTORIES ## |
| 51 | |
| 52 | #/scratch/[USERNAME]/[REST OF PATH]/ Make sure script is here <-- |
| 53 | |
| 54 | cd /scratch/[USERNAME]/[REST OF PATH]/ |
| 55 | |
| 56 | PP_PATH="Directory1, Directory2" |
| 57 | |
| 58 | ## MAKING A LOOP ## |
| 59 | |
| 60 | for d in ${PP_PATH}; do |
| 61 | |
| 62 | cd ${d} |
| 63 | |
| 64 | ## MAKING UNIQUE DIRECTORIES ## |
| 65 | |
| 66 | #Name of the directory we're going to create in... |
| 67 | DIRECTORY_NAME="${EXECUTABLE}_`echo ${d} | tr -d '/'`_`date +%s`" |
| 68 | #your out directory. |
| 69 | OUTPUT_DIR="out/" |
| 70 | |
| 71 | #Checker to see if you have an out directory. |
| 72 | if [ \! -e ${OUTPUT_DIR} ] || [ \! -d ${OUTPUT_DIR} ]; then |
| 73 | echo "There is a problem with your ${OUTPUT_DIR} directory, please check. Exiting." |
| 74 | exit |
| 75 | fi |
| 76 | |
| 77 | #Makes a new directory in your out directory for post processing with the executable, run, and date in the name. |
| 78 | mkdir out/${DIRECTORY_NAME} |
| 79 | |
| 80 | ## EDITTING BATCH SCRIPT ## |
| 81 | #Note this change is universal for all PP_PATH |
| 82 | sed -i 's/--reservation .*//' job.sh |
| 83 | sed -i 's/-N .*/-N 32/' job.sh |
| 84 | sed -i 's/--ntasks-per-node .*/--ntasks-per-node 16/' job.sh |
| 85 | sed -i 's/-c .*/-c 1/' job.sh |
| 86 | sed -i 's/-p .*/-p debug/' job.sh |
| 87 | sed -i 's/--time .*/--time 00-00:30:00/' job.sh |
| 88 | sed -i 's/#SBATCH --mail-user email1@pas.rochester.edu/##SBATCH --mail-user email1@pas.rochester.edu/' job.sh |
| 89 | # sed -i 's/#SBATCH --mail-user email2@pas.rochester.edu/##SBATCH --mail-user email2@pas.rochester.edu/' job.sh |
| 90 | sed -i "s/astrobear.* > astrobear.*.log/${EXECUTABLE} > ${EXECUTABLE}.log/" job.sh |
| 91 | |
| 92 | ## SUBMIT BATCH SCRIPT ## |
| 93 | sbatch ${SUBMISSION_SCRIPT} |
| 94 | |
| 95 | cd ../../ |
| 96 | done |
| 97 | }}} |
| 98 | [[CollapsibleEnd]] |
| 99 | |