Submit job directly to Torque with qsub

2 views (last 30 days)
Ivan
Ivan on 4 Dec 2012
Hi, i wont to ask, if i can submit job directly to the Torque scheduler without starting Matlab, for example i copy example.m file to the cluster where i have MDCS,Matlab and submit it whit qsub command. If it is possible then how to do that? It is a small experiment, if it is possible, it will really help me with my project.
The operating system on cluster is linux and there is nonshared filesystem.

Answers (1)

Jason Ross
Jason Ross on 4 Dec 2012
Edited: Jason Ross on 4 Dec 2012
There are example scripts in matlabroot/toolbox/distcomp/examplesintegration/pbs/nonshared for how to set up MATLAB (with Parallel Computing Toolbox) to submit to a Torque cluster without a shared filesystem from your MATLAB desktop. If you really want to do it without MATLAB, I suppose you could see what's being done and mimic it, but IMHO if you have already set up MDCS to work with Torque and (I assume) you have PCT, you can follow the example and submit your code right from MATLAB, which in turn does use qsub to submit to the scheduler.
  2 Comments
Ivan
Ivan on 9 Dec 2012
Edited: Ivan on 9 Dec 2012
Idont know how to mimic exactly waht is matlab doing when it is submitting job. So I tried to do something like this. I create test.pbs file:
#!/bin/sh
#
#PBS -N Test
#PBS -q matlab
/shared/software/MATLAB/bin/matlab -nosplash -nodisplay < schedul.m
echo "MATLAB run completed at `date`"
and M-file schedul.m where i set scheduler properties and some simple task:
%Use a local folder as the JobStorageLocation
cluster = parallel.cluster.Generic( 'JobStorageLocation', '/home/durkac');
set(cluster, 'HasSharedFilesystem', false);
set(cluster, 'ClusterMatlabRoot', '/shared/software/MATLAB');
set(cluster, 'OperatingSystem', 'unix');
% Define the additional inputs to the submit functions
clusterHost = 'mdcstest.grid.tuke.sk';
remoteJobStorageLocation = '/shared/home/durkac';
% The IndependentSubmitFcn must be a MATLAB cell array that includes the two additional inputs
set(cluster, 'IndependentSubmitFcn', {@independentSubmitFcn, clusterHost, remoteJobStorageLocation});
% If you want to run communicating jobs (including matlabpool), you must specify a CommunicatingSubmitFcn
set(cluster, 'CommunicatingSubmitFcn', {@communicatingSubmitFcn, clusterHost, remoteJobStorageLocation});
set(cluster, 'GetJobStateFcn', @getJobStateFcn);
set(cluster, 'DeleteJobFcn', @deleteJobFcn);
j = createJob(cluster);
createTask(j, @rand, 1, {3,3});
submit(j);
wait(j);
taskoutput = fetchOutputs(j);
taskoutput{1};
When i run the schedul.m from Matlab, it asks login and password and after that run well. When i try qsub test.pbs it will stuck because a dont know how to enter the login and password.
It is possible to do it this way? Or it is totaly wrong?
Reason why i`m asking is that my highschool teacher gave me this as problem to solve ... he just wont it to solve this way ...
Jason Ross
Jason Ross on 10 Dec 2012
Is the password prompt coming from ssh? If that's the case, you need to configure ssh to not challenge you for a password. There are a variery of ways to do this, google "passwordless ssh" for a few ways to accomplish it.

Sign in to comment.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!