diff --git a/TurTLE/_code.py b/TurTLE/_code.py
index 2b235ed5ffc82a1e18bb2a101203f96b7e4ff79f..b49c8f2edc5e256912a4e357f17bfeb627a90c67 100644
--- a/TurTLE/_code.py
+++ b/TurTLE/_code.py
@@ -725,10 +725,11 @@ class _code(_base):
         ## make sure that "~/.config/TurTLE/bashrc" exists and builds desired job environment
         #script_file.write('#SBATCH --export=NONE\n')
         #script_file.write('#SBATCH --get-user-env\n')
+        #script_file.write('export OMP_PLACES=cores\n') # or threads, as appropriate
+        # also look up OMP_PROC_BIND and SLURM_HINT
         #script_file.write('source ~/.config/TurTLE/bashrc\n')
         if nb_threads_per_process > 1:
-            script_file.write('export OMP_NUM_THREADS={0}\n'.format(nb_threads_per_process))
-            script_file.write('export OMP_PLACES=cores\n')
+            script_file.write('export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}\n')
 
         script_file.write('echo "Start time is `date`"\n')
         script_file.write('cd ' + self.work_dir + '\n')