Why am i getting this warning and error after using Parfor instead of for?

Hello I am new to parallel operation, so i had a code that works fine using normal for loop and this code has a main changing variable i.e. Temperature changes from 20 to 80C
so i wanted to take advantage of parallel core and try to execute the code using parfor so the same code can be computed at different temperatures simultaneously
However, when i changed the for loop to parfor i got the following:
-->Error using parallel_function (line 589)
Undefined function or variable 'parity_max'.
Error stack: (No remote error stack)
Error in Grace3extboostPARALLEL (line 145) parfor y=1:length(Tci)<--
So i dont get what's happening, it seems like a slicing problem i.e. it seems that some of the variables inside the parfor loop are used simultaneously between different workers. but how come this happens although those variable are inside the Parfor loop but i cant really grasp the idea.

1 Comment

Can you post some code so that we have a chance of figuring out why the problem is happening?

Answers (0)

This question is closed.

Asked:

on 16 May 2013

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!