ADIOS2 icon indicating copy to clipboard operation
ADIOS2 copied to clipboard

Block selection issue when one step does not have any block

Open pnorbert opened this issue 6 years ago • 2 comments

ERROR: invalid blockID 0 from steps start 2 in variable v3, check argument to Variable<T>::SetBlockID, in call to Get

The issue shows up in the next step where the variable appears again.

The examples/basics/localArray example shows this bug if the writer code is forced to omit writing a variable (v3) in step 2 in localArray_write.cpp:166-169

            if (step == 2)
            {
                chance = 0;
            }

This will result in v3 missing in step 2:

$ bpls -l localArray.bp/ -D v3
  double   v3    4*[__]*{__} = 0 / 3.4
        step 0: 
          block 0: [0:8] = 0 / 0
        step 1: 
          block 0: [0:5] = 0.1 / 0.1
          block 1: [0:6] = 1.1 / 1.1
        step 3: 
          block 0: [0:9] = 1.3 / 1.3
        step 4: 
          block 0: [0:5] = 0.4 / 0.4
          block 1: [0:5] = 1.4 / 1.4
          block 2: [0:5] = 3.4 / 3.4

Then the read example fails when getting variable v3 in step 3.

$ ./bin/localArray_read 
Process step 0: 
...
Process step 2: 
    v0 has 4 blocks in step 2
        block 0 size = "6" offset = "" : 0.2 0.2 0.2 0.2 0.2 0.2 
        block 1 size = "6" offset = "" : 1.2 1.2 1.2 1.2 1.2 1.2 
        block 2 size = "6" offset = "" : 2.2 2.2 2.2 2.2 2.2 2.2 
        block 3 size = "6" offset = "" : 3.2 3.2 3.2 3.2 3.2 3.2 
    v1 has 4 blocks in step 2
        block 0 size = "6" offset = "" : 0.2 0.2 0.2 0.2 0.2 0.2 
        block 1 size = "10" offset = "" : 1.2 1.2 1.2 1.2 1.2 1.2 1.2 1.2 1.2 1.2 
        block 2 size = "5" offset = "" : 2.2 2.2 2.2 2.2 2.2 
        block 3 size = "10" offset = "" : 3.2 3.2 3.2 3.2 3.2 3.2 3.2 3.2 3.2 3.2 
    v2 has 4 blocks in step 2
        block 0 size = "6" offset = "" : 0.2 0.2 0.2 0.2 0.2 0.2 
        block 1 size = "7" offset = "" : 1.2 1.2 1.2 1.2 1.2 1.2 1.2 
        block 2 size = "9" offset = "" : 2.2 2.2 2.2 2.2 2.2 2.2 2.2 2.2 2.2 
        block 3 size = "10" offset = "" : 3.2 3.2 3.2 3.2 3.2 3.2 3.2 3.2 3.2 3.2 
    Variable v3 not found in step 2
Process step 3: 
    v0 has 4 blocks in step 3
        block 0 size = "6" offset = "" : 0.3 0.3 0.3 0.3 0.3 0.3 
        block 1 size = "6" offset = "" : 1.3 1.3 1.3 1.3 1.3 1.3 
        block 2 size = "6" offset = "" : 2.3 2.3 2.3 2.3 2.3 2.3 
        block 3 size = "6" offset = "" : 3.3 3.3 3.3 3.3 3.3 3.3 
    v1 has 4 blocks in step 3
        block 0 size = "6" offset = "" : 0.3 0.3 0.3 0.3 0.3 0.3 
        block 1 size = "10" offset = "" : 1.3 1.3 1.3 1.3 1.3 1.3 1.3 1.3 1.3 1.3 
        block 2 size = "5" offset = "" : 2.3 2.3 2.3 2.3 2.3 
        block 3 size = "10" offset = "" : 3.3 3.3 3.3 3.3 3.3 3.3 3.3 3.3 3.3 3.3 
    v2 has 4 blocks in step 3
        block 0 size = "5" offset = "" : 0.3 0.3 0.3 0.3 0.3 
        block 1 size = "10" offset = "" : 1.3 1.3 1.3 1.3 1.3 1.3 1.3 1.3 1.3 1.3 
        block 2 size = "7" offset = "" : 2.3 2.3 2.3 2.3 2.3 2.3 2.3 
        block 3 size = "9" offset = "" : 3.3 3.3 3.3 3.3 3.3 3.3 3.3 3.3 3.3 
    v3 has 1 blocks in step 3
Invalid argument exception, STOPPING PROGRAM
ERROR: invalid blockID 0 from steps start 2 in variable v3, check argument to Variable<T>::SetBlockID, in call to Get

Note: This reading example uses BeginStep/EndStep to step through the steps, so no SetStepSelection() is used here. Note: The bug appears with both BP3 and BP4 engines.

pnorbert avatar Aug 20 '19 11:08 pnorbert

Same bug as #1639

pnorbert avatar May 21 '20 17:05 pnorbert

This looks failing now with BP5 without even having zero block. Needs testing.

pnorbert avatar Dec 12 '23 19:12 pnorbert