currentProject() function in Parallel Computing Toolbox
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Isaac De La Cruz
el 14 de Feb. de 2023
Comentada: Isaac De La Cruz
el 15 de Feb. de 2023
I have a workflow that uses the MATLAB project functions to retrieve information from the MATLAB project. I use currentProject() to get the matlab.project.Project object.
I am trying to run this workflow using the Parallel Computing Toolbox, but seems that the MATLAB project is not available in the MATLAB workers.
Tested it using this code:
parpool(2);
spmd
currentProject();
end
Does the MATLAB project gets transferred into the MATLAB workers, or only the MATLAB path?
Any workaround about how can I pull the Project Reference information in a distributed environment?
Thanks in advance!
0 comentarios
Respuesta aceptada
Sean de Wolski
el 14 de Feb. de 2023
You can open the project on all workers before the loop with parfevalOnAll.
gcp
rf = currentProject().RootFolder
parfevalOnAll(@()openProject(rf), 0)
parfor ii = 1:4
disp(currentProject().RootFolder)
end
Más respuestas (0)
Ver también
Categorías
Más información sobre Project Management 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!