problem with parfor loop
1 view (last 30 days)
I have the following code
parfor edge = 1:1000
var_node = edge_2_var_node(edge, num_of_variable_nodes)
check_node = ceil(edge_perm(edge)/dc);
H(check_node,var_node) = 1;
but when i try to run it, i have this "The variable H in a parfor cannot be classified." Could anyone help me? Thanks
Walter Roberson on 24 Aug 2013
You will have difficulty with that set-up. parfor has to assume the possibility that two different edge_2_var_node lookups might give back the same value, leading to the possibility that different parfor cycles might be trying to write into the same H() location.
Is edge_2_var_node a function or an array? Are the edge_perm() values certain to be different by more than dc so that check_node values are certain to be unique? What can you give us that would allow it to be proven that no two H(check_node,var_node) references will be to the same location ?