{"id":3914,"date":"2019-09-03T10:47:12","date_gmt":"2019-09-03T09:47:12","guid":{"rendered":"http:\/\/ri.itservices.manchester.ac.uk\/csf3\/?page_id=3914"},"modified":"2026-04-08T14:20:10","modified_gmt":"2026-04-08T13:20:10","slug":"julia","status":"publish","type":"page","link":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/software\/applications\/julia\/","title":{"rendered":"Julia"},"content":{"rendered":"<div class=\"hint\">\n<em>If you are a windows user &#8211; please ensure you create your jobscript ON THE CSF directly using <a href=\"\/csf3\/software\/tools\/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=\"\/csf3\/getting-started\/using-from-windows\/\">guide to using the system from windows<\/a>, in particular the section about <a href=\"\/csf3\/getting-started\/using-from-windows\/#textfiles\">text &amp; batch submission script files<\/a><\/em>.\n<\/div>\n<h2>Overview<\/h2>\n<p>Julia Base is installed as a module, Julia packages should be installed yourself using the <a href=\"https:\/\/docs.julialang.org\/en\/v1\/stdlib\/Pkg\/\">Pkg functionality<\/a>. Package installation can be done interactively on the login nodes, just make sure you submit a Slurm job for your actual code.<\/p>\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 apps\/binapps\/julia\/1.12.5\r\nmodule load apps\/binapps\/julia\/1.10.11\r\nmodule load apps\/binapps\/julia\/1.10.0\r\nmodule load apps\/binapps\/julia\/1.9.1\r\nmodule load apps\/binapps\/julia\/1.6.2\r\nmodule load apps\/binapps\/julia\/1.4.0\r\nmodule load apps\/binapps\/julia\/1.3.0\r\nmodule load apps\/binapps\/julia\/1.1.1\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, SGE. 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>@login1[csf3] ~]$ module load apps\/binapps\/julia\/1.10.0\r\n[<em>username<\/em>@login1[csf3] ~]$ srun -p interactive -t 60 --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\/<em>xy01<\/em>\/<em>username<\/em>\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>Installing packages<\/h3>\n<p>Using an interactive session (see above):<\/p>\n<pre>\r\njulia> ]\r\n(@v1.10) pkg> add Example\r\njulia> import Example\r\n<\/pre>\n<p>Further info about Julia package management can be found in <a href=\"https:\/\/docs.julialang.org\/en\/v1\/stdlib\/Pkg\/\">the official Julia docs.<\/a><\/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     # Use the nodes dedicated to 1-core jobs\r\n#SBATCH -t 4-0        # Max wall clock time (4-0 is 4 days, max permitted is 7-0)\r\n\r\nmodule purge\r\nmodule load apps\/binapps\/julia\/1.10.0\r\n\r\njulia myscript.jl\r\n<\/pre>\n<p>Submit the jobscript using: <\/p>\n<pre>sbatch <em>jobscriptname<\/em><\/pre>\n<p>where <code>jobscriptname<\/code> is the name of your jobscript.<\/p>\n<h3>Single node parallel batch job submission (2-168 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  # Use the AMD nodes dedicated to multi-core jobs\r\n#SBATCH -n 8          # (or --ntasks=) Number of cores (can be 2-168)\r\n#SBATCH -t 4-0        # Max wall clock time (4-0 is 4 days, max permitted is 7-0)\r\n\r\nmodule purge\r\nmodule load apps\/binapps\/julia\/1.10.0\r\n\r\n# $SLURM_NTASKS will be set to the number on the -n line above\r\njulia -p $SLURM_NTASKS myscript.jl\r\n<\/pre>\n<p>Submit the jobscript using: <\/p>\n<pre>sbatch <em>jobscriptname<\/em><\/pre>\n<p>where <code>jobscriptname<\/code> is the name of your jobscript.<\/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 Julia Base is installed as a module, Julia packages should.. <a href=\"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/software\/applications\/julia\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"parent":86,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-3914","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/3914","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/comments?post=3914"}],"version-history":[{"count":20,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/3914\/revisions"}],"predecessor-version":[{"id":12246,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/3914\/revisions\/12246"}],"up":[{"embeddable":true,"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/pages\/86"}],"wp:attachment":[{"href":"https:\/\/ri.itservices.manchester.ac.uk\/csf3\/wp-json\/wp\/v2\/media?parent=3914"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}