http://www.perlmonks.org?node_id=1208638


in reply to Re: Parallelization of multiple nested loops
in thread Parallelization of multiple nested loops

salva, biosub:

I'd suggest something like:

# customize to suit my @param_space = (0.0, 0.2, 0.4, 0.6, 0.8, 1.0); for my $i (@param_space) { for my $j (@param_space) { ... } }

This clarifies the code a little and might remove a few operations from the optree. It makes it simple to change the distribution (if desired), and you can use more arrays if you want to treat some parameters slightly differently.

...roboticus

When your only tool is a hammer, all problems look like your thumb.