How can I send a batch job with empty workspace ?

1 Ansicht (letzte 30 Tage)
Rafael
Rafael am 24 Mai 2013
Hi all. I used to submit my jobs via batch() to a remote linux-cluster running with torque. This was fine using R2011a. Having changed to R2013a I get the message:
Error using batch (line 140)
'Workspace' is not a valid property input to batch.
Since I still find the 'Workspace' parameter described in the documentation for the batch-command, I dont understand what is wrong with
emptyStruct=struct();
batch('script',1,{inputargs},'CurrentDirectory', homedir,'PathDependencies', {'somepaths'},'Matlabpool',nbOfWorker,'Workspace', struct());
I want only the inputargs to go with the batch, not my complete local workspace.
Any ideas? Thanks very much!
Rafael

Akzeptierte Antwort

Rafael
Rafael am 24 Mai 2013
Hi again and thanks for the hint concerning usage with script and function.
In fact, I use a function and not a script (as I wrote above by mistake, sorry.) so the arguments for the numberOfOutputArgs (2nd argument, a 1 in this example) and the given inputArgs (3rd argument) are probably not wrong.
I will try some things tomorrow using my local config for the weekend.
I'll be back then. Rafael
  1 Kommentar
Thomas Ibbotson
Thomas Ibbotson am 28 Mai 2013
If you are using a function, you do not need (and in fact are not allowed) the 'Workspace' parameter, as functions do not require a workspace to be defined. This is what the error message was attempting to tell you, although it was not being specific enough, it should have read something like:
'Workspace' is not a valid property input to batch with a function as the first argument.
Does this clear things up?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Thomas Ibbotson
Thomas Ibbotson am 24 Mai 2013
Hi Rafael,
Unfortunately the error message you are receiving is misleading. The problem is that you are using the incorrect syntax for batch with scripts. The 2nd and 3rd input arguments you have provided are only used when the 1st argument is a function not a script. If you remove those arguments I think it should work.
Cheers, Tom

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by