<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://sagacioushours.org.uk/wiki/index.php?action=history&amp;feed=atom&amp;title=Talk%3AMod%3AHunt_Research_Group%2FDsubmit_EEF</id>
	<title>Talk:Mod:Hunt Research Group/Dsubmit EEF - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://sagacioushours.org.uk/wiki/index.php?action=history&amp;feed=atom&amp;title=Talk%3AMod%3AHunt_Research_Group%2FDsubmit_EEF"/>
	<link rel="alternate" type="text/html" href="https://sagacioushours.org.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/Dsubmit_EEF&amp;action=history"/>
	<updated>2026-05-25T18:32:51Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://sagacioushours.org.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/Dsubmit_EEF&amp;diff=25135&amp;oldid=prev</id>
		<title>Laura: adjusting formatting of instructions</title>
		<link rel="alternate" type="text/html" href="https://sagacioushours.org.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/Dsubmit_EEF&amp;diff=25135&amp;oldid=prev"/>
		<updated>2026-02-19T08:00:55Z</updated>

		<summary type="html">&lt;p&gt;adjusting formatting of instructions&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 08:00, 19 February 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l5&quot; &gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The jobs to submit should all consist of the same base file name, followed by a job id, such as those produced by Dcreate_EEF_coms.py. Code is currently setup to submit jobs produced by Dcreate_EEF_coms.py, but can be adapted for other job collections by changing how the job_ids are produced.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The jobs to submit should all consist of the same base file name, followed by a job id, such as those produced by Dcreate_EEF_coms.py. Code is currently setup to submit jobs produced by Dcreate_EEF_coms.py, but can be adapted for other job collections by changing how the job_ids are produced.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Code has been adapted from Dsubmit.py written by Patricia Hunt:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Code has been adapted from Dsubmit.py written by Patricia Hunt: https://sagacioushours.org.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/Dsubmit&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;    &lt;/del&gt;https://sagacioushours.org.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/Dsubmit&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Running Dsubmit_EEF.py=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Running Dsubmit_EEF.py=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The job parameters should be specified for the batch of jobs being submitted before running. The sections defining these parameters are marked by ###&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The job parameters should be specified for the batch of jobs being submitted before running. The sections defining these parameters are marked by ###&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To run this script&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To run this script&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     python batch_submit_EEF.py base_job_name&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     python batch_submit_EEF.py base_job_name&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Laura</name></author>
		
	</entry>
	<entry>
		<id>https://sagacioushours.org.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/Dsubmit_EEF&amp;diff=25134&amp;oldid=prev</id>
		<title>Laura: Created page with &quot;  This code creates an sbatch script to run a collection of jobs on the VUW Raapoi HPC. The code will copy jobs from the users home directory to their scratch directory, run t...&quot;</title>
		<link rel="alternate" type="text/html" href="https://sagacioushours.org.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/Dsubmit_EEF&amp;diff=25134&amp;oldid=prev"/>
		<updated>2026-02-19T07:59:51Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;  This code creates an sbatch script to run a collection of jobs on the VUW Raapoi HPC. The code will copy jobs from the users home directory to their scratch directory, run t...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
This code creates an sbatch script to run a collection of jobs on the VUW Raapoi HPC. The code will copy jobs from the users home directory to their scratch directory, run the jobs, and copy the results back.&lt;br /&gt;
&lt;br /&gt;
The jobs to submit should all consist of the same base file name, followed by a job id, such as those produced by Dcreate_EEF_coms.py. Code is currently setup to submit jobs produced by Dcreate_EEF_coms.py, but can be adapted for other job collections by changing how the job_ids are produced.&lt;br /&gt;
&lt;br /&gt;
Code has been adapted from Dsubmit.py written by Patricia Hunt:&lt;br /&gt;
    https://sagacioushours.org.uk/wiki/index.php?title=Talk:Mod:Hunt_Research_Group/Dsubmit&lt;br /&gt;
