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

Bug in the logic for reading a derived variable #4453

Open
anagainaru opened this issue Feb 1, 2025 · 0 comments
Open

Bug in the logic for reading a derived variable #4453

anagainaru opened this issue Feb 1, 2025 · 0 comments
Assignees

Comments

@anagainaru
Copy link
Contributor

We are not setting the dimensions correctly for derived variables. In the following example, there is a file with 3 variables (3D 200x200x200) and a derived variable that has only stats in the bp file:

$ bpls -l out_test.bp/ --show-derived
  double   derived  100*{200, 200, 200} = 0.688576 / 172.425
    Derived variable with expression: MAGNITUDE({var1},{var2},{var3})
  double   var1     100*{200, 200, 200} = -100 / 100
  double   var2     100*{200, 200, 200} = -100 / 100
  double   var3     100*{200, 200, 200} = -99.9999 / 100

Now, let's say we have a python code that sets a selection and reads a variable (given as an input parameter):

        rStream.BeginStep()
        adiosVar = ioReader.InquireVariable(givenName)
        adiosVar.SetSelection([(0,0,0), (10,10,10)])
        buffer = np.zeros(selCount)
        rStream.Get(adiosVar, buffer)
        rStream.EndStep()

If I run this code with one of the normal variables (var1 for example) the code in source/adios2/toolkit/format/bp5/BP5Deserializer.cpp creates an entry in the RR structure for a chunk of {10,10,10} and size 2894480 bytes.

For the derived variable there are 3 RR created (for var1, var2, var3) each set as {200,200,200} and 64000000 bytes, and when I look in the ApplyExpression, this function is called on a derived data of {200,200,200} and magnitude is applied on three arrays of {200,200,200}.

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

No branches or pull requests

2 participants