meshmode icon indicating copy to clipboard operation
meshmode copied to clipboard

Two `resample_by_picking` in simple-dg TranslationUnit

Open inducer opened this issue 4 years ago • 2 comments

I was just playing with (and being amazed by!) https://github.com/inducer/meshmode/pull/216.(https://github.com/inducer/meshmode/pull/216/commits/1de7f8f8fc3518ead4cd0191adf2238078636543 specifically, and https://github.com/inducer/pytato/commit/585576ac4a94c6bc3e38e5fc85ffa2fb165afea0)

If I run python simple.dg --lazy and set a break point at https://github.com/inducer/arraycontext/blob/82b03d20849d9aac0f54cb4e9c00ba0f5908911c/arraycontext/impl/pytato/compile.py#L306, and then go

print(self.pytato_program.program)

the resulting TranslationUnit comes out with two copies of resample_by_picking that aren't visibly different:

>>> print(self.pytato_program.program)
---------------------------------------------------------------------------
KERNEL: resample_by_picking
---------------------------------------------------------------------------
ARGUMENTS:
ary: type: np:dtype('float64'), shape: (nelements_vec, n_from_nodes), dim_tags: (N1:stride:n_from_nodes, N0:stride:1), offset:  aspace: global
from_element_indices: type: np:dtype('int64'), shape: (nelements), dim_tags: (N0:stride:1), offset:  aspace: global
n_from_nodes: ValueArg, type: np:dtype('int32')
n_to_nodes: ValueArg, type: np:dtype('int64')
nelements: ValueArg, type: np:dtype('int64')
nelements_vec: ValueArg, type: np:dtype('int32')
pick_list: type: np:dtype('int32'), shape: (n_to_nodes), dim_tags: (N0:stride:1), offset:  aspace: global
result: type: np:dtype('float64'), shape: (nelements, n_to_nodes), dim_tags: (N1:stride:n_to_nodes, N0:stride:1), offset:  aspace: global
---------------------------------------------------------------------------
DOMAINS:
[nelements] -> { [iel] : 0  { [idof] : 0  aspace: global
from_element_indices: type: np:dtype('int32'), shape: (nelements), dim_tags: (N0:stride:1), offset:  aspace: global
n_from_nodes: ValueArg, type: np:dtype('int32')
n_to_nodes: ValueArg, type: np:dtype('int64')
nelements: ValueArg, type: np:dtype('int64')
nelements_vec: ValueArg, type: np:dtype('int32')
pick_list: type: np:dtype('int32'), shape: (n_to_nodes), dim_tags: (N0:stride:1), offset:  aspace: global
result: type: np:dtype('float64'), shape: (nelements, n_to_nodes), dim_tags: (N1:stride:n_to_nodes, N0:stride:1), offset:  aspace: global
---------------------------------------------------------------------------
DOMAINS:
[nelements] -> { [iel] : 0  { [idof] : 0 

Any thoughts on why that might be?

cc @kaushikcfd @matthiasdiener

inducer avatar Jul 01 '21 20:07 inducer

The dtypes of from_element_indices are different, unusure yet what's causing it.

< from_element_indices: type: np:dtype('int32'), shape: (nelements), dim_tags: (N0:stride:1), offset:  aspace: global
---
> from_element_indices: type: np:dtype('int64'), shape: (nelements), dim_tags: (N0:stride:1), offset:  aspace: global

kaushikcfd avatar Jul 01 '21 20:07 kaushikcfd

Ah, good catch! I had missed that. This is likely on the meshmode end then. Moving there...

inducer avatar Jul 01 '21 20:07 inducer