From e6992db07aaf26c269462076c2f92cbcd3c64a9b Mon Sep 17 00:00:00 2001
From: Cristian C Lalescu <Cristian.Lalescu@ds.mpg.de>
Date: Thu, 29 Aug 2019 06:57:50 +0200
Subject: [PATCH] tweak SLURM script setup

---
 TurTLE/_code.py | 6 ++++++
 pc_host_info.py | 8 ++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/TurTLE/_code.py b/TurTLE/_code.py
index 89ac3e36..64df8f07 100644
--- a/TurTLE/_code.py
+++ b/TurTLE/_code.py
@@ -664,8 +664,14 @@ class _code(_base):
         # output file
         if not type(out_file) == type(None):
             script_file.write('#SBATCH -o ' + out_file + '\n')
+
+        # set up environment
+        script_file.write('#SBATCH --get-user-env\n')
         script_file.write('#SBATCH --partition={0}\n'.format(
                 self.host_info['environment']))
+        if 'account' in self.host_info.keys():
+            script_file.write('#SBATCH --account={0}\n'.format(
+                    self.host_info['account']))
 
         nb_cpus_per_node = self.host_info['deltanprocs']
         assert isinstance(nb_cpus_per_node, int) \
diff --git a/pc_host_info.py b/pc_host_info.py
index 1c5eee58..4c6b3816 100644
--- a/pc_host_info.py
+++ b/pc_host_info.py
@@ -29,8 +29,9 @@ host_info = {'type' : 'pc'}
 #                 {'type'        : info_template_type,
 #                  'MPI'         : info_template_MPI,
 #                  'environment' : info_template_environment,
-#                  'deltanprocs' : info_template_deltanprocs
-#                  'mail_address': info_template_mail_address}
+#                  'deltanprocs' : info_template_deltanprocs,
+#                  'mail_address': info_template_mail_address,
+#                  'account'     : info_template_account}
 
 # info_template_type can be one of:
 # 'pc'            --- jobs run interactively
@@ -50,3 +51,6 @@ host_info = {'type' : 'pc'}
 
 # info_template_mail_address, relevant for clusters,
 # is the contact e-mail address placed in the job scripts.
+
+# info_template_account, relevant for some clusters,
+# is the name of the account to be budgeted for the job.
-- 
GitLab