source/adios2/engine/julea-kv-old/JuleaKVReader.cpp
/**
 * Initializes variables so that InquireVariable can find the variable in the IO
 * map. Since the m_Variables is private the only solution is to define each
 * variable with the according parameters.
 */
Initializes variables so that InquireVariable can find the variable in the IO
map. Since the m_Variables is private the only solution is to define each
variable with the according parameters.
Initializes variables so that InquireVariable can find the variable in the IO map . Since the m_Variables is private the only solution is to define each variable with the according parameters .
void JuleaKVReader::InitVariables()
{
    bson_iter_t b_iter;
    bson_t *bsonNames;
    std::string varName;
    std::string nameSpace = m_Name;
    std::string kvName = "variable_names";
    unsigned int varCount = 0;
    GetNamesFromJulea(nameSpace, &bsonNames, &varCount, true);
    if (varCount == 0)
    {
        if (m_Verbosity == 5)
        {
            std::cout << "++ InitVariables: no variables stored in KV"
                      << std::endl;
        }
    }
    else
    {
        bson_iter_init(&b_iter, bsonNames);
        while (bson_iter_next(&b_iter))
        {
            Dims shape;
            Dims start;
            Dims count;
            ShapeID shapeID = ShapeID::Unknown;
            bool constantDims;
            bool isReadAsJoined;
            bool isReadAsLocalValue;
            bool isRandomAccess;
            std::string type;
            guint32 buffer_len;
            gpointer md_buffer = nullptr;
            size_t *blocks = nullptr;
            size_t numberSteps = 0;
            std::string varName(bson_iter_key(&b_iter));
            if(varName =="time")
            {
                continue;
            }
            GetVariableMetadataFromJulea(nameSpace, varName, &md_buffer,
                                         &buffer_len);
            DeserializeVariableMetadata(md_buffer, &type, &shape, &start,
                                        &count, &constantDims, &blocks,
                                        &numberSteps, &shapeID, &isReadAsJoined,
                                        &isReadAsLocalValue, &isRandomAccess);
            DefineVariableInInit(&m_IO, varName, type, shape, start, count,
                                 constantDims);
            InitVariable(&m_IO, *this, varName, blocks, numberSteps, shapeID);
            delete[] blocks;
        }
        bson_destroy(bsonNames);
    }
}
void JuleaKVReader :: InitVariables ( ) { bson_iter_t b_iter ; bson_t * bsonNames ; std :: string varName ; std :: string nameSpace = m_Name ; std :: string kvName = " " ; unsigned int varCount = 0 ; GetNamesFromJulea ( nameSpace , & bsonNames , & varCount , true ) ; if ( varCount == 0 ) { if ( m_Verbosity == 5 ) { std :: cout << " " << std :: endl ; } } else { bson_iter_init ( & b_iter , bsonNames ) ; while ( bson_iter_next ( & b_iter ) ) { Dims shape ; Dims start ; Dims count ; ShapeID shapeID = ShapeID :: Unknown ; bool constantDims ; bool isReadAsJoined ; bool isReadAsLocalValue ; bool isRandomAccess ; std :: string type ; guint32 buffer_len ; gpointer md_buffer = nullptr ; size_t * blocks = nullptr ; size_t numberSteps = 0 ; std :: string varName ( bson_iter_key ( & b_iter ) ) ; if ( varName == " " ) { continue ; } GetVariableMetadataFromJulea ( nameSpace , varName , & md_buffer , & buffer_len ) ; DeserializeVariableMetadata ( md_buffer , & type , & shape , & start , & count , & constantDims , & blocks , & numberSteps , & shapeID , & isReadAsJoined , & isReadAsLocalValue , & isRandomAccess ) ; DefineVariableInInit ( & m_IO , varName , type , shape , start , count , constantDims ) ; InitVariable ( & m_IO , * this , varName , blocks , numberSteps , shapeID ) ; delete [ ] blocks ; } bson_destroy ( bsonNames ) ; } }
Initializes variables so that InquireVariable can find the variable in the IO
 map.
Initializes variables so that InquireVariable can find the variable in the IO map .
// std::cout << "-- bsonNames length: " << bsonNames->len << std::endl; /** there are several fields that need to be set in a variable that
             * are not required when defining a variable in the IO. Therefore
             * they need to be set now. */ // TODO necessary? 2.10.21 does not seem so // const std::string testtype = m_IO.InquireVariableType(varName);