MATLAB: Difference between revisions

Jump to navigation Jump to search
355 bytes removed ,  3 years ago
tighten up some of the phrasing and the matlab command lines.
No edit summary
(tighten up some of the phrasing and the matlab command lines.)
Line 8: Line 8:
* Run MATLAB on Cedar or Béluga, both of which have a license available for any student, professor or academic researcher. </li>
* Run MATLAB on Cedar or Béluga, both of which have a license available for any student, professor or academic researcher. </li>
* Use an external license, i.e. one owned by your institution, faculty, department, or lab. See ''Using an external license'' below.</li>
* Use an external license, i.e. one owned by your institution, faculty, department, or lab. See ''Using an external license'' below.</li>
; Running a compiled MATLAB application
; Compile your MATLAB and run the result
This method requires compiling your code into a binary using the MATLAB Compiler (<tt>mcc</tt>). You can then run that binary executable using the appropriate MATLAB Runtime. </li>
Compile your code into an executable using the MATLAB Compiler, <tt>mcc</tt>. You can use this executable without license considerations. </li>
More details about these approaches are provided below.
More details about these approaches are provided below.
__TOC__
__TOC__
Line 19: Line 19:
<pre>
<pre>
[name@cluster ~]$ module load matlab/2018a
[name@cluster ~]$ module load matlab/2018a
[name@cluster ~]$ matlab -nodisplay -nojvm -r "fprintf('%s\n', license()); exit"
[name@cluster ~]$ matlab -nodisplay -nojvm -batch "disp(license())"
                                                < M A T L A B (R) >
                                      Copyright 1984-2018 The MathWorks, Inc.
                                      R2018a (9.4.0.813654) 64-bit (glnxa64)
                                                February 23, 2018


<!--T:30-->
<!--T:30-->
Line 31: Line 27:


<!--T:22-->
<!--T:22-->
If any license number is printed, you're okay.  Be sure to run this test on each cluster on which you want to use MATLAB; you may get different results.
If any license number is printed, you're okay.  Be sure to run this test on each cluster on which you want to use MATLAB, since licenses may not be available everywhere.


<!--T:39-->
<!--T:39-->
Line 45: Line 41:
|lang="bash"
|lang="bash"
|contents=
|contents=
# MATLAB license passcode file
# MATLAB license server file
SERVER <ip address> ANY <port>
SERVER <ip address> TCP <port>
USE_SERVER
USE_SERVER
}}
}}
Line 72: Line 68:
<pre>
<pre>
[name@cluster ~]$  module load matlab
[name@cluster ~]$  module load matlab
[name@cluster ~]$  matlab -nodisplay -nojvm -r "fprintf('%s\n', license()); ver; exit"
[name@cluster ~]$  matlab -nodisplay -nojvm -batch "ver"
</pre>  
</pre>  
= Running a MATLAB code =
= Running a MATLAB code =


<!--T:4-->
<!--T:4-->
'''Important:''' Any MATLAB calculation larger than a short test job of about 5 minutes must be submitted to the scheduler. For instructions on using the scheduler, please see the [[Running jobs]] page.
'''Important:''' Any significant MATLAB calculation (takes more than about 5 minutes or a gigabyte of memory) must be submitted to the scheduler. For instructions on using the scheduler, please see the [[Running jobs]] page.


<!--T:27-->
<!--T:27-->
Line 190: Line 186:


<!--T:13-->
<!--T:13-->
'''Important:''' Like any other intensive job, you must always run MCR code within a job that you will have submitted to the scheduler. For instructions on using the scheduler, please see the [[Running jobs]] page.
'''Important:''' Like any other intensive job, you must always run MCR code within a job submitted to the scheduler. For instructions on using the scheduler, please see the [[Running jobs]] page.


<!--T:5-->
<!--T:5-->
Line 200: Line 196:


<!--T:10-->
<!--T:10-->
This will produce a binary named <tt>cosplot</tt>, as well as a wrapper script. To run the binary on Compute Canada servers, you will only require the binary. The wrapper script named <tt>run_cosplot.sh</tt> will not work as is on our servers because MATLAB assumes that some libraries can be found in specific locations. Instead, we provide a different wrapper script called <tt>run_mcr_binary.sh</tt> which sets the correct paths.  
This will produce a binary named <tt>cosplot</tt>, as well as a wrapper script. To run the binary on Compute Canada servers, you will only need the binary. The wrapper script named <tt>run_cosplot.sh</tt> will not work as is on our servers because MATLAB assumes that some libraries can be found in specific locations. Instead, we provide a different wrapper script called <tt>run_mcr_binary.sh</tt> which sets the correct paths.  


<!--T:18-->
<!--T:18-->
cc_staff
176

edits

Navigation menu