{"id":4044,"date":"2018-08-27T12:50:05","date_gmt":"2018-08-27T12:50:05","guid":{"rendered":"http:\/\/escience.sdu.dk\/?page_id=4044"},"modified":"2018-08-27T12:59:53","modified_gmt":"2018-08-27T12:59:53","slug":"matlab-documentation","status":"publish","type":"page","link":"http:\/\/escience.sdu.dk\/index.php\/matlab-documentation\/","title":{"rendered":"MATLAB documentation"},"content":{"rendered":"<h3><strong>How can MATLAB be used?<\/strong><\/h3>\n<p>In the following we describe two main ways to use MATLAB at Abacus.<\/p>\n<ul>\n<li>Non-interactive Slurm script (recommended)<\/li>\n<li>Semi-interactive using a MATLAB GUI running on your own computer<\/li>\n<\/ul>\n<p>Note that MATLAB is currently only available for users from some of the Danish universites. For further information, have a look <a href=\"#hosting\">here<\/a>.<\/p>\n<h3><strong>Running MATLAB via a Slurm script<\/strong><\/h3>\n<p>The recommended way to use MATLAB on Abacus is to run it as a non-interactive Slurm batch script.<\/p>\n<p>To do this your MATLAB code must be able to run successfully from the command line prompt without the use of any graphics, i.e., the following must run successfully (given that your MATLAB code is saved in the file <tt>matlab_code.m<\/tt>).<\/p>\n<div class=\"codehilite\">\n<pre>sysop@fe1:~$ module add matlab\/R2016a # Use any of the available MATLAB versions\r\nsysop@fe1:~$ matlab -nodisplay -r matlab_code<\/pre>\n<\/div>\n<p>Next, to actually run your code, you must copy all the relevant files to Abacus, and next write a Slurm script as shown below. The sample sbatch script can be found on the Abacus frontend node at the location <tt>\/opt\/sys\/documentation\/sbatch-scripts\/matlab\/matlab-R2016a.sh<\/tt>.<\/p>\n<div class=\"codehilite\">\n<pre>#!\/bin\/bash\r\n#\r\n#SBATCH --nodes 1                 # number of nodes\r\n#SBATCH --time 2:00:00            # max time (HH:MM:SS)\r\n\r\necho Running on \"$(hostname)\"\r\necho Available nodes: \"$SLURM_NODELIST\"\r\necho Slurm_submit_dir: \"$SLURM_SUBMIT_DIR\"\r\necho Start time: \"$(date)\"\r\n\r\n# Load relevant modules\r\nmodule purge\r\nmodule add matlab\/R2016a\r\n\r\n# Run the MATLAB code available in matlab_code.m\r\n# (note the missing .m)\r\nmatlab -nodisplay -r matlab_code\r\n\r\necho Done.<\/pre>\n<\/div>\n<p>Note that by default, <em>this only runs on one compute node<\/em> even if multiple nodes are specified with e.g., <tt>--nodes 8<\/tt>. To use more nodes, you must use MDCS as shown further below.<\/p>\n<h3><strong>Running MATLAB via a MATLAB GUI on your own computer<\/strong><\/h3>\n<p>This guide describes how to use MATLAB on Abacus in combination with a MATLAB GUI running on your own computer\/laptop.<\/p>\n<p><strong>Requirements<br \/>\n<\/strong>Running MATLAB in this way requires a MATLAB MDCS (MATLAB Distributed Computing Server) license. Most users have such a license available (including e.g., SDU users), but some do not (currently e.g., <em>AAU users<\/em>).<\/p>\n<p>To check whether you have a valid MDCS license available run the following commands. If no errors are shown, you are ready to go. Otherwise you are welcome to contact us at <a href=\"mailto:support@escience.sdu.dk\">support@escience.sdu.dk<\/a>.<\/p>\n<div class=\"codehilite\">\n<pre>testuser@fe1:~$ module purge ; module add matlab\/R2017a\r\n...\r\ntestuser@fe1:~$ matlab -dmlworker -nodisplay -r exit\r\n\r\n&lt; M A T L A B (R) &gt;\r\nCopyright 1984-2017 The MathWorks, Inc.\r\nR2017a (9.2.0.538062) 64-bit (glnxa64)\r\nFebruary 23, 2017\r\n\r\nTo get started, type one of these: helpwin, helpdesk, or demo.\r\nFor product information, visit www.mathworks.com.<\/pre>\n<\/div>\n<p><strong><br \/>\nConfiguration<\/strong><br \/>\nDownload the configuration files corresponding to the MATLAB version running on your own computer.<\/p>\n<ul>\n<li>Configuration files for version R2015a to R2018a. <a href=\"http:\/\/escience.sdu.dk\/wp-content\/uploads\/2018\/08\/sdu.remote.r2018a.zip\">Download here.<\/a><\/li>\n<\/ul>\n<p>Unzip\/untar the file and place the contents in one of these two locations.<\/p>\n<ul>\n<li>If you have the right to do this on your computer, use the subfolder <tt>toolbox\/local<\/tt> inside the main MATLAB program folder. You can use the command <tt>matlabroot<\/tt> inside MATLAB to get the root folder of MATLAB, and then add <tt>toolbox\/local<\/tt>, e.g.,\n<ul>\n<li><tt>C:\\Program Files\\MATLAB\\R2017a\\toolbox\\local<\/tt><\/li>\n<li><tt>\/Applications\/MATLAB_R2017a.app\/toolbox\/local<\/tt><\/li>\n<li><tt>\/usr\/local\/matlab\/r2017a\/toolbox\/local<\/tt><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Otherwise use the folder returned by the command <tt>userpath<\/tt> inside MATLAB (usually <tt>My Documents\\MATLAB<\/tt> or <tt>Documents\\MATLAB<\/tt>).<\/p>\n<ul>\n<li>Start\/restart MATLAB.<\/li>\n<li>Configure MATLAB to run parallel jobs on the SDU cluster by calling <tt>configCluster<\/tt>. <tt>configCluster<\/tt> only needs to be called once per version of MATLAB (e.g. R2015a, R2015b, etc.)<\/li>\n<\/ul>\n<div class=\"codehilite\">\n<pre>&gt;&gt; configCluster\r\nUsername on ABACUS (e.g. joe): testuser\r\nClearing all ClusterInfo settings.\r\n\r\nBefore submitting a job to ABACUS, you must specify the account name.\r\n\r\n&gt;&gt; % E.g. set account name to sdutest_slim\r\n&gt;&gt; ClusterInfo.setProjectName('sdutest_slim')\r\n\r\nBefore submitting a job to ABACUS, you must specify the wall time.\r\n\r\n&gt;&gt; % E.g. set wall time to 1 hour\r\n&gt;&gt; ClusterInfo.setWallTime('01:00:00')\r\n\r\n&gt;&gt; ClusterInfo.setProjectName('sdutest_slim')\r\n&gt;&gt; ClusterInfo.setWallTime('01:00:00')\r\n&gt;&gt;\r\n&gt;&gt; % Jobs will now default to the cluster rather than running locally<\/pre>\n<\/div>\n<p>Note that the projectName as specified in <tt>ClusterInfo.setProjectName('sdutest_slim')<\/tt> is actually the Slurm account name, and must contain the node type as a suffix, i.e., <tt>_slim<\/tt>, <tt>_gpu<\/tt>, or <tt>_fat<\/tt>.<\/p>\n<p><strong>Credentials<br \/>\n<\/strong>At Abacus we only support access using ssh keys. The first time you submit a job to the cluster, you are asked for the location of your ssh private key file (usually <tt>id_rsa<\/tt> found in <tt>~\/.ssh<\/tt> &#8211; see our guide on <a href=\"http:\/\/escience.sdu.dk\/index.php\/ssh-setups\/\">how to use SSH keys<\/a>. You are also asked for the passphrase of the key. Note that MATLAB _cannot_ use a private key in the Windows Putty ppk format. You must use a key in OpenSSH format (the default format on Mac+Linux). For further information, look at our <a href=\"http:\/\/escience.sdu.dk\/index.php\/ssh-setups\/\">Windows SSH setup guide<\/a>.<\/p>\n<p>Both the user name and the location of the private key are stored with MATLAB so that you are not prompted for it at a later time. The passphrase is not saved, i.e., you are asked each time you start a new MATLAB session. If your key does not have a passphrase, you simply leave the passphrase field blank when asked.<\/p>\n<p><img loading=\"lazy\" src=\"http:\/\/escience.sdu.dk\/wp-content\/uploads\/2018\/08\/matlab-04c.png\" alt=\"\" class=\"alignnone wp-image-4047 size-full\" width=\"356\" height=\"268\" srcset=\"http:\/\/escience.sdu.dk\/wp-content\/uploads\/2018\/08\/matlab-04c.png 356w, http:\/\/escience.sdu.dk\/wp-content\/uploads\/2018\/08\/matlab-04c-300x226.png 300w\" sizes=\"(max-width: 356px) 100vw, 356px\" \/><\/p>\n<p><strong>Serial jobs<br \/>\n<\/strong>Use the <tt>batch<\/tt> command to submit asynchronous jobs to the cluster. The batch command will return a job object which is used to access the output of the submitted job. See the example below and see the MATLAB documentation for more help on <tt>batch<\/tt>.<\/p>\n<p>Note: In the example below, wait is used to ensure that the job has completed before requesting results. In regular use, one would not use wait, since a job might take an elongated period of time, and the MATLAB session can be used for other work while the submitted job executes.<\/p>\n<div class=\"codehilite\">\n<pre>&gt;&gt; % Get a handle to the cluster\r\n&gt;&gt; c = parcluster;\r\n&gt;&gt;\r\n&gt;&gt; % Submit a batch job to query where MATLAB is running on the cluster\r\n&gt;&gt; % The first time you do this, you are asked for your credentials (see above)\r\n&gt;&gt; j = c.batch(@pwd, 1, {}, 'CurrentFolder', '.');\r\n\r\nadditionalSubmitArgs =\r\n\r\n-n 1 -A sdutest_slim -t 01:00:00 --licenses=matlab:1\r\n\r\n&gt;&gt;\r\n&gt;&gt; % Wait for the job to finish before querying for results\r\n&gt;&gt; j.wait\r\n&gt;&gt;\r\n&gt;&gt; % Now that the job has completed, fetch the results\r\n&gt;&gt; j.fetchOutputs{:}\r\n\r\nans =\r\n\r\n\/gpfs\/gss1\/home\/testuser\r\n\r\n&gt;&gt;\r\n&gt;&gt; % No longer need the results, so delete the job\r\n&gt;&gt; j.delete\r\n&gt;&gt;<\/pre>\n<\/div>\n<p>If you leave out the <tt>'CurrentFolder', '.'<\/tt> part of <tt>c.batch<\/tt>, you get a warning about MATLAB not being able to change to a nonexistent directory. This can be ignored.<\/p>\n<p>To retrieve a list of currently running or completed jobs, call parcluster to retrieve the cluster object. The cluster object stores an array of jobs that were run, are running, or are queued to run. This allows us to fetch the results of completed jobs. Retrieve and view the list of jobs as shown below.<\/p>\n<div class=\"codehilite\">\n<pre>&gt;&gt; % Retrieve the results of past jobs from the cluster\r\n&gt;&gt; jobs = c.Jobs\r\n\r\njobs =\r\n\r\n4x1 Job array:\r\n\r\nID Type State FinishDateTime Username Tasks\r\n------------------------------------------------------------------\r\n1 1 independent finished 23-Mar-2017 15:27:47 testuser 1\r\n2 2 pool finished 23-Mar-2017 15:32:03 testuser 1\r\n3 3 pool finished 07-Apr-2017 14:38:36 testuser 17\r\n4 4 independent queued testuser 1\r\n\r\n&gt;&gt;<\/pre>\n<\/div>\n<p>Once we&#8217;ve identified the job we want, we can retrieve the results as we&#8217;ve done previously. If the job produces an error, we can call the <tt>getDebugLog<\/tt> method to view the error log file. The error log can be lengthy and is not shown here. The example below will retrieve the results of job #3.<\/p>\n<p>NOTE: <tt>fetchOutputs<\/tt> is used to retrieve function output arguments. Data that has been written to files on the cluster needs be retrieved directly from the file system.<\/p>\n<div class=\"codehilite\">\n<pre>&gt;&gt; % Retrieve the results from the 3rd job\r\n&gt;&gt; j3 = jobs(3);\r\n&gt;&gt; j3.fetchOutputs{:}\r\n\r\nans =\r\n\r\n\/gpfs\/gss1\/home\/testuser\r\n\r\n&gt;&gt; % For debugging, retrieve the output\/error log file\r\n&gt;&gt; j3.Parent.getDebugLog(j3.Tasks(1))\r\nLOG FILE OUTPUT:\r\nExecuting: \/opt\/sys\/apps\/matlab\/R2017a\/bin\/worker\r\n\r\n&lt; M A T L A B (R) &gt;\r\nCopyright 1984-2017 The MathWorks, Inc.\r\nR2017a (9.2.0.538062) 64-bit (glnxa64)\r\nFebruary 23, 2017\r\n\r\nTo get started, type one of these: helpwin, helpdesk, or demo.\r\nFor product information, visit www.mathworks.com.\r\n\r\n2017-04-07 14:38:34 | About to exit MATLAB normally\r\n2017-04-07 14:38:34 | About to exit with code: 0\r\n\r\n&gt;&gt;<\/pre>\n<\/div>\n<p><strong><br \/>\nParallel jobs<\/strong><br \/>\nYou can also submit parallel workflows with <tt>batch<\/tt>. Let&#8217;s use the following example for a parallel job. The file is also available on the cluster as <tt>\/opt\/sys\/documentation\/sbatch-scripts\/matlab\/parallel_example.m<\/tt><\/p>\n<div class=\"codehilite\">\n<pre>%\r\n% parallel_example.m\r\n%\r\n\r\nfunction t = parallel_example(iter)\r\n\r\nif nargin==0, iter = 16; end\r\n\r\ndisp('Start sim');\r\n\r\nt0 = tic;\r\nparfor idx = 1:iter\r\n    A(idx) = idx;\r\n    pause(2);\r\nend\r\nt = toc(t0);\r\n\r\ndisp('Sim completed');<\/pre>\n<\/div>\n<p>We&#8217;ll use the <tt>batch<\/tt> command again, but since we&#8217;re running a parallel job, we&#8217;ll also specify a MATLAB Pool.<\/p>\n<div class=\"codehilite\">\n<pre>&gt;&gt; % 8 workers for 16 sims\r\n&gt;&gt; j = c.batch(@parallel_example, 1, {}, 'pool', 8, 'CurrentFolder', '.');\r\n\r\nadditionalSubmitArgs =\r\n\r\n-n 9 -A sysops_workq -t 01:00:00 --licenses=matlab:9\r\n\r\n&gt;&gt;\r\n&gt;&gt; % Wait for the job to finish before querying for results\r\n&gt;&gt; j.wait\r\n&gt;&gt;\r\n&gt;&gt; % Now that the job has completed, fetch the results\r\n&gt;&gt; j.fetchOutputs{:}\r\n\r\nans =\r\n\r\n4.6571\r\n\r\n&gt;&gt;<\/pre>\n<\/div>\n<p>The job ran in 4.66 seconds using eight workers. Note that these jobs will always request <em>N+1<\/em> CPU cores, since one worker is required to manage the batch job and pool of workers. For example, a job that needs eight workers will consume nine CPU cores.<\/p>\n<p>We&#8217;ll run the same simulation, but increase the pool size. Note, for some applications, there will be a diminishing return when allocating too many workers. This time, to retrieve the results at a later time, we&#8217;ll keep track of the job ID.<\/p>\n<div class=\"codehilite\">\n<pre>&gt;&gt; % 16 workers for 16 sims\r\n&gt;&gt; j = c.batch(@parallel_example, 1, {}, 'pool', 16, 'CurrentFolder', '.');\r\n\r\nadditionalSubmitArgs =\r\n\r\n-n 17 -A sysops_workq -t 0-1 --licenses=matlab:17\r\n\r\n&gt;&gt; % Get the job ID so that we can retrieve the results of the job after quitting\r\n&gt;&gt; id = j.ID\r\n\r\nid =\r\n\r\n5\r\n\r\n&gt;&gt;\r\n&gt;&gt; % clear the \"j\" variable as if we quit MATLAB\r\n&gt;&gt; clear j\r\n&gt;&gt;<\/pre>\n<\/div>\n<p>Once we have a handle to the cluster, we can later call the <tt>findJob<\/tt> method to search for the job with the specified job ID.<\/p>\n<div class=\"codehilite\">\n<pre>&gt;&gt; % Get a handle to the cluster\r\n&gt;&gt; c = parcluster;\r\n&gt;&gt;\r\n&gt;&gt; % Find the old job\r\n&gt;&gt; j = c.findJob('ID', 5);\r\n&gt;&gt;\r\n&gt;&gt; % Check that the state is finished\r\n&gt;&gt; j.State\r\n\r\nans =\r\n\r\nfinished\r\n\r\n&gt;&gt;\r\n&gt;&gt; % Now that the job has completed, fetch the results\r\n&gt;&gt; j.fetchOutputs{:}\r\n\r\nans =\r\n\r\n2.4176\r\n\r\n&gt;&gt;\r\n&gt;&gt; % For debugging, retrieve the output\/error log file (not included here)\r\n&gt;&gt; j.Parent.getDebugLog(j)<\/pre>\n<\/div>\n<p>The job now runs in 2.42 seconds using 16 workers. Run the code with different numbers of workers to determine the ideal number to use.<\/p>\n<p>Alternatively, to retrieve job results via a graphical user interface, use the Job Monitor, which can be found under <em>Parallel | Monitor Jobs<\/em> as shown below.<\/p>\n<p><img loading=\"lazy\" src=\"http:\/\/escience.sdu.dk\/wp-content\/uploads\/2018\/08\/matlab-12c.png\" alt=\"\" class=\"alignnone size-full wp-image-4048\" width=\"500\" height=\"291\" srcset=\"http:\/\/escience.sdu.dk\/wp-content\/uploads\/2018\/08\/matlab-12c.png 500w, http:\/\/escience.sdu.dk\/wp-content\/uploads\/2018\/08\/matlab-12c-300x175.png 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<p><strong><br \/>\nConfiguring jobs<br \/>\n<\/strong>Prior to submitting the job, we can specify:<\/p>\n<ul>\n<li>Account\/project, e.g. <tt>sdutest_slim<\/tt><\/li>\n<li>Email Notification (when the job is running, exiting, or aborting), and<\/li>\n<li>Wall time<\/li>\n<\/ul>\n<p>Specification is done with <tt>ClusterInfo<\/tt>. The <tt>ClusterInfo<\/tt> class supports tab completion to ease recollection of method names.<\/p>\n<div class=\"codehilite\">\n<pre>&gt;&gt; % configure job: Account, Email Notification, and Wall Time\r\n&gt;&gt; c = parcluster;\r\n&gt;&gt;\r\n&gt;&gt; % use sdutest_slim account\r\n&gt;&gt; ClusterInfo.setProjectName('sdutest_slim')\r\n&gt;&gt;\r\n&gt;&gt; % Specify email notification and end of job\r\n&gt;&gt; % (you can also use e.g., ALL, see --mail-type in man sbatch)\r\n&gt;&gt; ClusterInfo.setEmailNotification('END')\r\n&gt;&gt;\r\n&gt;&gt; % Request 2 hours of wall time\r\n&gt;&gt; ClusterInfo.setWallTime('02:00:00')\r\n&gt;&gt;\r\n&gt;&gt; % 8 workers for 32 sims\r\n&gt;&gt; j = c.batch(@parallel_example, 1, {32}, 'pool', 8, 'CurrentFolder', '.');\r\n\r\nadditionalSubmitArgs =\r\n\r\n-n 9 -A sdutest_slim -t 02:00:00 --mail-type=\"END\" --licenses=matlab:9<\/pre>\n<\/div>\n<p>Any parameters set with <tt>ClusterInfo<\/tt> will be persistent both between jobs and MATLAB sessions. To see the values of the current configuration options, call the state method. To clear a value, assign the property the appropriate empty value (&#8221;, [], or false).<\/p>\n<div class=\"codehilite\">\n<pre>&gt;&gt; ClusterInfo.state\r\n\r\nArch :\r\nClusterHost :\r\nDataParallelism :\r\nDiskSpace :\r\nEmailNotification : END\r\nGpusPerNode :\r\nMemUsage :\r\nPrivateKeyFile : \/Users\/testuser\/.ssh\/id_rsa\r\nPrivateKeyFileHasPassPhrase : 1\r\nProcsPerNode :\r\nProjectName : sdutest_slim\r\nQueueName :\r\nRequireExclusiveNode : 0\r\nReservation :\r\nSshPort :\r\nUseGpu : 0\r\nUserDefinedOptions :\r\nUserNameOnCluster : testuser\r\nWallTime : 02:00:00\r\n&gt;&gt;\r\n&gt;&gt; % Turn off email notification\r\n&gt;&gt; ClusterInfo.setEmailNotification('')\r\n&gt;&gt;<\/pre>\n<\/div>\n<p><strong><br \/>\nTo learn more<br \/>\n<\/strong>To learn more about the MATLAB Parallel Computing Toolbox, check out these resources from MathWorks:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.mathworks.com\/products\/parallel-computing\/code-examples.html\">Parallel Computing Coding Examples<\/a><\/li>\n<li><a href=\"http:\/\/www.mathworks.com\/help\/distcomp\/\">Parallel Computing Documentation<\/a><\/li>\n<li><a href=\"http:\/\/www.mathworks.com\/products\/parallel-computing\/\">Parallel Computing Overview<\/a><\/li>\n<li><a href=\"http:\/\/www.mathworks.com\/products\/parallel-computing\/tutorials.html\">Parallel Computing Tutorials<\/a><\/li>\n<li><a href=\"http:\/\/www.mathworks.com\/products\/parallel-computing\/videos.html\">Parallel Computing Videos<\/a><\/li>\n<li><a href=\"http:\/\/www.mathworks.com\/products\/parallel-computing\/webinars.html\">Parallel Computing Webinars<\/a><\/li>\n<\/ul>\n<p><strong id=\"hosting\"><br \/>\nMATLAB Hosting Provider Agreement<\/strong><br \/>\nAbacus 2.0 has a <em>Hosting Provider Agreement<\/em> with MathWorks that allows us to install MATLAB on our system and have users provide their own licence to access it. In particular, if your university has a licence for MATLAB that you can use on the computer in your office then it will most likely be possible to use it on our systems.<\/p>\n<p>To do this you need to checkout a licence directly from your university&#8217;s licence servers &#8211; contact us at <a href=\"mailto:support@escience.sdu.dk\">support@escience.sdu.dk<\/a> to determine if this has already been setup. Please use your official university e-mail address for this.<\/p>\n<p>If it\u2019s not already set up, we will ask you to contact your licence administrator to ask them to provide us with the details of their licence server.<\/p>\n<p>Currently we have a setup for users from AU, AAU, DTU, KU, and SDU.<\/p>\n<p><strong id=\"known_issues\"><br \/>\nKnown issues<\/strong><br \/>\nList of currently known issues.<\/p>\n<p><strong>Parpool does not work<br \/>\n<\/strong>If you try to submit a job using parpool in MATLAB (including if you do a &#8220;Parallel pool test&#8221; in the MATLAB Cluster Profile Manager), this will fail with an error about parpool not being supported. This is an expected error, and as shown in the error message, you should instead use <tt>batch<\/tt> as shown in the examples above.<\/p>\n<div class=\"codehilite\">\n<pre>&gt;&gt; parpool('abacus_remote_r2017a',12)\r\n...\r\nStarting parallel pool (parpool) using the 'abacus_remote_r2017a' profile ...\r\nError using parpool (line 104). Failed to start a parallel pool.\r\n...\r\n****************************************************\r\nabacus_remote_r2017a does not support calling\r\n&gt;&gt; parpool('abacus_remote_r2017a',12)\r\nInstead, use batch()\r\n&gt;&gt; job = batch(...,'pool',12);\r\nCall\r\n&gt;&gt; doc batch\r\nfor more help on using batch.\r\n****************************************************<\/pre>\n<\/div>\n<p><strong><br \/>\nWarning: Unable to change to requested folder<br \/>\n<\/strong>When submitting jobs using <tt>batch<\/tt>, you must also supply two additional parameters (<tt>CurrentFolder', '.'<\/tt>), otherwise you get a warning about MATLAB not being able to change to the requested folder. When submitting the job MATLAB records which folder the job was starting from on you own computer\/laptop and tries to start the job on Abacus in the same folder. As the folder most probably does not exist, you get a warning. The warning can be ignored.<\/p>\n<div class=\"codehilite\">\n<pre>&gt;&gt; j = c.batch(@pwd, 1, {}); j.wait; j.fetchOutputs{:}\r\n\r\nadditionalSubmitArgs =\r\n\r\n'-n 1 -A sysops_workq -t 01:00:00 --licenses=matlab:1'\r\n\r\nWarning: The task with ID 1 issued the following warnings:\r\nWarning: Unable to change to requested folder:\r\n'\/Users\/testuser\/Documents\/MATLAB'. Current folder is:\r\n'\/gpfs\/gss1\/home\/testuser'.\r\nReason: Cannot CD to \/Users\/testuser\/Documents\/MATLAB\r\n(Name is nonexistent or not a directory).\r\n\r\nans =\r\n\r\n'\/gpfs\/gss1\/home\/testuser'<\/pre>\n<\/div>\n<p><strong><br \/>\nCould not connect session fe.deic.sdu.dk<br \/>\n<\/strong>When you try to connect to Abacus from MATLAB on your own computer, you might get an error similar to the following. The error can be due several factors, including in particular:<\/p>\n<ul>\n<li>The username is not correct: Check the output of <tt>ClusterInfo.state<\/tt><\/li>\n<li>The used ssh private key has not been uploaded to the Abacus admin home page.<\/li>\n<li>The SSH Private Key is not in the right format: Check the output of <tt>ClusterInfo.state<\/tt>, and check that the referred file is a text file similar in format to the (much shorter) SSH _public_ key you have uploaded to Abacus.<\/li>\n<li>In particular for Windows users: Check that the private key is in OpenSSH format and not Putty ppk format (which does not work for MATLAB).<\/li>\n<\/ul>\n<p>If you have checked the above and cannot make this work, restart MATLAB. Try to connect again and send us the output of <tt>ClusterInfo.state<\/tt> together with the exact time you tried to connect.<\/p>\n<div class=\"codehilite\">\n<pre>&gt;&gt; j = c.batch(@pwd, 1, {});\r\nError using parallel.Cluster\/batch (line 154)\r\nJob submission failed because the user supplied IndependentSubmitFcn\r\n(profiles.sdu.abacus.independentSubmitFcn) errored.\r\n\r\nCaused by:\r\nError using parallel.cluster.RemoteClusterAccess.getConnectedAccessWithMirror (line 262)\r\nCould not connect to remote host fe.deic.sdu.dk.\r\nError using parallel.cluster.RemoteClusterAccess\/connect (line 380)\r\nCould not connect session fe.deic.sdu.dk: .<\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>How can MATLAB be used? In the following we describe two main ways to use MATLAB at Abacus. Non-interactive Slurm script (recommended) Semi-interactive using a MATLAB GUI running on your own computer Note that MATLAB<a class=\"moretag\" href=\"http:\/\/escience.sdu.dk\/index.php\/matlab-documentation\/\"> Read more&hellip;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"parent":0,"menu_order":9,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"http:\/\/escience.sdu.dk\/index.php\/wp-json\/wp\/v2\/pages\/4044"}],"collection":[{"href":"http:\/\/escience.sdu.dk\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/escience.sdu.dk\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/escience.sdu.dk\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/escience.sdu.dk\/index.php\/wp-json\/wp\/v2\/comments?post=4044"}],"version-history":[{"count":4,"href":"http:\/\/escience.sdu.dk\/index.php\/wp-json\/wp\/v2\/pages\/4044\/revisions"}],"predecessor-version":[{"id":4052,"href":"http:\/\/escience.sdu.dk\/index.php\/wp-json\/wp\/v2\/pages\/4044\/revisions\/4052"}],"wp:attachment":[{"href":"http:\/\/escience.sdu.dk\/index.php\/wp-json\/wp\/v2\/media?parent=4044"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}