How to run multiple nest-loop with different indexes simultaneously?
1 view (last 30 days)
I'm working on a orbital mechanics project: I need to make a pork-chop to find the best moment to launch my spacecraft. Other than use ga, I'm trying to use simple nest-loop cycles to perform the computations.
Due to the high number of point needed to be precise I thought to use parallel computation to reduce time. I can't use parfor because of dependencies inside of loops, I try spmd using a code like the one down here to divide the work between each worker. The code is the same for each worker but with different data input in the fisrt loop cycle of the nest.
I get this error "Error detected on worker 3.
Error using try_parallel_comp (line 72)
Index exceeds the number of array elements (10)."
I think it's due to the fact that the inner loop cycles have bigger indexes than the first one.
Somebody could help me through this please?
% Code for worker 1
% Code for worker 2