TULIP Resources‎ > ‎

Matlab Distributed Computing Project on a Computer Cluster (III: Linux)


What you will learn:
  • How to submit a Matlab job to VPAC using PBS on Linux
What you need before reading this tutorial
  • An account on the computer cluster with PBS support (for example, VPAC username, password)
This document is written by Yongli Ren, TULIP Lab . With some resource is taken from VPAC Tutorial Website and the README file for Linux published with Matlab.

Submit Matlab Jobs to VPAC on Linux

  • 1. Set up SSH on linux.

Run the following commands in order:
ssh-copy-id [email protected] %% replacing user with your own VPAC account,
and ssh-add.
This step is shown in Figure 1.

Figure 1. Set up SSH

After that, you will set up a passwordless ssh where you can access to VPAC without password requirement. This step is vital, because Matlab needs this passwordless ssh configuration to submit jobs to VPAC. You can check this by running command:
ssh [email protected]  %%% replacing user with your own VPAC account.
If you can access to VPAC without any password requirement, you succeed in this step.

  • 2. Set up Matlab working environment at local host.

At this step, it would be easy for Windows user, but for Linux user, it would be a little bit tricky, since Linux is a multi-user system. For some Linux users, they prefer to install softwares with the root account, which is a good habit but may cause some problems for changing those software’s environment manually. For instance, if you installed Matlab with Root account, you will not be able to change files or paths in Matlab folder with your working account. This would put some difficulties in this step. But no worries, we can figure out one way to solve those problems.

  • a). In Matoab is toolbox, there is a one that is vital for VPAC job submission. It is the “distcomp” folder:

Copy this “distcomp” folder to a new folder which is created with your working account. Then, we can start from there, since you have all the permission for the newly created folders. More importantly, add the new folder and its subfolders in Matlab’s path. We will use $distcomp represent where you create the new “distcomp” folder.

  • b). Go to folder: $distcomp/@distcomp/@abstractscheduler
Rename pGetJobState.m to OLD_pGetJobState.m_OLD and pDestroyJob.m to
OLD_pDestroyJob.m_OLD. or you can directly delete these two files.

  • c). Copy
and place it in

  • d). Copy
and place it in

  • 3. Copy new submit function from VPAC to the local host.
Since the standard Parallel and Simple Submit Functions have been modified by VPAC. So we need to copy two more files from VPAC:
pbsNonSharedParallelSubmitFcn.m and pbsNonSharedSimpleSubmitFcn.m, on tango.vpac.org from: /common/examples/matlab

  • 4. Finally, once again, please NOTE: The account name you use to run Matlab on Linux should be exactly the same as the one you have for VPAC, namely your VPAC account. You can run “whoami” command:

[[email protected] laptop] $ whoami
user            %%% the same as your VPAC account.