Skip to content
Snippets Groups Projects
  • William F Godoy's avatar
    77a5923b
    Tested refactored implementation · 77a5923b
    William F Godoy authored
    1 Now IO (replaced Method) and is the factory for Variables and Engines
    2 Reduced core components to user-public objects only
    3 Moved and reorganized all helper functions to helper directory
    4 Engines are now lightweight (except for ADIOS1Reader WIP) using MACRO
    5 HF5Common and ADIOS1Common (except for Readers WIP) are now part of the toolkit so they can be reused by Engines
    6 TransportMan is a new layer for transport management (file is default)
    7 DataMan will be implemented under toolkit/transportman/dataman
    8 Template separation (tcc and inl) applied all over the code
    9 Improved Doxygen documentation
    
    Runtime Issues:
    DataMan library compilation (cacheman)
    ADIOS1 Warning
    TestADIOSInterfaceWrite catches exceptions
    77a5923b
    History
    Tested refactored implementation
    William F Godoy authored
    1 Now IO (replaced Method) and is the factory for Variables and Engines
    2 Reduced core components to user-public objects only
    3 Moved and reorganized all helper functions to helper directory
    4 Engines are now lightweight (except for ADIOS1Reader WIP) using MACRO
    5 HF5Common and ADIOS1Common (except for Readers WIP) are now part of the toolkit so they can be reused by Engines
    6 TransportMan is a new layer for transport management (file is default)
    7 DataMan will be implemented under toolkit/transportman/dataman
    8 Template separation (tcc and inl) applied all over the code
    9 Improved Doxygen documentation
    
    Runtime Issues:
    DataMan library compilation (cacheman)
    ADIOS1 Warning
    TestADIOSInterfaceWrite catches exceptions
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Transport.cpp 1.92 KiB
/*
 * Distributed under the OSI-approved Apache License, Version 2.0.  See
 * accompanying file Copyright.txt for details.
 *
 * Transport.cpp
 *
 *  Created on: Dec 5, 2016
 *      Author: wfg
 */

#include "Transport.h"

#include "adios2/ADIOSMPI.h"

namespace adios
{

Transport::Transport(const std::string type, const std::string library,
                     MPI_Comm mpiComm, const bool debugMode)
: m_Type(type), m_Library(library), m_MPIComm(mpiComm), m_DebugMode(debugMode)
{
    MPI_Comm_rank(m_MPIComm, &m_RankMPI);
    MPI_Comm_size(m_MPIComm, &m_SizeMPI);
}

void Transport::InitProfiler(const OpenMode openMode, const TimeUnit timeUnit)
{
    m_Profiler.Timers.emplace(std::make_pair(
        "open", profiling::Timer("open", TimeUnit::mus, m_DebugMode)));

    if (openMode == OpenMode::Write || openMode == OpenMode::w)
    {
        m_Profiler.Timers.emplace(
            "write", profiling::Timer("write", timeUnit, m_DebugMode));

        m_Profiler.Bytes.emplace("write", 0);
    }
    else if (openMode == OpenMode::Append || openMode == OpenMode::a)
    {
        m_Profiler.Timers.emplace(
            "append", profiling::Timer("append", timeUnit, m_DebugMode));
        m_Profiler.Bytes.emplace("append", 0);
    }
    else if (openMode == OpenMode::Read || openMode == OpenMode::r)
    {
        m_Profiler.Timers.emplace(
            "read", profiling::Timer("read", timeUnit, m_DebugMode));
        m_Profiler.Bytes.emplace("read", 0);
    }

    m_Profiler.Timers.emplace(
        "close", profiling::Timer("close", TimeUnit::mus, m_DebugMode));

    m_Profiler.IsActive = true;
}

void Transport::SetBuffer(char * /*buffer*/, size_t /*size*/)
{
    if (m_DebugMode == true)
    {
        std::invalid_argument("ERROR: " + m_Name + " transport type " + m_Type +
                              " using library " + m_Library +
                              " doesn't implement the SetBuffer function\n");
    }
}

} // end namespace adios