&lt;br /&gt;
=Running Dsubmit_EEF.py=&lt;br /&gt;
The job parameters should be specified for the batch of jobs being submitted before running. The sections defining these parameters are marked by ###&lt;br /&gt;
To run this script&lt;br /&gt;
    python batch_submit_EEF.py base_job_name&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
Please note no file extensions    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
import subprocess&lt;br /&gt;
dir=os.getcwd()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### EDIT THESE TO SPECIFY THE JOB PARAMETERS &lt;br /&gt;
CPUS_PER_TASK = &amp;quot;32&amp;quot;&lt;br /&gt;
MEM = &amp;quot;64G&amp;quot;&lt;br /&gt;
PARTITION = &amp;quot;quicktest&amp;quot;&lt;br /&gt;
TIME = &amp;quot;05:00:00&amp;quot;&lt;br /&gt;
USER = &amp;quot;username&amp;quot;&lt;br /&gt;
FOLDER = &amp;quot;/folder&amp;quot; # leave as empty string if jobs are not in a subfolder&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### EDIT THESE TO SELECT JOBS TO SUBMIT &lt;br /&gt;
FIELD_DIRECTIONS = [&amp;quot;x&amp;quot;,&amp;quot;y&amp;quot;,&amp;quot;z&amp;quot;]&lt;br /&gt;
FIELD_STRENGTHS = [5,20,50,100,200]&lt;br /&gt;
FIELD_SIGNS = [1,-1]&lt;br /&gt;
&lt;br /&gt;
# create a list of all job ids&lt;br /&gt;
job_ids = []&lt;br /&gt;
for direction in FIELD_DIRECTIONS:&lt;br /&gt;
    for strength in FIELD_STRENGTHS:&lt;br /&gt;
        for sign in FIELD_SIGNS:&lt;br /&gt;
            job_ids.append(direction+str(sign * strength))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# specify the home and scratch directories&lt;br /&gt;
