I am currently adding Opt4J support to SESSL, a Scala DSL to specify
simulation experiments (http://sessl.org).
The Opt4J tutorial is quite useful, but it does not include much
details on parallelization.
I found the class ParallelIndividualCompleter and tried to bind it to
IndividualCompleter, like this:
new EvolutionaryAlgorithmModule() {
@Override
public void config() {
super.config();
bindConstant("maxThreads", ParallelIndividualCompleter.class).to(8);
bind(IndividualCompleter.class).to( ParallelIndividualCompleter.class);
}
}
which works in a sense (multiple individuals are shown as being
evaluated at the same time by the GUI, see screenshot), but it still
runs only sequentially if you check CPU usage ---- so this must be
wrong.
Any thoughts, or maybe a pointer to a setup where parallelization works?
I'm pretty sure I can find a way around the problem myself, I just
don't know where to start.
Best regards,
Roland
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear Roland,
Sorry for not responding for a year, I just dont have this forum here on my radar (I should activation some kind of notification). You should rather use the IndividualCompleterModule and configure it accordingly than binding everything in an additional Module. However, your code looks ok to me. Could you resolve the problem - do you have somewhere a synchronized method that prevents parallel execution?
Best Regards,
Martin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear all,
I am currently adding Opt4J support to SESSL, a Scala DSL to specify
simulation experiments (http://sessl.org).
The Opt4J tutorial is quite useful, but it does not include much
details on parallelization.
I found the class ParallelIndividualCompleter and tried to bind it to
IndividualCompleter, like this:
new EvolutionaryAlgorithmModule() {
@Override
public void config() {
super.config();
bindConstant("maxThreads", ParallelIndividualCompleter.class).to(8);
bind(IndividualCompleter.class).to( ParallelIndividualCompleter.class);
}
}
which works in a sense (multiple individuals are shown as being
evaluated at the same time by the GUI, see screenshot), but it still
runs only sequentially if you check CPU usage ---- so this must be
wrong.
Any thoughts, or maybe a pointer to a setup where parallelization works?
I'm pretty sure I can find a way around the problem myself, I just
don't know where to start.
Best regards,
Roland
Dear Roland,
Sorry for not responding for a year, I just dont have this forum here on my radar (I should activation some kind of notification). You should rather use the IndividualCompleterModule and configure it accordingly than binding everything in an additional Module. However, your code looks ok to me. Could you resolve the problem - do you have somewhere a synchronized method that prevents parallel execution?
Best Regards,
Martin