<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Job Submission on SciComp Blog</title>
    <link>https://mpievolbio-scicomp.pages.gwdg.de/blog/tags/job-submission/</link>
    <description>Recent content in Job Submission on SciComp Blog</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Mon, 14 Dec 2020 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://mpievolbio-scicomp.pages.gwdg.de/blog/tags/job-submission/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Running matlab code on HPC with SLURM</title>
      <link>https://mpievolbio-scicomp.pages.gwdg.de/blog/post/2020-12-14_matlab_slurm/</link>
      <pubDate>Mon, 14 Dec 2020 00:00:00 +0000</pubDate>
      <guid>https://mpievolbio-scicomp.pages.gwdg.de/blog/post/2020-12-14_matlab_slurm/</guid>
      <description>&lt;h2 id=&#34;running-matlab-scripts-on-hpc&#34;&gt;Running MATLAB scripts on HPC&lt;/h2&gt;&#xA;&lt;p&gt;Today, the question came up how to run MATLAB code on HPC featuring a SLURM scheduler. The syntax for running matlab on the command line is indeed a bit counterintuitive, at least if you are (like me) used to running &lt;code&gt;python&lt;/code&gt; or &lt;code&gt;R&lt;/code&gt; scripts.&lt;/p&gt;&#xA;&lt;h3 id=&#34;example-slurm-script&#34;&gt;Example SLURM script&lt;/h3&gt;&#xA;&lt;p&gt;The following snippet is an example for how to submit a matlab script for execution on an HPC Server with the SLURM scheduler:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#! /bin/bash&#xA;# SBATCH -p &amp;lt;PARTITION&amp;gt;&#xA;# SBATCH -t &amp;lt;RUN TIME&amp;gt;&#xA;# SBATCH -N &amp;lt;NUMBER OF NODES&amp;gt;&#xA;# SBATCH -o job-%J.out&#xA;# SBATCH --mail-type=ALL&#xA;# SBATCH --mail-user=$USER&#xA;&#xA;module load matlab&#xA;matlab -nodesktop -nodisplay -nojvm -nosplash -r &amp;#34;&amp;lt;matlab_script_basename&amp;gt;&amp;#34;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;IMPORTANT:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;You must be in the directory containing the matlab script when you submit the batch job or configure the working directory or add a line&#xA;cd &amp;lt;directory_containing_matlab_script&amp;gt;&#xA;in the batch job script.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;The matlab script must have the extensios &amp;ldquo;.m&amp;rdquo;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Replace &lt;code&gt;&amp;lt;matlab_script_basename&amp;gt;&lt;/code&gt; with the filename of your matlab script but omit the extension. So if your matlab script is named &amp;ldquo;magic_script.m&amp;rdquo;, you have to write &amp;ldquo;magic_script&amp;rdquo; in the batch job.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;</description>
    </item>
  </channel>
</rss>
