From 2448105dd8f5890d21885ec7088a0914a16ace2d Mon Sep 17 00:00:00 2001
From: Krish Moodbidri <krish94@uab.edu>
Date: Fri, 12 Aug 2022 11:17:11 -0500
Subject: [PATCH] feat- matlab app for SLURM_CLUSTER with required config (#3)

* added stable version v1.0 of matlab

* edited cluster name

* changed clustername

* fixed versions in matlab

* removed existing form.yml.erb

* changed form.yml to form.yml.erb

* added additional partitions
---
 form.yml => form.yml.erb | 21 ++++++++++++++++-----
 template/script.sh.erb   | 21 ++++++---------------
 2 files changed, 22 insertions(+), 20 deletions(-)
 rename form.yml => form.yml.erb (60%)

diff --git a/form.yml b/form.yml.erb
similarity index 60%
rename from form.yml
rename to form.yml.erb
index 07ca419..0ca53d1 100644
--- a/form.yml
+++ b/form.yml.erb
@@ -1,5 +1,5 @@
 ---
-cluster: "SLURM_CLUSTER"  
+cluster: "SLURM_CLUSTER" 
 attributes:
   bc_num_hours:
     value: 1
@@ -39,11 +39,22 @@ attributes:
     label: "MATLAB version"
     help: "This defines the version of MATLAB you want to load."
     options:
-{% for ver in matlab_vers %}
-      - [ "{{ ver }}", "{{ matlab_module_name }}/{{ ver }}"]
-{% endfor %}
+      - [ "R2022a", "rc/matlab/R2022a"]
+      - [ "R2021b", "rc/matlab/R2021b"]
+      - [ "R2021a", "rc/matlab/R2021a"]
+      - [ "R2020a", "rc/matlab/R2020a"]
+      - [ "R2019b", "rc/matlab/R2019b"]
+      - [ "R2019a", "rc/matlab/R2019a"]
+      - [ "R2018a", "rc/matlab/R2018a"]
+      - [ "R2017b", "rc/matlab/R2017b"]
+      - [ "R2017a", "rc/matlab/R2017a"]
+      - [ "R2016b", "rc/matlab/R2016b"]
+      - [ "R2016a", "rc/matlab/R2016a"]
+      - [ "R2015a", "rc/matlab/R2015a"]
+      - [ "R2013a", "rc/matlab/R2013a"]
+      - [ "R2012a", "rc/matlab/R2012a"]
 
-  cuda_toolkit: "{{ cuda_toolkit_module }}"
+  cuda_toolkit: "cuda10.0/toolkit"
 
 form:
   - version
diff --git a/template/script.sh.erb b/template/script.sh.erb
index 5473f3c..8884fa8 100755
--- a/template/script.sh.erb
+++ b/template/script.sh.erb
@@ -1,10 +1,5 @@
 #!/usr/bin/env bash
 
-<%- gpu = context.node_type.include?("vis") -%>
-
-# Clean the environment
-module purge
-
 # Set working directory to home directory
 cd "${HOME}"
 
@@ -17,7 +12,7 @@ cd "${HOME}"
   export XDG_CONFIG_HOME="<%= session.staged_root.join("config") %>"
   export XDG_DATA_HOME="<%= session.staged_root.join("share") %>"
   export XDG_CACHE_HOME="$(mktemp -d)"
-  module restore
+  module reset
   set -x
   xfwm4 --compositor=off --daemon --sm-client-disable
   xsetroot -solid "#D3D3D3"
@@ -29,17 +24,13 @@ cd "${HOME}"
 # Start MATLAB
 #
 
+<%- if context.bc_partition == "pascalnodes" -%>
+# Load CUDA toolkit
+module load <%= context.cuda_toolkit %>
+<%- end -%>
 # Load the required environment
-module load xalt/latest <%= context.version %>
-
+module load <%= context.version %>
 # Launch MATLAB
-<%- if gpu -%>
-module load intel/16.0.3 virtualgl
-module list
-set -x
-vglrun matlab -desktop -nosoftwareopengl
-<%- else -%>
 module list
 set -x
 matlab -desktop
-<%- end -%>
-- 
GitLab