G
gamo
Hello
I usually do a lot of simulations and heuristics in a linear funcional
way. Now I want to send random candidates to the cores or process, get
the results for each one and when the acceptable result is reached,
rerun the calculus, print a report and exit.
I take a look on the modules Parallel::* (Simple, ForkManager and Loops)
but none is both easy and could do the things well. Then I see MCE, wich
sure could do that things, but is complex and the MCE::Examples provided
don't cover a simple simulation scenario.
Are there somebody wich could guide me in the parallelization of
something like
$var = 1;
$foo = 2;
$bar = 3;
while (1) {
$r = rand();
$result = $r * ($var+$foo+$bar);
$anothervar = sqrt($var+$foo+$bar);
last if ($result < $anothervar+0.001 && $result > $anothervar-0.001);
}
print "$r -> $result\n";
exit ;
Thanks in advance
I usually do a lot of simulations and heuristics in a linear funcional
way. Now I want to send random candidates to the cores or process, get
the results for each one and when the acceptable result is reached,
rerun the calculus, print a report and exit.
I take a look on the modules Parallel::* (Simple, ForkManager and Loops)
but none is both easy and could do the things well. Then I see MCE, wich
sure could do that things, but is complex and the MCE::Examples provided
don't cover a simple simulation scenario.
Are there somebody wich could guide me in the parallelization of
something like
$var = 1;
$foo = 2;
$bar = 3;
while (1) {
$r = rand();
$result = $r * ($var+$foo+$bar);
$anothervar = sqrt($var+$foo+$bar);
last if ($result < $anothervar+0.001 && $result > $anothervar-0.001);
}
print "$r -> $result\n";
exit ;
Thanks in advance