Run parallel batch job through cluster which require extra functions

16 visualizaciones (últimos 30 días)
Vera Peng
Vera Peng el 13 de Jul. de 2018
Respondida: Kojiro Saito el 14 de Jul. de 2018
I have a Matlab script that needs two functions in the same folder. I can run it on my own computer under the same folder, but I don't know how this works in the parallel batch job. Say script name: script.m Two functions: function1.m function2.m

Respuestas (1)

Kojiro Saito
Kojiro Saito el 14 de Jul. de 2018
Yes, it works in cluster, too.
By default, 'AutoAttachFiles' of batch function is true, so if your script.m requires external custom functions, batch will analyze file dependencies and send these files to the cluster automatically.
If this does not work, you can forcibly add files by using AttachedFiles property. The following command is an example of running script.m using 4 workers in parallel. (1 worker as a batch handler and 3 workers in parallel pool).
job1 = batch('script', 'AttachedFiles',{'function1.m','function2.m'}, 'Pool', 3);

Categorías

Más información sobre MATLAB Parallel Server en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by