Submit job directly to Torque with qsub

조회 수: 6 (최근 30일)
Ivan
Ivan 2012년 12월 4일
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.

답변 (1개)

Jason Ross
Jason Ross 2012년 12월 4일
편집: Jason Ross 2012년 12월 4일
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
Ivan
Ivan 2012년 12월 9일
편집: Ivan 2012년 12월 9일
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 2012년 12월 10일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB Parallel Server에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by