<commit_before>/*
 * Distributed under the OSI-approved Apache License, Version 2.0.  See
 * accompanying file Copyright.txt for details.
 *
 * DataManReader.tcc
 *
 *  Created on: Dec 8, 2017
 *      Author: <NAME> <EMAIL>
 */

#ifndef ADIOS2_ENGINE_DATAMAN_DATAMANREADER_TCC_
#define ADIOS2_ENGINE_DATAMAN_DATAMANREADER_TCC_

#include "DataManReader.h"

namespace adios2
{

template <class T>
void DataManReader::GetSyncCommon(Variable<T> &variable, T *data)
{
    if (m_UseFormat == "BP" || m_UseFormat == "bp" )
    {
        m_BP3Deserializer.GetSyncVariableDataFromStream(
            variable, m_BP3Deserializer.m_Data);

        size_t varsize = std::accumulate(variable.m_Shape.begin(), variable.m_Shape.end(), 1,
                std::multiplies<std::size_t>());

        std::memcpy(data, variable.GetData(), varsize);
    }
}

template <class T>
void DataManReader::GetDeferredCommon(Variable<T> &variable, T *data)
{
    GetSyncCommon(variable, data);
}

} // end namespace adios2

#endif /* ADIOS2_ENGINE_DATAMAN_DATAMANREADER_TCC_ */<commit_msg>fixed a data size problem in dataman reader<commit_after>/*
 * Distributed under the OSI-approved Apache License, Version 2.0.  See
 * accompanying file Copyright.txt for details.
 *
 * DataManReader.tcc
 *
 *  Created on: Dec 8, 2017
 *      Author: <NAME> <EMAIL>
 */

#ifndef ADIOS2_ENGINE_DATAMAN_DATAMANREADER_TCC_
#define ADIOS2_ENGINE_DATAMAN_DATAMANREADER_TCC_

#include "DataManReader.h"

namespace adios2
{

template <class T>
void DataManReader::GetSyncCommon(Variable<T> &variable, T *data)
{
    if (m_UseFormat == "BP" || m_UseFormat == "bp" )
    {
        m_BP3Deserializer.GetSyncVariableDataFromStream(
            variable, m_BP3Deserializer.m_Data);

        size_t varsize = std::accumulate(variable.m_Shape.begin(), variable.m_Shape.end(), sizeof(T),
                std::multiplies<std::size_t>());

        std::memcpy(data, variable.GetData(), varsize);
    }
}

template <class T>
void DataManReader::GetDeferredCommon(Variable<T> &variable, T *data)
{
    GetSyncCommon(variable, data);
}

} // end namespace adios2

#endif /* ADIOS2_ENGINE_DATAMAN_DATAMANREADER_TCC_ */
{'fraction_non_alphanumeric': 0.11966604823747681, 'fraction_numerical': 0.013450834879406308, 'mean_word_length': 4.111374407582939, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3623092', 'n_tokens_mistral': 792, 'n_tokens_neox': 762, 'n_words': 151}