From 446770fe81318834ebed77f9c8655ba35b511127 Mon Sep 17 00:00:00 2001
From: Bo-Chun Louis Chen <louistw@uab.edu>
Date: Fri, 7 Apr 2023 16:05:37 -0500
Subject: [PATCH] Send email notify when slurm job BEGIN

---
 submit.yml.erb | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/submit.yml.erb b/submit.yml.erb
index ea81e5e..08382d5 100644
--- a/submit.yml.erb
+++ b/submit.yml.erb
@@ -1,5 +1,11 @@
 # Job submission configuration file
 #
+<%-
+  email = ENV['USER']
+  if !email.include? '@'
+    email = email + '@uab.edu'
+  end
+-%>
 ---
 # This config comes from below URL
 # https://github.com/OSC/bc_example_jupyter/blob/custom_environment/submit.yml.erb
@@ -22,3 +28,7 @@ script:
 <%- if bc_partition.include? "pascalnodes" -%>
     - "--gres=gpu:1"
 <%- end -%>
+<%- if bc_email_on_started == "1" -%>
+    - "--mail-type=BEGIN"
+    - "--mail-user=<%= email %>"
+<%- end -%>
-- 
GitLab