How can I send a batch job with empty workspace ?

1 回表示 (過去 30 日間)
Rafael
Rafael 2013 年 5 月 24 日
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

採用された回答

Rafael
Rafael 2013 年 5 月 24 日
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 件のコメント
Thomas Ibbotson
Thomas Ibbotson 2013 年 5 月 28 日
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?

サインインしてコメントする。

その他の回答 (1 件)

Thomas Ibbotson
Thomas Ibbotson 2013 年 5 月 24 日
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

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by