<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://teaching.healthtech.dtu.dk:443/22112/index.php?action=history&amp;feed=atom&amp;title=Distributed_computing</id>
	<title>Distributed computing - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://teaching.healthtech.dtu.dk:443/22112/index.php?action=history&amp;feed=atom&amp;title=Distributed_computing"/>
	<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22112/index.php?title=Distributed_computing&amp;action=history"/>
	<updated>2026-06-10T07:23:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22112/index.php?title=Distributed_computing&amp;diff=123&amp;oldid=prev</id>
		<title>WikiSysop: /* Exercises */</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22112/index.php?title=Distributed_computing&amp;diff=123&amp;oldid=prev"/>
		<updated>2025-09-20T20:05:34Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Exercises&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:05, 20 September 2025&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-l12&quot;&gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;== Exercises ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;== Exercises ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;Using the Queueing System to do distributed computing. &#039;&#039;&#039;Warning&#039;&#039;&#039;: The most difficult part of these exercises is actually using the Queueing System. The python code itself is fairly easy, but getting the QS to work requires patience and experience. Check the QS examples in the powerpoint from last lecture.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;Using the Queueing System to do distributed computing. &#039;&#039;&#039;Warning&#039;&#039;&#039;: The most difficult part of these exercises is actually using the Queueing System. The python code itself is fairly easy, but getting the QS to work requires patience and experience. Check the QS examples in the powerpoint from last lecture&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. Don&#039;t be afraid to consult the &#039;&#039;man&#039;&#039; pages on a slurm command. Great options are hidden there, f.ex how to get rid of header on output&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;&amp;#039;&amp;#039;&amp;#039;1)&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;&amp;#039;&amp;#039;&amp;#039;1)&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22112/index.php?title=Distributed_computing&amp;diff=105&amp;oldid=prev</id>
		<title>WikiSysop at 20:44, 6 August 2025</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22112/index.php?title=Distributed_computing&amp;diff=105&amp;oldid=prev"/>
		<updated>2025-08-06T20:44:50Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:44, 6 August 2025&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-l29&quot;&gt;Line 29:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 29:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;By naming/numbering the files in some systematic way, it is easier to collect them afterwards. Realize that you can test your code without using the QS, by simply running the worker directly. Also understand that this is an exercise in using the Queueing System, not in simple programming.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;By naming/numbering the files in some systematic way, it is easier to collect them afterwards. Realize that you can test your code without using the QS, by simply running the worker directly. Also understand that this is an exercise in using the Queueing System, not in simple programming.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;!--&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;In order to lighten your workload and lessen the confusion and grief the Queueing System can give you, I have made a a fairly general &amp;#039;&amp;#039;&amp;#039;submit to QS&amp;#039;&amp;#039;&amp;#039; python function for you to use if you wish.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;In order to lighten your workload and lessen the confusion and grief the Queueing System can give you, I have made a a fairly general &amp;#039;&amp;#039;&amp;#039;submit to QS&amp;#039;&amp;#039;&amp;#039; python function for you to use if you wish.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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 command you submit is a string (which you can construct), and the command itself. The command must be a &amp;quot;simple&amp;quot; one meaning a program with options and parameters as you would write it on the command line.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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 command you submit is a string (which you can construct), and the command itself. The command must be a &amp;quot;simple&amp;quot; one meaning a program with options and parameters as you would write it on the command line.&lt;/div&gt;&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-l154&quot;&gt;Line 154:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 155:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;unix_call(&amp;#039;myprogram myfile.fsa&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;unix_call(&amp;#039;myprogram myfile.fsa&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;--&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;&amp;#039;&amp;#039;&amp;#039;2)&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;&amp;#039;&amp;#039;&amp;#039;2)&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;/div&gt;&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-l168&quot;&gt;Line 168:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 169:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Some ideas to wait for the jobs to be done.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Some ideas to wait for the jobs to be done.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;* Waiting and checking for all output files to appear. Cons; If a worker job breaks during execution you wait forever since the output file does not appear. If the output file is big, The worker might not have finished writing to it before collection starts. A trick to avoid this is for the worker to make an extra empty file at the end of the job and check for the presence of that file. An alternative is to write the file using a temporary filename, and rename the file to the correct name, when done writing.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;* Waiting and checking for all output files to appear. Cons; If a worker job breaks during execution you wait forever since the output file does not appear. If the output file is big, The worker might not have finished writing to it before collection starts. A trick to avoid this is for the worker to make an extra empty file at the end of the job and check for the presence of that file. An alternative is to write the file using a temporary filename, and rename the file to the correct name, when done writing.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;* Using &#039;&#039;&#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;showq&#039;&#039;&#039;/&#039;&#039;&#039;qstat&lt;/del&gt;&#039;&#039;&#039; to check that the jobs are gone from the queue. You need to find a way to recognize your jobs. That can be to name them or get the jobid from when you submit the job or perhaps just show your jobs (not everybody’s). When the list is empty, you are done. Cons; If you submit fast enough, the jobs might not have had time enough to show up in the queue, misleading you to think you are done. If you just use the ”your own jobs” method, you can only run one main job at a time, i.e. compute on one project only.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;* Using &#039;&#039;&#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;squeue&lt;/ins&gt;&#039;&#039;&#039; to check that the jobs are gone from the queue. You need to find a way to recognize your jobs. That can be to name them or get the jobid from when you submit the job or perhaps just show your jobs (not everybody’s). When the list is empty, you are done. Cons; If you submit fast enough, the jobs might not have had time enough to show up in the queue, misleading you to think you are done. If you just use the ”your own jobs” method, you can only run one main job at a time, i.e. compute on one project only.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;* Using &#039;&#039;&#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;showq&#039;&#039;&#039;/&#039;&#039;&#039;qstat&lt;/del&gt;&#039;&#039;&#039; to show completed jobs. When your jobs are in the list, they are done&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. Cons; Jobs are only in the completed queue for 2 hours. So you need hourly checking and remembering what is finished.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;* Using &#039;&#039;&#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sacct&lt;/ins&gt;&#039;&#039;&#039; to show completed jobs. When your jobs are in the list, they are done.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* Submit the collector being dependent on all worker jobs finishing OK. You probably need to look up details on &#039;&#039;&#039;qsub –W&#039;&#039;&#039; option before you can do this. This may not work if your jobs completes so quickly, that they are finished when the collector is queued&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22112/index.php?title=Distributed_computing&amp;diff=47&amp;oldid=prev</id>
		<title>WikiSysop: /* Material for the lesson */</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22112/index.php?title=Distributed_computing&amp;diff=47&amp;oldid=prev"/>
		<updated>2024-06-17T09:25:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Material for the lesson&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:25, 17 June 2024&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-l6&quot;&gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=a67ca717-9598-4169-9b52-af2701246519 Distributed computing]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=a67ca717-9598-4169-9b52-af2701246519 Distributed computing]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=e99121a6-df37-4d45-9891-af2701243c8a Profiling and subprocess]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=e99121a6-df37-4d45-9891-af2701243c8a Profiling and subprocess]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;Powerpoint: [https://teaching.healthtech.dtu.dk/material/22112/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;HPCLife03&lt;/del&gt;-Distributed.ppt Distributed computing]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;Powerpoint: [https://teaching.healthtech.dtu.dk/material/22112/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;22112_06&lt;/ins&gt;-Distributed.ppt Distributed computing]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=88d328c4-990a-4ce7-80cb-af1700719959 Exercises]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=88d328c4-990a-4ce7-80cb-af1700719959 Exercises]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22112/index.php?title=Distributed_computing&amp;diff=18&amp;oldid=prev</id>
		<title>WikiSysop at 10:52, 6 March 2024</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22112/index.php?title=Distributed_computing&amp;diff=18&amp;oldid=prev"/>
		<updated>2024-03-06T10:52:53Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:52, 6 March 2024&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-l6&quot;&gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=a67ca717-9598-4169-9b52-af2701246519 Distributed computing]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=a67ca717-9598-4169-9b52-af2701246519 Distributed computing]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=e99121a6-df37-4d45-9891-af2701243c8a Profiling and subprocess]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=e99121a6-df37-4d45-9891-af2701243c8a Profiling and subprocess]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;Powerpoint: [https://teaching.healthtech.dtu.dk/material/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;36612&lt;/del&gt;/HPCLife03-Distributed.ppt Distributed computing]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;Powerpoint: [https://teaching.healthtech.dtu.dk/material/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;22112&lt;/ins&gt;/HPCLife03-Distributed.ppt Distributed computing]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=88d328c4-990a-4ce7-80cb-af1700719959 Exercises]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=88d328c4-990a-4ce7-80cb-af1700719959 Exercises]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; 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;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22112/index.php?title=Distributed_computing&amp;diff=17&amp;oldid=prev</id>
		<title>WikiSysop: Created page with &quot;{| width=500  style=&quot;float:right; margin-left: 10px; margin-top: -56px;&quot; |Previous: Queueing System |Next: What affects performance |} == Material for the lesson == Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=a67ca717-9598-4169-9b52-af2701246519 Distributed computing]&lt;br&gt; Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=e99121a6-df37-4d45-9891-af2701243c8a Profiling and subprocess]&lt;br&gt; Powerpoint: [https://teaching.healthtech.dtu.dk/mat...&quot;</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22112/index.php?title=Distributed_computing&amp;diff=17&amp;oldid=prev"/>
		<updated>2024-03-06T10:52:27Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{| width=500  style=&amp;quot;float:right; margin-left: 10px; margin-top: -56px;&amp;quot; |Previous: &lt;a href=&quot;/22112/index.php/Queueing_System&quot; title=&quot;Queueing System&quot;&gt;Queueing System&lt;/a&gt; |Next: &lt;a href=&quot;/22112/index.php/What_affects_performance&quot; title=&quot;What affects performance&quot;&gt;What affects performance&lt;/a&gt; |} == Material for the lesson == Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=a67ca717-9598-4169-9b52-af2701246519 Distributed computing]&amp;lt;br&amp;gt; Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=e99121a6-df37-4d45-9891-af2701243c8a Profiling and subprocess]&amp;lt;br&amp;gt; Powerpoint: [https://teaching.healthtech.dtu.dk/mat...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{| width=500  style=&amp;quot;float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[Queueing System]]&lt;br /&gt;
|Next: [[What affects performance]]&lt;br /&gt;
|}&lt;br /&gt;
== Material for the lesson ==&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=a67ca717-9598-4169-9b52-af2701246519 Distributed computing]&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=e99121a6-df37-4d45-9891-af2701243c8a Profiling and subprocess]&amp;lt;br&amp;gt;&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/36612/HPCLife03-Distributed.ppt Distributed computing]&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=88d328c4-990a-4ce7-80cb-af1700719959 Exercises]&lt;br /&gt;
&lt;br /&gt;
[https://evaluering.dtu.dk/ Do midterm evaluation] &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;lt;-- Important to do this week - Friday latest&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Exercises ==&lt;br /&gt;
Using the Queueing System to do distributed computing. &amp;#039;&amp;#039;&amp;#039;Warning&amp;#039;&amp;#039;&amp;#039;: The most difficult part of these exercises is actually using the Queueing System. The python code itself is fairly easy, but getting the QS to work requires patience and experience. Check the QS examples in the powerpoint from last lecture.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;1)&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Return to last time’s exercise; read a fasta file, find the reverse complement for each entry and count the bases in the entry putting the numbers in the header line and save it all in one file.&lt;br /&gt;
Now solve this using the method on slide 5, i.e. distributed programming in embarrassingly parallel fashion.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Test your programs on the small scale humantest.fsa file.&amp;#039;&amp;#039;&amp;#039; When ready try the real human.fsa.&lt;br /&gt;
&lt;br /&gt;
You have to make several programs; the administrator, the worker and the collector.&lt;br /&gt;
&lt;br /&gt;
The administrator splits up the original input fasta file into several pieces (one fasta sequence per piece) and submits a job per piece (the worker) with the relevant file piece as input.&lt;br /&gt;
The worker which reads a file with one fasta sequence (given), computes the complement strand and base count and outputs the result to a file (given).&lt;br /&gt;
The collector program that collects all the result pieces and put them together in the original order in one file. This you run by yourself after the worker jobs finished. The structure of the administrator is like&lt;br /&gt;
 foreach fastasequence in inputfile&lt;br /&gt;
     save fastasequence in file.x&lt;br /&gt;
     submit job with file.x&lt;br /&gt;
By naming/numbering the files in some systematic way, it is easier to collect them afterwards. Realize that you can test your code without using the QS, by simply running the worker directly. Also understand that this is an exercise in using the Queueing System, not in simple programming.&lt;br /&gt;
&lt;br /&gt;
In order to lighten your workload and lessen the confusion and grief the Queueing System can give you, I have made a a fairly general &amp;#039;&amp;#039;&amp;#039;submit to QS&amp;#039;&amp;#039;&amp;#039; python function for you to use if you wish.&lt;br /&gt;
The command you submit is a string (which you can construct), and the command itself. The command must be a &amp;quot;simple&amp;quot; one meaning a program with options and parameters as you would write it on the command line.&lt;br /&gt;
It does not offer the the convenience of the shell, meaning that piping, IO-redirection and wildcards does not work. Realize that a great source of error is not using full path to programs and files.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def submit(command, directory=&amp;#039;&amp;#039;, modules=&amp;#039;&amp;#039;, runtime, cores, ram, group=&amp;#039;pr_course&amp;#039;,&lt;br /&gt;
    jobscript=&amp;#039;jobscript&amp;#039;, output=&amp;#039;/dev/null&amp;#039;, error=&amp;#039;/dev/null&amp;#039;):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    Function to submit a job to the Queueing System - with jobscript file&lt;br /&gt;
    Parameters are:&lt;br /&gt;
    command:   The command/program you want executed together with any parameters.&lt;br /&gt;
               Must use full path unless the directory is given and program is there. &lt;br /&gt;
    directory: Working directory - where should your program run, place of your data.&lt;br /&gt;
               If not specified, uses current directory.&lt;br /&gt;
    modules:   String of space separated modules needed for the run.&lt;br /&gt;
    runtime:   Time in minutes set aside for execution of the job.&lt;br /&gt;
    cores:     How many cores are used for the job.&lt;br /&gt;
    ram:       How much memory in GB is used for the job.&lt;br /&gt;
    group:     Accounting - which group pays for the compute.&lt;br /&gt;
    jobscript: Standard name for the jobscript that needs to be made.&lt;br /&gt;
               You should number your jobscripts if you submit more than one.&lt;br /&gt;
    output:    Output file of your job.&lt;br /&gt;
    error:     Error file of your job.&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    runtime = int(runtime)&lt;br /&gt;
    cores = int(cores)&lt;br /&gt;
    ram = int(ram)&lt;br /&gt;
    if cores &amp;gt; 10:&lt;br /&gt;
        print(&amp;quot;Can&amp;#039;t use more than 10 cores on a node&amp;quot;)&lt;br /&gt;
        sys.exit(1)&lt;br /&gt;
    if ram &amp;gt; 120:&lt;br /&gt;
        print(&amp;quot;Can&amp;#039;t use more than 120 GB on a node&amp;quot;)&lt;br /&gt;
        sys.exit(1)&lt;br /&gt;
    if runtime &amp;lt; 1:&lt;br /&gt;
        print(&amp;quot;Must allocate at least 1 minute runtime&amp;quot;)&lt;br /&gt;
        sys.exit(1)&lt;br /&gt;
    minutes = runtime % 60&lt;br /&gt;
    hours = int(runtime/60)&lt;br /&gt;
    walltime = &amp;quot;{:d}:{:02d}:00&amp;quot;.format(hours, minutes)&lt;br /&gt;
    if directory == &amp;#039;&amp;#039;:&lt;br /&gt;
        directory = os.getcwd()&lt;br /&gt;
    # Making a jobscript&lt;br /&gt;
    script = &amp;#039;#!/bin/sh\n&amp;#039;&lt;br /&gt;
    script += &amp;#039;#PBS -A &amp;#039; + group + &amp;#039; -W group_list=&amp;#039; + group + &amp;#039;\n&amp;#039;&lt;br /&gt;
    script += &amp;#039;#PBS -e &amp;#039; + error + &amp;#039; -o &amp;#039; + output + &amp;#039;\n&amp;#039;&lt;br /&gt;
    script += &amp;#039;#PBS -d &amp;#039; + directory + &amp;#039;\n&amp;#039;&lt;br /&gt;
    script += &amp;#039;#PBS -l nodes=1:ppn=&amp;#039; + str(cores) + &amp;#039;,mem=&amp;#039; + str(ram) + &amp;#039;GB&amp;#039; + &amp;#039;\n&amp;#039;&lt;br /&gt;
    script += &amp;#039;#PBS -l walltime=&amp;#039; + walltime + &amp;#039;\n&amp;#039;&lt;br /&gt;
    if modules != &amp;#039;&amp;#039;:&lt;br /&gt;
        script += &amp;#039;module load &amp;#039; + modules + &amp;#039;\n&amp;#039;&lt;br /&gt;
    script += command + &amp;#039;\n&amp;#039;&lt;br /&gt;
    if not jobscript.startswith(&amp;#039;/&amp;#039;):&lt;br /&gt;
        jobscript = directory + &amp;#039;/&amp;#039; + jobscript&lt;br /&gt;
    with open(jobscript, &amp;#039;wt&amp;#039;) as jobfile:&lt;br /&gt;
        jobfile.write(script)&lt;br /&gt;
    # The submit&lt;br /&gt;
    job = subprocess.run([&amp;#039;qsub&amp;#039;, jobscript],stdout=subprocess.PIPE, universal_newlines=True) &lt;br /&gt;
    jobid = job.stdout.split(&amp;#039;.&amp;#039;)[0]&lt;br /&gt;
    return jobid&lt;br /&gt;
&lt;br /&gt;
def submit2(command, directory=&amp;#039;&amp;#039;, modules=&amp;#039;&amp;#039;, runtime, cores, ram, group=&amp;#039;pr_course&amp;#039;,&lt;br /&gt;
    output=&amp;#039;/dev/null&amp;#039;, error=&amp;#039;/dev/null&amp;#039;):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    Function to submit a job to the Queueing System - without jobscript file&lt;br /&gt;
    Parameters are:&lt;br /&gt;
    command:   The command/program you want executed together with any parameters.&lt;br /&gt;
               Must use full path unless the directory is given and program is there. &lt;br /&gt;
    directory: Working directory - where should your program run, place of your data.&lt;br /&gt;
               If not specified, uses current directory.&lt;br /&gt;
    modules:   String of space separated modules needed for the run.&lt;br /&gt;
    runtime:   Time in minutes set aside for execution of the job.&lt;br /&gt;
    cores:     How many cores are used for the job.&lt;br /&gt;
    ram:       How much memory in GB is used for the job.&lt;br /&gt;
    group:     Accounting - which group pays for the compute.&lt;br /&gt;
    output:    Output file of your job.&lt;br /&gt;
    error:     Error file of your job.&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    runtime = int(runtime)&lt;br /&gt;
    cores = int(cores)&lt;br /&gt;
    ram = int(ram)&lt;br /&gt;
    if cores &amp;gt; 10:&lt;br /&gt;
        print(&amp;quot;Can&amp;#039;t use more than 10 cores on a node&amp;quot;)&lt;br /&gt;
        sys.exit(1)&lt;br /&gt;
    if ram &amp;gt; 120:&lt;br /&gt;
        print(&amp;quot;Can&amp;#039;t use more than 120 GB on a node&amp;quot;)&lt;br /&gt;
        sys.exit(1)&lt;br /&gt;
    if runtime &amp;lt; 1:&lt;br /&gt;
        print(&amp;quot;Must allocate at least 1 minute runtime&amp;quot;)&lt;br /&gt;
        sys.exit(1)&lt;br /&gt;
    minutes = runtime % 60&lt;br /&gt;
    hours = int(runtime/60)&lt;br /&gt;
    walltime = &amp;quot;{:d}:{:02d}:00&amp;quot;.format(hours, minutes)&lt;br /&gt;
    if directory == &amp;#039;&amp;#039;:&lt;br /&gt;
        directory = os.getcwd()&lt;br /&gt;
    # Making a jobscript&lt;br /&gt;
    script = &amp;#039;#!/bin/sh\n&amp;#039;&lt;br /&gt;
    script += &amp;#039;#PBS -A &amp;#039; + group + &amp;#039; -W group_list=&amp;#039; + group + &amp;#039;\n&amp;#039;&lt;br /&gt;
    script += &amp;#039;#PBS -e &amp;#039; + error + &amp;#039; -o &amp;#039; + output + &amp;#039;\n&amp;#039;&lt;br /&gt;
    script += &amp;#039;#PBS -d &amp;#039; + directory + &amp;#039;\n&amp;#039;&lt;br /&gt;
    script += &amp;#039;#PBS -l nodes=1:ppn=&amp;#039; + str(cores) + &amp;#039;,mem=&amp;#039; + str(ram) + &amp;#039;GB&amp;#039; + &amp;#039;\n&amp;#039;&lt;br /&gt;
    script += &amp;#039;#PBS -l walltime=&amp;#039; + walltime + &amp;#039;\n&amp;#039;&lt;br /&gt;
    if modules != &amp;#039;&amp;#039;:&lt;br /&gt;
        script += &amp;#039;module load &amp;#039; + modules + &amp;#039;\n&amp;#039;&lt;br /&gt;
    script += command + &amp;#039;\n&amp;#039;&lt;br /&gt;
    # The submit&lt;br /&gt;
    job = subprocess.run([&amp;#039;qsub&amp;#039;], input=script, stdout=subprocess.PIPE, universal_newlines=True) &lt;br /&gt;
    jobid = job.stdout.split(&amp;#039;.&amp;#039;)[0]&lt;br /&gt;
    return jobid&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Is used like&lt;br /&gt;
jobid = submit(&amp;#039;myprogram myfile.fsa&amp;#039;, directory=&amp;#039;/home/projects/pr_course/people/pwsa&amp;#039;,&lt;br /&gt;
               modules=&amp;#039;tools anaconda3/4.0.0&amp;#039;, jobscript=&amp;#039;job.1&amp;#039;,  runtime=10, cores=1, ram=2)&lt;br /&gt;
jobid = submit2(&amp;#039;myprogram myfile.fsa&amp;#039;, directory=&amp;#039;/home/projects/pr_course/people/pwsa&amp;#039;,&lt;br /&gt;
                modules=&amp;#039;tools anaconda3/4.0.0&amp;#039;, runtime=10, cores=1, ram=2)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can make almost the entire program on your own laptop if you substitute the below function with above function. Below just calls the worker sequentially not using the QS. You loose all the distribution the QS offers,&lt;br /&gt;
but avoid using computerome (and waiting for time). It is great in the development phase.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Submit to the queueing system, runtime in minutes, ram in GB&lt;br /&gt;
def unix_call(command):&lt;br /&gt;
    job = subprocess.run(command.split()) &lt;br /&gt;
&lt;br /&gt;
# Is used like&lt;br /&gt;
unix_call(&amp;#039;myprogram myfile.fsa&amp;#039;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;2)&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Make the administrator and collector into one program. &lt;br /&gt;
 foreach fastasequence in inputfile&lt;br /&gt;
     save fastasequence in file.x&lt;br /&gt;
     submit job with file.x&lt;br /&gt;
 wait for all jobs to finish&lt;br /&gt;
 collect data&lt;br /&gt;
&lt;br /&gt;
It is more difficult to solve this exercise - so do number 1 first. You need to find a way of waiting for your worker jobs to be done before your start collecting. However, you can see if this distributed method is faster than last week’s sequential method.&lt;br /&gt;
&lt;br /&gt;
Some ideas to wait for the jobs to be done.&lt;br /&gt;
* Waiting and checking for all output files to appear. Cons; If a worker job breaks during execution you wait forever since the output file does not appear. If the output file is big, The worker might not have finished writing to it before collection starts. A trick to avoid this is for the worker to make an extra empty file at the end of the job and check for the presence of that file. An alternative is to write the file using a temporary filename, and rename the file to the correct name, when done writing.&lt;br /&gt;
* Using &amp;#039;&amp;#039;&amp;#039;showq&amp;#039;&amp;#039;&amp;#039;/&amp;#039;&amp;#039;&amp;#039;qstat&amp;#039;&amp;#039;&amp;#039; to check that the jobs are gone from the queue. You need to find a way to recognize your jobs. That can be to name them or get the jobid from when you submit the job or perhaps just show your jobs (not everybody’s). When the list is empty, you are done. Cons; If you submit fast enough, the jobs might not have had time enough to show up in the queue, misleading you to think you are done. If you just use the ”your own jobs” method, you can only run one main job at a time, i.e. compute on one project only.&lt;br /&gt;
* Using &amp;#039;&amp;#039;&amp;#039;showq&amp;#039;&amp;#039;&amp;#039;/&amp;#039;&amp;#039;&amp;#039;qstat&amp;#039;&amp;#039;&amp;#039; to show completed jobs. When your jobs are in the list, they are done. Cons; Jobs are only in the completed queue for 2 hours. So you need hourly checking and remembering what is finished.&lt;br /&gt;
* Submit the collector being dependent on all worker jobs finishing OK. You probably need to look up details on &amp;#039;&amp;#039;&amp;#039;qsub –W&amp;#039;&amp;#039;&amp;#039; option before you can do this. This may not work if your jobs completes so quickly, that they are finished when the collector is queued.&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
</feed>