{"id":1020,"date":"2023-03-13T10:35:46","date_gmt":"2023-03-13T10:35:46","guid":{"rendered":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/?page_id=1020"},"modified":"2023-03-16T15:57:45","modified_gmt":"2023-03-16T15:57:45","slug":"julia","status":"publish","type":"page","link":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/software\/applications\/julia\/","title":{"rendered":"Julia"},"content":{"rendered":"<table class=\"hint\">\n<tr>\n<td><em>If you are a windows user &#8211; please ensure you create your jobscript ON THE CSF directly using <a href=\"\/csf4\/software\/applications\/gedit\/\/\">gedit<\/a>. This will prevent your job going into error (Eqw). Text files created on windows have hidden characters that linux cannot read. For further information please see the <a href=\"\/csf4\/getting-started\/using-from-windows\/\">guide to using the system from windows<\/a>, in particular the section about <a href=\"\/csf4\/getting-started\/using-from-windows\/#textfiles\">text &amp; batch submission script files<\/a><\/em>.\n<\/td>\n<\/tr>\n<\/table>\n<h2>Overview<\/h2>\n<h2>Set up procedure<\/h2>\n<p>Julia can be accessed by loading ONE of the module files as follows:<\/p>\n<pre>\r\nmodule load julia\/1.4.2-linux-x86_64\r\n<\/pre>\n<h2>Running the application<\/h2>\n<p>Please do not run Julia on the login nodes. Jobs should instead be submitted to the compute nodes via the batch system, SLURM. Some example jobs are given below.<\/p>\n<h3>Interactive job<\/h3>\n<p>To use Julia interactively, first load a module and then run an interactive session as follows<\/p>\n<pre>\r\n[<em>username<\/em>@login01 [CSF4] ~]$ module load julia\/1.4.2-linux-x86_64\r\n[<em>username<\/em>@login01 [CSF4] ~]$ srun --pty julia\r\n<\/pre>\n<p>You will then be presented with an interactive julia prompt:<\/p>\n<pre>\r\njulia>\r\njulia> sin(pi\/2)\r\n1.0\r\n<\/pre>\n<p>You can switch to shell mode by pressing the <code>;<\/code> key, where you can run standard shell commands:<\/p>\n<pre>\r\nshell> pwd\r\n\/mnt\/iusers01\/mygroup\/me\r\n<\/pre>\n<p>Once you have run the shell command, or simply pressed <code>Return\/Enter<\/code>, you are immediately returned to the julia prompt.<\/p>\n<h3>Serial batch job submission<\/h3>\n<p>An example jobscript for a serial job is shown below:<\/p>\n<pre>\r\n#!\/bin\/bash --login\r\n#SBATCH -p serial         # Run a serial job\r\n#SBATCH -n 1              # Number of cores\r\n\r\n# Load the version you require\r\nmodule load julia\/1.4.2-linux-x86_64\r\n\r\njulia myscript.jl\r\n<\/pre>\n<p>Submit the jobscript using: <\/p>\n<pre>\r\nsbatch jobscript\r\n<\/pre>\n<p>where <code>jobscrip<\/code> is the name of your jobscript file.<\/p>\n<h3>Single node parallel batch job submission (2-40 cores)<\/h3>\n<p>An example jobscript for a single node SMP job is given below:<\/p>\n<pre>\r\n#!\/bin\/bash --login\r\n#SBATCH -p multicore       # Run a multicore job\r\n#SBATCH -n 8               # Number of cores (can be 2--40)\r\n\r\nmodule load julia\/1.4.2-linux-x86_64\r\n\r\njulia -p $SLURM_NTASKS myscript.jl\r\n<\/pre>\n<p>Submit the jobscript using: <\/p>\n<pre>\r\nsbatch scriptname\r\n<\/pre>\n<p>where <code>jobscrip<\/code> is the name of your jobscript file.<\/p>\n<h2>Further info<\/h2>\n<ul>\n<li><a href=\"https:\/\/julialang.org\">Julia website<\/a><\/li>\n<\/ul>\n<ul>\n<li><a href=\"https:\/\/docs.julialang.org\/en\/v1\/index.html\">Julia documentation<\/a><\/li>\n<\/ul>\n<h2>Updates<\/h2>\n<p>None.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are a windows user &#8211; please ensure you create your jobscript ON THE CSF directly using gedit. This will prevent your job going into error (Eqw). Text files created on windows have hidden characters that linux cannot read. For further information please see the guide to using the system from windows, in particular the section about text &amp; batch submission script files. Overview Set up procedure Julia can be accessed by loading ONE.. <a href=\"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/software\/applications\/julia\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"parent":49,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1020","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/pages\/1020","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/comments?post=1020"}],"version-history":[{"count":5,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/pages\/1020\/revisions"}],"predecessor-version":[{"id":1033,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/pages\/1020\/revisions\/1033"}],"up":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/pages\/49"}],"wp:attachment":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf4\/wp-json\/wp\/v2\/media?parent=1020"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}