Skip to content

Commit

Permalink
Disable FMUPool by default
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed Jul 15, 2024
1 parent 7e1b218 commit 9c00c6b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions otfmi/otfmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ def _exec_sample(self, list_value_input, **kwargs):
the underlying PyFMI model object.
"""

return self.simulate_sample(list_value_input, **kwargs)

def load_fmu(self, path_fmu, kind=None, **kwargs):
Expand Down Expand Up @@ -451,10 +450,9 @@ def simulate_sample(self, list_value_input, **kwargs):
"""

if self.n_cpus is None:
n_cpus = 1
else:
n_cpus = self.n_cpus
n_cpus = 1 if self.n_cpus is None else self.n_cpus
if n_cpus == 1:
return [self.simulate(point, **kwargs) for point in list_value_input]

kwargs.setdefault("initialization_script", self.initialization_script)

Expand All @@ -471,7 +469,6 @@ def simulate_sample(self, list_value_input, **kwargs):
)
list_kwargs.append(kwargs_simulate)

# if n_cpus > 1: # TODO?
pool = fmu_pool.FMUPool(self.model, n_process=n_cpus)
return pool.run(list_kwargs, final=self.__final)

Expand Down

0 comments on commit 9c00c6b

Please sign in to comment.