rmhivau 2 년 전
부모
커밋
2119fbb6e8
4개의 변경된 파일61개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      .gitignore
  2. 31 0
      jobs/date_cpu.sh
  3. 0 0
      jobs/logs/.gitkeep
  4. 28 0
      jobs/mnist_serial_cpu.sh

+ 2 - 0
.gitignore

@@ -2,4 +2,6 @@ data/*
 !data/.gitkeep
 lightning_logs/*
 !lightning_logs/.gitkeep
+jobs/logs/*
+!jobs/logs/.gitkeep
 

+ 31 - 0
jobs/date_cpu.sh

@@ -0,0 +1,31 @@
+#!/bin/bash -l
+
+# Batch script to run a serial job under SGE.
+
+# Request ten minutes of wallclock time (format hours:minutes:seconds).
+#$ -l h_rt=0:10:0
+
+# Request 1 gigabyte of RAM (must be an integer followed by M, G, or T)
+#$ -l mem=1G
+
+# Request 15 gigabyte of TMPDIR space (default is 10 GB - remove if cluster is diskless)
+#$ -l tmpfs=15G
+
+# Set the name of the job.
+#$ -N Serial_Job
+
+# Set the working directory to somewhere in your scratch space.  
+#  This is a necessary step as compute nodes cannot write to $HOME.
+# Replace "<your_UCL_id>" with your UCL user ID.
+#$ -wd /home/rmhivau/Scratch/workspace
+
+# Your work should be done in $TMPDIR 
+cd $TMPDIR
+
+# Run the application and put the output into a file called date.txt
+/bin/date > date.txt
+
+# Preferably, tar-up (archive) all output files onto the shared scratch area
+tar -zcvf $HOME/Scratch/files_from_job_$JOB_ID.tar.gz $TMPDIR
+
+# Make sure you have given enough time for the copy to complete!

+ 0 - 0
jobs/logs/.gitkeep


+ 28 - 0
jobs/mnist_serial_cpu.sh

@@ -0,0 +1,28 @@
+#!/bin/bash -l
+# Batch script to run a serial job under SGE.
+# Request ten minutes of wallclock time (format hours:minutes:seconds).
+#$ -l h_rt=0:10:0
+# Request 1 gigabyte of RAM (must be an integer followed by M, G, or T)
+#$ -l mem=1G
+# Request 15 gigabyte of TMPDIR space (default is 10 GB - remove if cluster is diskless)
+#$ -l tmpfs=15G
+# Set the name of the job.
+#$ -N mnist_serial_cpu
+
+# Useful to know!
+date
+hostname
+
+# Set python path and get in the right place!
+SOURCE_DIR='~/hpc-tutorial/'
+export PYTHONPATH=$PYTHONPATH:$SOURCE_DIR
+cd $SOURCE_DIR || exit
+
+# Activate your enviroment!
+conda activate hpc-example
+
+# Run your code!
+python pl_examples/image_classifier_4_lightning_module.py
+
+# Is actually advisable to save all results in a $TEMPDIR, zip and clear up... https://www.rc.ucl.ac.uk/docs/Example_Jobscripts/#working-directories-and-output
+