INCA with MATLAB

These are the steps to get INCA to work with MATLAB on Kebnekaise.

Note

You need to get your own license for INCA!

  1. Get a license for INCA from http://mfa.vueinnovations.com/licensing
  2. Wait for license acceptance. It can take more than a day.
  3. Then go to download “Your premium content” while logged in: MFA Suite 2.3
  4. Transfer the zip file to Kebnekaise (filezilla is a good option - use sftp). There is a Guide for file transfers here.
  5. Login to Kebnekaise. It is recommended you use ThinLinc.
  6. Open a terminal:
    • In the ThinLinc menu: “Applications” -> “System Tools” -> “MATE Terminal”
  7. Unzip the downloaded zip file in your project folder (if you did not unzip it first and just transferred the folder).
    • You should use this folder: /proj/nobackup/<your-project>/<your-directory> - change the <your-project> to the name your project storage folder has, and then put it in <your-directory> under it, if it is a shared folder.
    • The command to unzip is: unzip incax.y.zip (change the name of the zip file if it is not as here).
  8. Use the terminal you just opened, or open a new terminal and configure MATLAB for parallel runs (DO ONCE PER VERSION of MATLAB!)
    • Opening a terminal: “Applications” -> “System Tools” -> “MATE Terminal”
    • For MATLAB 2023a: type ml MATLAB/2023a.Update4 and press Enter
    • Type configCluster.sh and press Enter
  9. Start MATLAB. It should preferrably be done from the INCA folder so the working path of INCA is recognized
    • Can either be done from menu:
      • In ThinLinc this can be done from “Applications” -> “Programming” -> “MATLAB 2023a” (change to preferred version, same as you ran configCluster.sh for)
      • Set the working directory path to the INCA folder inside MATLAB
    • Or you can do it from a terminal. Two ways to get a terminal and change to directory:
      • Start a terminal from the menu and change to INCA directory then load the MATLAB module and start matlab:
        • “Applications” -> “System Tools” -> “MATE Terminal”
        • Then switch to inca directory by typing cd /proj/nobackup/<your-project>/<path/to/inca> and press enter.
        • Then type ml MATLAB/2023a.Update4 and enter, then type matlab -singleCompThread and press “enter” to start MATLAB version 2023a
      • OR use the filebrowser (shortcut to your home folder on ThinLinc desktop) to find the folder and open a terminal from there, then load MATLAB and start it:
        • Double-left-click on “YOURUSERNAME’s Home” on the ThinLinc desktop
        • Click around in the file finder until you have the inca directory open
        • Right-click in that window and pick “Open in Terminal”
        • and then start MATLAB there by typing ml MATLAB/2023a.Update4 and enter, then type matlab -singleCompThread and press “enter” to start MATLAB version 2023a
        • NOTE that your project directory is found under “File System” -“proj” -> “nobackup” -> “directory-you-picked-for-project” in the file browser.
  10. Transfer the network .mat file to a subfolder in this INCA root folder to avoid the “rungui” error.
  11. Set job parameters for the batch system:
    >> c = parcluster;
    
    >> % account name is your project id
    >> c.AdditionalProperties.AccountName = 'account-name';
    
    >> % Ask for some time, here 5 hours
    >> c.AdditionalProperties.WallTime = '05:00:00';
    
    >> % How many processors per node you want - here 20
    >> c.AdditionalProperties.ProcsPerNode=20;
    
    >> % save the profile 
    >> c.saveProfile
    
  12. You can check your settings with c.AdditionalProperties
  13. You can clear a job setting by giving an empty value, like this: c.AdditionalProperties.WallTime = '';
  14. Always save the settings after you have changed them, with c.saveProfile
  15. Inside MATLAB, set path to where you put INCA with addpath '/path/to/inca' and also do this for your data directory.
    • Example for me:
      >> addpath '/pfs/stor10/projects/projnb10/support-hpc2n/bbrydsoe/inca2.3/inca2.3'
      >> addpath '/home/b/bbrydsoe/Downloads'
      
      NOTE: if there are problems with the path, one solution is to start MATLAB from the inca directory, as describe further up on the page
  16. Start a parpool, here in this example for 16 workers
    >> parpool(16) 
    
  17. Wait for it to have resources. Start inca by typing this inside MATLAB: inca
  18. INCA should automatically use the parallel pool of workers when available, i.e. the ones we just asked for.
  19. Job monitoring:
    • You can start a terminal and look there to see which jobs you have running (and get job-ids) with
      squeue --me
      
      and then do
      scontrol show job <jobid-you-got-from-above>
      
      You can also monitor the job with
      job-usage <jobid-you-got-from-above>