function outputs wrong data if run in multiple instances at the same time
Mostrar comentarios más antiguos
Hi,
I am experiencing some problems making different copies of the same matlab function run at the same time on a multiprocessor working station. In details, I made a standalone executable file that I run 4 times and each of them, during its execution, will output some results in matrices then written to files. So different simulations by using the same code realized with an intrinsically serial approach with a duration of about 36 hours (each). The problem arises when trying to open these matrices, and to make some videos. Matlab says that these matrices contain complex data and they should not. If I repeat exactly the same simulation by running only once the executable I obtain the wanted results without any complex expression. I wonder if this can be due to the fact that these tasks use the same names for variables and that they interact between them modifying a portion of memory to which they should not have access. Is there a way to overcome this problem so to force each task to create and to work on its own memory space in spite of the fact that other processes will use the same parameter names with different values??
Thanks for your help
5 comentarios
Adam
el 29 de Sept. de 2016
Is it not just a case that multiple processes are writing to the same files? Depending how you run them they should already have their own independent workspace.
maxal
el 29 de Sept. de 2016
Adam
el 29 de Sept. de 2016
You'd probably need to show some code as it is impossible to tell whether things are being shared by workspaces or not otherwise - for example, if you have handle-derived objects these are passed around by reference and so would be shared.
maxal
el 29 de Sept. de 2016
Adam
el 29 de Sept. de 2016
Matlab will already create a new workspace for each of the workers if you are using e.g. parfor, but this still doesn't mean that objects aren't share between those workspaces when they are copied across to them - it depends on the copy semantics of the objects.
Respuestas (0)
Categorías
Más información sobre Variables en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!