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
Parallel computing does not work fine for experiment.
Different values of max_workers (e.g., max_workers=1 and max_workers=10) consume the same computation time.
class Experiment:
def init(self, output_dir: str, jobs: List[Job], m_workers: int = 6):
"""Run an experiment to execute a list of jobs.
:param output_dir: Base directory where each job will save its results.
:param jobs: List of Jobs (from :py:mod:`jmetal.util.laboratory)`) to be executed.
:param m_workers: Maximum number of workers to execute the Jobs in parallel.
"""
self.jobs = jobs
self.m_workers = m_workers
self.output_dir = output_dir
self.job_data = []
def run(self) -> None:
with ProcessPoolExecutor(max_workers=10) as executor:
for job in self.jobs:
output_path = os.path.join(self.output_dir, job.algorithm_tag, job.problem_tag)
executor.submit(job.execute(output_path))
self.job_data.append(job.get_algorithm_data())
The text was updated successfully, but these errors were encountered:
Parallel computing does not work fine for experiment.
Different values of max_workers (e.g., max_workers=1 and max_workers=10) consume the same computation time.
class Experiment:
def init(self, output_dir: str, jobs: List[Job], m_workers: int = 6):
"""Run an experiment to execute a list of jobs.
The text was updated successfully, but these errors were encountered: