You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from pymoo.core.problem import ElementwiseProblem
import multiprocessing
from pymoo.algorithms.soo.nonconvex.ga import GA
from pymoo.optimize import minimize
from pymoo.core.problem import StarmapParallelization
import numpy as np
n_proccess = 8
pool = multiprocessing.Pool(n_proccess)
runner = StarmapParallelization(pool.starmap)
problem = MyProblem(elementwise_runner=runner)
res = minimize(problem, GA(), termination=("n_gen", 200), seed=1)
print('Threads:', res.exec_time)
pool.close()
I only slightly modified the example from the official tutorial — specifically, I increased n_var and xu, and decreased xl. Here are my questions:
(1) According to "top" from terminal, only one PID reaches 100% CPU usage, while the other 7 remain below 1%. Why is that?
(2) Changing n_proccess from 1 to 8 doesn’t make a significant performance difference. Why?
(3) Do vectorized matrix operations offer similar performance compared to using threads or processes?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
from pymoo.core.problem import ElementwiseProblem
import multiprocessing
from pymoo.algorithms.soo.nonconvex.ga import GA
from pymoo.optimize import minimize
from pymoo.core.problem import StarmapParallelization
import numpy as np
class MyProblem(ElementwiseProblem):
if name == 'main':
I only slightly modified the example from the official tutorial — specifically, I increased n_var and xu, and decreased xl. Here are my questions:
(1) According to "top" from terminal, only one PID reaches 100% CPU usage, while the other 7 remain below 1%. Why is that?
(2) Changing n_proccess from 1 to 8 doesn’t make a significant performance difference. Why?
(3) Do vectorized matrix operations offer similar performance compared to using threads or processes?
Beta Was this translation helpful? Give feedback.
All reactions