home_dir = '/nfs/home/'+USER+FOLDER+'/'&lt;br /&gt;
scratch_dir = '/nfs/scratch/'+USER+FOLDER+'/'&lt;br /&gt;
&lt;br /&gt;
# grab the base job name&lt;br /&gt;
bjob=str(sys.argv[1])&lt;br /&gt;
s='base job expression: '&lt;br /&gt;
print('{0:}{1:}'.format(s,bjob))&lt;br /&gt;
#&lt;br /&gt;
n=0&lt;br /&gt;
s='jobs to run: '&lt;br /&gt;
&lt;br /&gt;
# for each job, generate and submit an sbatch file&lt;br /&gt;
print('{0:}'.format(s))&lt;br /&gt;
for job_id in job_ids :&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    job=bjob+&amp;quot;_&amp;quot;+job_id&lt;br /&gt;
    jobname = job_id+&amp;quot;_&amp;quot;+bjob&lt;br /&gt;
    com=job+&amp;quot;.com&amp;quot;&lt;br /&gt;
    log=job+&amp;quot;.log&amp;quot;&lt;br /&gt;
    chk=job+&amp;quot;.chk&amp;quot;&lt;br /&gt;
    err=job+&amp;quot;.err&amp;quot;&lt;br /&gt;
    jobcom=home_dir+job+&amp;quot;.com&amp;quot;&lt;br /&gt;
    joblog=home_dir+job+&amp;quot;.log&amp;quot;&lt;br /&gt;
    jobchk=home_dir+job+&amp;quot;.chk&amp;quot;&lt;br /&gt;
    joberr=home_dir+job+&amp;quot;.err&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    # open files&lt;br /&gt;
    f=open(&amp;quot;rung16.sh&amp;quot;,&amp;quot;w&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    # create submit script&lt;br /&gt;
    s0='#!/bin/bash'&lt;br /&gt;
    s1='#SBATCH --job-name=' #jobname&lt;br /&gt;
    s2='#SBATCH --cpus-per-task=' + CPUS_PER_TASK&lt;br /&gt;
    s3='#SBATCH --mem=' + MEM&lt;br /&gt;
    s4='#SBATCH --partition=' + PARTITION&lt;br /&gt;
    s5='#SBATCH --time=' + TIME&lt;br /&gt;
    f.write('{0:}\n{1:}{2:}\n{3:}\n{4:}\n{5:}\n{6:}\n'.format(s0,s1,jobname,s2,s3,s4,s5))&lt;br /&gt;
&lt;br /&gt;
    s0='#SBATCH -o '+scratch_dir #log&lt;br /&gt;
    s1='#SBATCH -e '+scratch_dir #err&lt;br /&gt;
    f.write('{0:}{1:}\n{2:}{3:}\n\n'.format(s0,log,s1,err))&lt;br /&gt;
&lt;br /&gt;
    s0='cp ' #jobcom &lt;br /&gt;
    f.write('{0:}{1:} {2:}{3:}\n\n'.format(s0,jobcom,scratch_dir,com))&lt;br /&gt;
&lt;br /&gt;
    s0='test -r ' #chk &lt;br /&gt;
    s1=(&amp;quot;if [ $? -eq 0 ] \n&amp;quot;&lt;br /&gt;
     &amp;quot;then \n&amp;quot;)&lt;br /&gt;
    s2='cp '  #jobchk&lt;br /&gt;
    s3='fi'&lt;br /&gt;
    f.write('{0:}{1:}\n{2:}{3:}{4:} {5:}{6:}\n{7:}\n\n'.format(s0,chk,s1,s2,jobchk,scratch_dir,chk,s3))&lt;br /&gt;
&lt;br /&gt;
    s0='cd '&lt;br /&gt;
    s1='module --quiet purge'&lt;br /&gt;
    s2='module load gaussian/g16'&lt;br /&gt;
    s3='g16 '  #com &lt;br /&gt;
    f.write('{0:}{1:}\n{2:}\n{3:}\n{4:}{5:}\n\n'.format(s0,scratch_dir,s1,s2,s3,com))&lt;br /&gt;
&lt;br /&gt;
    s0='test -r ' #log&lt;br /&gt;
    s1=(&amp;quot;if [ $? -eq 0 ] \n&amp;quot;&lt;br /&gt;
     &amp;quot;then \n&amp;quot;)&lt;br /&gt;
    s2='  cp ' #log&lt;br /&gt;
    s3=' '  #joblog&lt;br /&gt;
    s4='fi'&lt;br /&gt;
    f.write('{0:}{1:}\n{2:}{3:}{4:}{5:}{6:}{7:}\n{8:}\n\n'.format(s0,log,s1,s2,scratch_dir,log,s3,joblog,s4))&lt;br /&gt;
&lt;br /&gt;
    s0='test -r ' #chk &lt;br /&gt;
    s1=(&amp;quot;if [ $? -eq 0 ] \n&amp;quot;&lt;br /&gt;
     &amp;quot;then \n&amp;quot;)&lt;br /&gt;
    s2='  cp ' #chk&lt;br /&gt;
    s3=' '  #jobchk&lt;br /&gt;
    s4='fi'&lt;br /&gt;
    f.write('{0:}{1:}\n{2:}{3:}{4:}{5:}{6:}{7:}\n{8:}\n\n'.format(s0,chk,s1,s2,scratch_dir,chk,s3,jobchk,s4))&lt;br /&gt;
&lt;br /&gt;
    # close files&lt;br /&gt;
    f.close()&lt;br /&gt;
&lt;br /&gt;
    s0='now submiting via: sbatch rung16.sh'&lt;br /&gt;
    print('{0:} {1:}'.format(s0,job))&lt;br /&gt;
    os.system('sbatch rung16.sh')&lt;br /&gt;
    n=n+1&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;{} jobs submitted&amp;quot;.format(n))&lt;br /&gt;
#end&lt;br /&gt;
sys.exit()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Laura</name></author>
		
	</entry>
</feed>