From c0ccd4bbb9f69687a61c7505696a21b23cc7fd10 Mon Sep 17 00:00:00 2001
From: Ravi Tripathi <ravi89@uab.edu>
Date: Tue, 14 Aug 2018 12:02:29 -0500
Subject: [PATCH] Adding an array job for random filenames

---
 PART_1/array_rand.job | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 PART_1/array_rand.job

diff --git a/PART_1/array_rand.job b/PART_1/array_rand.job
new file mode 100644
index 0000000..297049d
--- /dev/null
+++ b/PART_1/array_rand.job
@@ -0,0 +1,30 @@
+#!/bin/bash
+#SBATCH --array=0-4
+#SBATCH --share
+#SBATCH --partition=express
+#
+# Name your job to make it easier for you to track
+#
+#SBATCH --job-name=test_job_%A_%a
+#
+# Set your error and output files
+#
+#SBATCH --error=job_err/test_job_%A_%a.err
+#SBATCH --output=job_out/test_job_%A_%a.out
+#SBATCH --ntasks=1
+#
+# Tell the scheduler only need 10 minutes
+#
+#SBATCH --time=00:10:00
+#SBATCH --mem-per-cpu=256
+#
+# Set your email address and request notification when you job is complete or if it fails
+#
+#SBATCH --mail-type=FAIL
+#SBATCH --mail-user=$USER@uab.edu
+
+FILES=(`ls test_dir`)
+FILENAME=${FILES[$SLURM_ARRAY_TASK_ID]} 
+
+srun echo "Processing file $FILENAME" >> test_dir/$FILENAME 
+srun sleep 30
-- 
GitLab