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 an empty mesh issue(?) #7

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

majosm
Copy link

@majosm majosm commented Jan 19, 2023

Hey @kaushikcfd, I just noticed this commit in my production branch. I think I vaguely remember us talking about it (IIRC I bumped into an issue when running a problem containing empty local meshes where this part of the code was complaining about something being freed before it was allocated). I don't know if this is still needed, or if the issue was fixed elsewhere... any ideas?

I'm going to try running the 3D Y2 prediction case without this to see if it fails. Unfortunately I don't remember if that was the case that triggered this issue originally or not. Will report back what happens.

@majosm
Copy link
Author

majosm commented Jan 19, 2023

Yeah, looks like it's still needed. Without the change I get:

  File "python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "python3.9/site-packages/mpi4py/__main__.py", line 7, in <module>
    main()
  File "python3.9/site-packages/mpi4py/run.py", line 198, in main
    run_command_line(args)
  File "python3.9/site-packages/mpi4py/run.py", line 47, in run_command_line
    run_path(sys.argv[0], run_name='__main__')
  File "python3.9/runpy.py", line 288, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "./prediction.py", line 3787, in <module>
    main(restart_filename=restart_filename, target_filename=target_filename,
  File "mirgecom/mirgecom/mpi.py", line 157, in wrapped_func
    func(*args, **kwargs)
  File "./prediction.py", line 3630, in main
    advance_state(rhs=my_rhs, timestepper=timestepper,
  File "mirgecom/mirgecom/steppers.py", line 425, in advance_state
    _advance_state_stepper_func(
  File "mirgecom/mirgecom/steppers.py", line 159, in _advance_state_stepper_func
    state = timestepper(state=state, t=t, dt=dt, rhs=compiled_rhs)
  File "./prediction.py", line 1631, in _compiled_stepper_wrapper
    return compiled_lsrk45_step(actx, state, t, dt, rhs)
  File "grudge/grudge/shortcuts.py", line 56, in compiled_lsrk45_step
    rhs_val = f(t + c*h, y)
  File "arraycontext/arraycontext/impl/pytato/compile.py", line 365, in __call__
    compiled_func = self._dag_to_compiled_func(
  File "grudge/grudge/array_context.py", line 306, in _dag_to_compiled_func
    ) = self._dag_to_transformed_pytato_prg(
  File "arraycontext/arraycontext/impl/pytato/compile.py", line 441, in _dag_to_transformed_pytato_prg
    pytato_program = (pytato_program
  File "pytato/pytato/target/loopy/__init__.py", line 142, in with_transformed_program
    return self.copy(program=f(self.program))
  File "meshmode/meshmode/array_context.py", line 1761, in transform_loopy_program
    t_unit = _alias_global_temporaries(t_unit)
  File "meshmode/meshmode/array_context.py", line 521, in _alias_global_temporaries
    tv = new_tvs[tv_name]
KeyError: '_pt_temp'

@kaushikcfd
Copy link
Owner

Hi Matt,
Some updates here. I reimplemented the logic here as part of inducer/arraycontext#217. Please let me know if we still need this patch. If yes, I will be happy to put this into the upstream PR that I pointed (with the correct attribution of course).

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