Specified as the comma-separated pair consisting of Paths to add to the MATLAB search path of the workers before the script or function executes, For example, you might want to control it if your cluster uses a different filesystem, and therefore the paths are different, such as when you submit from a Windows client machine to a Linux cluster. It can be useful to control the initial working folder in the workers. batch uses an additional worker to run the function itself.īy default, batch changes the initial working folder of the workers to the current folder of the MATLAB client. If your code uses a parallel pool, use the 'Pool' name-value pair argument to create a parallel pool with the number of workers that you specify. To reduce overhead in this example, divideData is defined in a file outside of this live script. You can do this by simply adding a function line at the beginning of your script. As a best practice, convert your script to a function file to avoid this communication overhead. If you have a large workspace, it impacts negatively the data transfer time. Note that if you send a script file using batch, MATLAB transfers all the workspace variables to the cluster, even if your script does not use them. Specify the expected number of output arguments and a cell array with inputs to the function. For an example of a custom function, see the supporting function divideData. Place your code inside a function and submit it as a batch job by using batch.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |