Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add progress bar for unit evalution #20

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

adumasphi
Copy link
Contributor

No description provided.

@adumasphi
Copy link
Contributor Author

cc @jschueller

@adumasphi adumasphi force-pushed the progress_bar branch 2 times, most recently from f6de8f6 to 1b51259 Compare January 16, 2024 17:24
otwrapy/_otwrapy.py Outdated Show resolved Hide resolved
@@ -574,7 +609,7 @@ def __init__(self, wrapper, backend='multiprocessing', n_cpus=-1, verbosity=10,

# This configures how to run samples on the model :
if self.n_cpus == 1:
self._exec_sample = self.wrapper
self._exec_sample = _exec_sample_unit_progress_bar(self.wrapper, verbosity)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets actually allow a "progress_bar" backend keyword, so the condition rewrites if backend=="progress_bar" or self.n_cpus == 1
it should be renamed "serial" though which is more explicit (rename the function _exec_sample_serial too)

@@ -8,6 +8,9 @@ def backendtest(backend):
ot.RandomGenerator.SetSeed(0)
n_cpu = multiprocessing.cpu_count()
sizes = [1, n_cpu, n_cpu + 1]
if backend == 'progress_bar':
backend = 'multiprocessing' # default backend not really used
n_cpu = 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then here we could actually drop this and allow for the "serial" backend

README.rst Show resolved Hide resolved
@jschueller jschueller merged commit c5b78b6 into openturns:master Jan 18, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants