How can I send a batch job with empty workspace ?

1 view (last 30 days)
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

Accepted Answer

Rafael
Rafael on 24 May 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 Comment
Thomas Ibbotson
Thomas Ibbotson on 28 May 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?

Sign in to comment.

More Answers (1)

Thomas Ibbotson
Thomas Ibbotson on 24 May 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

Categories

Find more on Startup and Shutdown 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!