MATLAB: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 214: Line 214:


<!--T:12-->
<!--T:12-->
You will only need to run the <tt>setrpaths.sh</tt> command once for each compiled binary. The <tt>run_mcr_binary.sh</tt> will instruct you to run it if it detects that it has not been done.
You will only need to run the <code>setrpaths.sh</code> command once for each compiled binary. The <code>run_mcr_binary.sh</code> will instruct you to run it if it detects that it has not been done.


= Using the MATLAB Parallel Server = <!--T:41-->
= Using the MATLAB Parallel Server = <!--T:41-->
Line 229: Line 229:
#:<code>parallel.cluster.generic.runProfileWizard()</code>
#:<code>parallel.cluster.generic.runProfileWizard()</code>
# Give these responses to the configuration wizard:
# Give these responses to the configuration wizard:
#* Select '''Unix''' (which is usually the only choice)
#* Select <b>Unix''' (which is usually the only choice)
#* Shared location: '''No'''  
#* Shared location: <b>No'''  
#* Cluster host:
#* Cluster host:
#** For Béluga: '''beluga.computecanada.ca'''
#** For Béluga: <b>beluga.computecanada.ca'''
#** For Narval: '''narval.computecanada.ca'''
#** For Narval: <b>narval.computecanada.ca'''
#* Username (optional): Enter your Alliance username (the identity file can be set later if needed)
#* Username (optional): Enter your Alliance username (the identity file can be set later if needed)
#* Remote job storage: '''/scratch'''
#* Remote job storage: <b>/scratch'''
#** Keep <i>Use unique subfolders</i> checked
#** Keep <i>Use unique subfolders</i> checked
#* Maximum number of workers: '''960'''
#* Maximum number of workers: <b>960'''
#* Matlab installation folder for workers: both local and remote versions must match:
#* Matlab installation folder for workers: both local and remote versions must match:
#** For local R2022a: '''/cvmfs/restricted.computecanada.ca/easybuild/software/2020/Core/matlab/2022a'''
#** For local R2022a: <b>/cvmfs/restricted.computecanada.ca/easybuild/software/2020/Core/matlab/2022a'''
#* License type: '''Network license manager'''
#* License type: <b>Network license manager'''
#* Profile Name: '''beluga''' or '''narval'''
#* Profile Name: <b>beluga''' or <b>narval'''
# Click on <i>Create</i> and <i>Finish</i> to finalize the profile.
# Click on <i>Create</i> and <i>Finish</i> to finalize the profile.


Line 250: Line 250:
<!--T:49-->
<!--T:49-->
Then:
Then:
# Open the '''independentSubmitFcn.m''' file; around line #117 is the line <p> <code>additionalSubmitArgs = sprintf('--ntasks=1 --cpus-per-task=%d', cluster.NumThreads);</code> </p><p> Replace this line with</p><p> <code>additionalSubmitArgs = ccSBATCH().getSubmitArgs();</code></p>
# Open the <b>independentSubmitFcn.m''' file; around line #117 is the line <p> <code>additionalSubmitArgs = sprintf('--ntasks=1 --cpus-per-task=%d', cluster.NumThreads);</code> </p><p> Replace this line with</p><p> <code>additionalSubmitArgs = ccSBATCH().getSubmitArgs();</code></p>
# Open the '''communicatingSubmitFcn.m''' file; around line #126 is the line <p> <code>additionalSubmitArgs = sprintf('--ntasks=%d --cpus-per-task=%d', environmentProperties.NumberOfTasks, cluster.NumThreads);</code> </p><p> Replace this line with</p><p> <code>additionalSubmitArgs = ccSBATCH().getSubmitArgs();</code></p>
# Open the <b>communicatingSubmitFcn.m''' file; around line #126 is the line <p> <code>additionalSubmitArgs = sprintf('--ntasks=%d --cpus-per-task=%d', environmentProperties.NumberOfTasks, cluster.NumThreads);</code> </p><p> Replace this line with</p><p> <code>additionalSubmitArgs = ccSBATCH().getSubmitArgs();</code></p>
# Open the '''communicatingJobWrapper.sh''' file; around line #20 (after the copyright statement), add the following command and adjust the module version to your local Matlab version:</p><p><code>module load matlab/2022a</code></p>
# Open the <b>communicatingJobWrapper.sh''' file; around line #20 (after the copyright statement), add the following command and adjust the module version to your local Matlab version:</p><p><code>module load matlab/2022a</code></p>


<!--T:50-->
<!--T:50-->
Line 259: Line 259:


== Validation == <!--T:47-->
== Validation == <!--T:47-->
'''Do not''' use the built-in validation tool in the ''Cluster Profile Manager''. Instead, you should try the <code>TestParfor</code> example, along with a proper <code>ccSBATCH.m</code> script file:
<b>Do not''' use the built-in validation tool in the ''Cluster Profile Manager''. Instead, you should try the <code>TestParfor</code> example, along with a proper <code>ccSBATCH.m</code> script file:
# Download and extract code samples on GitHub at https://github.com/ComputeCanada/matlab-parallel-server-samples.
# Download and extract code samples on GitHub at https://github.com/ComputeCanada/matlab-parallel-server-samples.
# In MATLAB, go to the newly extracted <code>TestParfor</code> directory.
# In MATLAB, go to the newly extracted <code>TestParfor</code> directory.
rsnt_translations
57,772

edits

Navigation menu