How can I send a batch job with empty workspace ?

1 vue (au cours des 30 derniers jours)
Rafael
Rafael le 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

Réponse acceptée

Rafael
Rafael le 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 commentaire
Thomas Ibbotson
Thomas Ibbotson le 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?

Connectez-vous pour commenter.

Plus de réponses (1)

Thomas Ibbotson
Thomas Ibbotson le 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

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by