How to Connect to VPAC/Massive
Run the following commands in order: ssh-keygen, ssh-copy-id user@tango.vpac.org %% replacing user with your own VPAC account, and ssh-add. This step is shown in Figure 1. Figure 1. Set up SSH If you have already had your private/public key, please log into the cluster, and go to folder ./ssh and open the file, authorised_keys, and put your public key as a separate line in the file and save it. 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 user@tango.vpac.org %%% replacing user with your own VPAC account. If you can access to VPAC without any password requirement, you succeed in this step.
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.
$MATLABROOT/toolbox/distcomp 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.
Rename pGetJobState.m to OLD_pGetJobState.m_OLD and pDestroyJob.m to OLD_pDestroyJob.m_OLD. or you can directly delete these two files.
$distcomp/examples/integration/pbs/nonshared/unix/pGetJobState.m and place it in $distcomp/@distcomp/@abstractscheduler/
$distcomp/examples/integration/pbs/nonshared/unix/pDestroyJob.m and place it in $distcomp/@distcomp/@abstractscheduler/ The main purpose of this step is to set up the PBS environment on local host to submit jobs to VPAC cluster.
Since the standard Parallel and Simple Submit Functions have been modified by VPAC. So we need to copy two more files from VPAC: Copy pbsNonSharedParallelSubmitFcn.m and pbsNonSharedSimpleSubmitFcn.m, on tango.vpac.org from: /common/examples/matlab To $distcomp/examples/integration/pbs/nonshared/unix
[user@your laptop] $ whoami user %%% the same as your VPAC account. * For Massive connection, please replace user@tango.vpac.org with your massive account and the domain name: user@m2.massive.org.au How to submit a Matlab job to VPAC
clusterHost = 'tango.vpac.org'; remoteDataLocation = '/home/xxxxxxxx'; //replace this by your own location in your account space where you want to store the job data sched = findResource('scheduler', 'type', 'generic'); get(sched) set(sched, 'DataLocation', 'C:\matlab\share'); //you can choose and folder in your computer to be share file system - matlab will create some job data in thic location. set(sched, 'ClusterMatlabRoot', '/usr/local/matlab/R2008a'); // change the version of matlab to your version of matlab such as R2009a, R2008b, set(sched, 'HasSharedFilesystem', true); set(sched, 'ClusterOsType', 'unix'); set(sched, 'SubmitFcn', {@pbsNonSharedSimpleSubmitFcn, clusterHost, remoteDataLocation}); j = createJob(sched); //create a job to send to vpac get(j) createTask(j, @rand, 1, {3,3}); //create task for this job to generate randomly 3x3 matrix createTask(j, @rand, 1, {3,3}); //create task for this job to generate randomly 3x3 matrix
get(j,'Tasks') submit(j) waitForState(j) results = getAllOutputArguments(j); results{1:2}
Paralleljob.m clusterHost = 'tango.vpac.org'; remoteDataLocation = '/home/xxxxxxxx'; //replace this by your own location in your account space where you want to store the job data sched = findResource('scheduler', 'type', 'generic'); get(sched) set(sched, 'DataLocation', 'C:\matlab\share'); //you can choose and folder in your computer to be share file system - matlab will create some job data in thic location. set(sched, 'ClusterMatlabRoot', '/usr/local/matlab/R2008a'); // change the version of matlab to your version of matlab such as R2009a, R2008b, set(sched, 'HasSharedFilesystem', true); set(sched, 'ClusterOsType', 'unix'); set(sched, 'ParallelSubmitFcn', {@pbsNonSharedParallelSubmitFcn, clusterHost, remoteDataLocation}); //the pbsNonSimpleParallelSubmitFcn from above example has been changed to pbsNonSharedParallelSubmitFcn pjob = createParallelJob(sched) //Create a parallel task using the rand function to provide 3 random numbers. createTask(pjob, @rand, 1, {3}); set(pjob,'MinimumNumberOfWorkers',5); set(pjob,'MaximumNumberOfWorkers',9); submit(pjob)
waitForState(pjob, 'finished') results = getAllOutputArguments(pjob) celldisp(results);
|
TULIP Resources >