[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Condor-users] Condor and batch Matlab problem



>  I am using a very simple matlab script file. test.m:
> 
> load a.dat;
> load b.dat;
> matrR = a * b;
> save matrR.dat;
> exit;

I think the problem might be the path to those a.dat and b.dat files
in your matlab script. Matlab probably has some default folders that
it looks in, but it doesn't look in the temporary condor executable
directory. (But, as you noticed, when you run the command manually
from inside a condor executable directory, matlab knows your present
working directory, and it's smart enough to look for the files there.)

There are two potential solutions. One is to not use a batch script
(see below). The other is to do some tricky stuff using the
%_CONDOR_SCRATCH_DIR% environmental variable that is set when a
machine starts to execute a condor job, and contains the full path to
the execute dir. Thus, the lines in your matlab script should be
something like "load %_CONDOR_SCRATCH_DIR%\a.dat". Note, that probably
won't work verbatim because %_CONDOR_SCRATCH_DIR% is a Windows
environment variable. I'm not sure how to have matlab get and use the
contents of a Windows environment variable, but I'd bet it's not too
hard.

>  When I submit through condor, I use a matlab.bat file, with the content
> matlab.exe %1 %2 %3 ... which calls the matlab engine on the
> execute machine so I don't have to stage the executable.

While batch scripts are handy for a good many tasks, it might be
overly complicated in this case. You could just add "copy_to_spool =
false" to your submit script, and have "executable =
/path/to/matlab.exe". This makes your submit process a little simpler,
and may fix the path problem too!

>  I have even tried with a basic .m file containing only the exit command,
> but no success.

What do you mean "no success?" Does the job just sit idle forever, or
do you get errors? (If you get errors, post them) This potentially
shoots a hole in my assessment of the problem above. Perhaps posting
some more snippets of log files would help too.

-- 
Aaron Suggs
asuggs@xxxxxxxxxxxx