Changes between Version 21 and Version 22 of cypress/Matlab


Ignore:
Timestamp:
08/27/2026 04:37:00 PM (8 days ago)
Author:
fuji
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • cypress/Matlab

    v21 v22  
    300300This feature is no longer available since MATLAB R2020a. See [wiki:RunningMATLABwithXeonPhi here] to run MATLAB with Intel Xeon Phi.
    301301
    302 Internally, MATLAB uses Intel MKL Basic Linear Algebra Subroutines (BLAS) and Linear Algebra package (LAPACK) routines to perform the underlying computations when running on Intel processors.
    303 
    304 Intel MKL includes the Automatic Offload (AO) feature that enables computationally intensive Intel MKL functions to offload partial workload to attached '''Intel Xeon Phi''' coprocessors automatically and transparently.
    305 
    306 As a result, MATLAB performance can benefit from Intel Xeon Phi coprocessors via the Intel MKL AO feature when problem sizes are large enough to amortize the cost of transferring data to the coprocessors.
    307 
    308 In SLURM script, make sure that option '''--gres=mic:1''' is set and ''intel-psxe'' module as well as the MATLAB module has been loaded.
    309 
    310 {{{#!bash
    311 #!/bin/bash
    312 #SBATCH --qos=normal            # Quality of Service
    313 #SBATCH --job-name=matlabAO     # Job Name
    314 #SBATCH --time=1:00:00          # WallTime
    315 #SBATCH --nodes=1               # Number of Nodes
    316 #SBATCH --ntasks-per-node=1     # Number of tasks (MPI processes)
    317 #SBATCH --cpus-per-task=1       # Number of threads per task (OMP threads)
    318 #SBATCH --gres=mic:1            # Number of Co-Processors
    319 
    320 module load matlab
    321 module load intel-psxe
    322 
    323 export MKL_MIC_ENABLE=1
    324 matlab  -nodesktop -nodisplay -nosplash -r "MatTest; exit;"
    325 }}}
    326 
    327 Note that
    328 {{{#!bash
    329 export MKL_MIC_ENABLE=1
    330 }}}
    331 enables Intel MKL Automatic Offload (AO).
    332 
    333 The sample code is below:
    334 {{{#!matlab
    335 %
    336 % Matrix test "MatTest.m"
    337 %
    338 A = rand(10000, 10000);
    339 B = rand(10000, 10000);
    340 tic;
    341 C = A * B;
    342 realT = toc;
    343 fprintf('Real Time = %f(sec)\n',realT);
    344 }}}
    345 
    346 
    347 
    348 See [https://wiki.hpc.tulane.edu/trac/wiki/cypress/Matlab#CompiledMatlab]
    349 
    350 {{{#!bash
    351 #!/bin/bash
    352 #SBATCH --qos=normal            # Quality of Service
    353 #SBATCH --job-name=matlabAO     # Job Name
    354 #SBATCH --time=1:00:00          # WallTime
    355 #SBATCH --nodes=1               # Number of Nodes
    356 #SBATCH --ntasks-per-node=1     # Number of tasks (MPI processes)
    357 #SBATCH --cpus-per-task=1       # Number of threads per task (OMP threads)
    358 #SBATCH --gres=mic:1            # Number of Co-Processors
    359 
    360 module load matlab
    361 module load intel-psxe
    362 mcc -m MatTest.m
    363 export MKL_MIC_ENABLE=1
    364 ./MatTest
    365 }}}
    366 
    367 To generate the offload report at run time,
    368 {{{
    369 export OFFLOAD_REPORT=2
    370 }}}
    371 
    372 * Setting OFFLOAD_REPORT to 0 (or not setting it) results in no offload report.
    373 
    374 * Setting OFFLOAD_REPORT to 1 results in a report including:
    375  * Name of function called
    376  * Effective Work Division
    377  * Time spent on Host during call
    378  * Time spent on each available Phi coprocessor during the call
    379 
    380 * Setting OFFLOAD_REPORT to 2 results in a report including everything from 1, and in addition:
    381  * Amount of data transferred to and from each Phi during call
    382