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

Fix progress bar error for parallel executions #3859

Merged
merged 2 commits into from
Nov 11, 2024

Conversation

Ig-dolci
Copy link
Contributor

@Ig-dolci Ig-dolci commented Nov 11, 2024

Description

ProgressBar is now being tested by adding it in parallel execution.

See the error:


Evaluating Adjoint ▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣▣ 401/401 [0:00:41]Traceback (most recent call last):
  File "/Users/ddolci/work/firedrake/simulations_worflows_did/fwi/circle_fwi.py", line 118, in <module>
Traceback (most recent call last):
  File "/Users/ddolci/work/firedrake/simulations_worflows_did/fwi/circle_fwi.py", line 118, in <module>
    J_hat.derivative()
    J_hat.derivative()
  File "/Users/ddolci/work/firedrake/src/firedrake/firedrake/adjoint/ensemble_reduced_functional.py", line 139, in derivative
  File "/Users/ddolci/work/firedrake/src/firedrake/firedrake/adjoint/ensemble_reduced_functional.py", line 139, in derivative
    dJdm_local = super(EnsembleReducedFunctional, self).derivative(adj_input=adj_input, options=options)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ddolci/work/firedrake/src/pyadjoint/pyadjoint/reduced_functional.py", line 130, in derivative
    dJdm_local = super(EnsembleReducedFunctional, self).derivative(adj_input=adj_input, options=options)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ddolci/work/firedrake/src/pyadjoint/pyadjoint/reduced_functional.py", line 130, in derivative
    derivatives = compute_gradient(self.functional,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ddolci/work/firedrake/src/pyadjoint/pyadjoint/drivers.py", line 30, in compute_gradient
    derivatives = compute_gradient(self.functional,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ddolci/work/firedrake/src/pyadjoint/pyadjoint/drivers.py", line 30, in compute_gradient
    tape.evaluate_adj(markings=True)
    tape.evaluate_adj(markings=True)
  File "/Users/ddolci/work/firedrake/src/pyadjoint/pyadjoint/tape.py", line 339, in evaluate_adj
  File "/Users/ddolci/work/firedrake/src/pyadjoint/pyadjoint/tape.py", line 339, in evaluate_adj
    self._checkpoint_manager.evaluate_adj(last_block, markings)
    self._checkpoint_manager.evaluate_adj(last_block, markings)
  File "/Users/ddolci/work/firedrake/src/pyadjoint/pyadjoint/checkpointing.py", line 220, in evaluate_adj
  File "/Users/ddolci/work/firedrake/src/pyadjoint/pyadjoint/checkpointing.py", line 220, in evaluate_adj
    with self.tape.progress_bar("Evaluating Adjoint", max=self.total_timesteps) as progress_bar:
    with self.tape.progress_bar("Evaluating Adjoint", max=self.total_timesteps) as progress_bar:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: _NullProgressBar.__exit__() takes 1 positional argument but 4 were given
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: _NullProgressBar.__exit__() takes 1 positional argument but 4 were given

Copy link

github-actions bot commented Nov 11, 2024

TestsPassed ✅Skipped ⏭️Failed ❌
Firedrake complex8090 ran6507 passed1583 skipped0 failed

Copy link

github-actions bot commented Nov 11, 2024

TestsPassed ✅Skipped ⏭️Failed ❌
Firedrake real8096 ran7310 passed786 skipped0 failed

Copy link
Contributor

@connorjward connorjward left a comment

Choose a reason for hiding this comment

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

I think this will be fine if we re-run things now.

@connorjward connorjward merged commit 29c486d into master Nov 11, 2024
12 checks passed
@connorjward connorjward deleted the dolci/fix_progress_bar branch November 11, 2024 11:49
connorjward pushed a commit that referenced this pull request Nov 25, 2024
* Fix progress bar erros for parallel executions

* Test for a parallel execution
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.

2 participants