Unverified Commit c43974fc authored by William F Godoy's avatar William F Godoy Committed by GitHub
Browse files

Merge pull request #1044 from williamfgc/local_vars

Local vars
parents 340ed86d c9338dfb
Loading
Loading
Loading
Loading
+5 −10
Original line number Diff line number Diff line
@@ -103,8 +103,7 @@ adios2_FILE *adios2_fopen_glue(const char *name, const char *mode,
    }
    catch (...)
    {
        static_cast<adios2_error>(
            adios2::helper::ExceptionToError("adios2_fopen"));
        adios2::helper::ExceptionToError("adios2_fopen");
    }
    return stream;
}
@@ -128,8 +127,7 @@ adios2_FILE *adios2_fopen_config_glue(const char *name, const char *mode,
    }
    catch (...)
    {
        static_cast<adios2_error>(
            adios2::helper::ExceptionToError("adios2_fopen_config"));
        adios2::helper::ExceptionToError("adios2_fopen_config");
    }
    return stream;
}
@@ -164,8 +162,7 @@ adios2_FILE *adios2_fopen_glue(const char *name, const char *mode,
    }
    catch (...)
    {
        static_cast<adios2_error>(
            adios2::helper::ExceptionToError("adios2_fopen"));
        adios2::helper::ExceptionToError("adios2_fopen");
    }
    return stream;
}
@@ -189,8 +186,7 @@ adios2_FILE *adios2_fopen_config_glue(const char *name, const char *mode,
    }
    catch (...)
    {
        static_cast<adios2_error>(
            adios2::helper::ExceptionToError("adios2_fopen_config"));
        adios2::helper::ExceptionToError("adios2_fopen_config");
    }
    return stream;
}
@@ -433,8 +429,7 @@ adios2_step *adios2_fgets(adios2_step *step, adios2_FILE *stream)
    }
    catch (...)
    {
        static_cast<adios2_error>(
            adios2::helper::ExceptionToError("adios2_fgets"));
        adios2::helper::ExceptionToError("adios2_fgets");
    }
    return step;
}
+16 −0
Original line number Diff line number Diff line
@@ -38,6 +38,14 @@ namespace adios2
    }                                                                          \
                                                                               \
    template <>                                                                \
    void Variable<T>::SetBlockSelection(const size_t blockID)                  \
    {                                                                          \
        helper::CheckForNullptr(m_Variable,                                    \
                                "in call to Variable<T>::SetBlockSelection");  \
        m_Variable->SetBlockSelection(blockID);                                \
    }                                                                          \
                                                                               \
    template <>                                                                \
    void Variable<T>::SetSelection(const Box<Dims> &selection)                 \
    {                                                                          \
        helper::CheckForNullptr(m_Variable,                                    \
@@ -134,6 +142,14 @@ namespace adios2
    }                                                                          \
                                                                               \
    template <>                                                                \
    size_t Variable<T>::BlockID() const                                        \
    {                                                                          \
        helper::CheckForNullptr(m_Variable,                                    \
                                "in call to Variable<T>::BlockID");            \
        return m_Variable->m_BlockID;                                          \
    }                                                                          \
                                                                               \
    template <>                                                                \
    size_t Variable<T>::AddOperation(const Operator op,                        \
                                     const Params &parameters)                 \
    {                                                                          \
+17 −0
Original line number Diff line number Diff line
@@ -59,6 +59,16 @@ public:
     */
    void SetShape(const adios2::Dims &shape);

    /**
     * Read mode only. Required for reading local variables, ShapeID() =
     * ShapeID::LocalArray or ShapeID::LocalValue. For Global Arrays it will Set
     * the appropriate Start and Count Selection for the global array
     * coordinates.
     * @param blockID: variable block index defined at write time. Blocks can be
     * inspected with bpls -D variableName
     */
    void SetBlockSelection(const size_t blockID);

    /**
     * Sets a variable selection modifying current {start, count}
     * Count is the dimension from Start point
@@ -153,6 +163,13 @@ public:
     */
    size_t StepsStart() const;

    /**
     * For read mode, retrieve current BlockID, default = 0 if not set with
     * SetBlockID
     * @return current block id
     */
    size_t BlockID() const;

    /**
     * EXPERIMENTAL: carries information about an Operation added with
     * AddOperation
+7 −6
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ namespace adios2
 *  DefineVariable */
enum class ShapeID
{
    Unknown,     ///< undefined shapeID
    GlobalValue, ///< single global value, common case
    GlobalArray, ///< global (across MPI_Comm) array, common case
    JoinedArray, ///< global array with a common (joinable) dimension
@@ -136,8 +137,8 @@ using std::uint64_t;
using cfloat = std::complex<float>;
using cdouble = std::complex<double>;

// Limit
constexpr size_t MaxSizeT = std::numeric_limits<size_t>::max();
// Limit, using uint64_t to make it portable
constexpr uint64_t MaxSizeT = std::numeric_limits<uint64_t>::max();

// adios defaults
#ifdef _WIN32
@@ -153,7 +154,7 @@ constexpr size_t DefaultInitialBufferSize = 16 * 1024;

/** default maximum bp buffer size, unlimited, in bytes.
 *  Needs to be studied for optimizing applications */
constexpr size_t DefaultMaxBufferSize = MaxSizeT - 1;
constexpr uint64_t DefaultMaxBufferSize = MaxSizeT - 1;

/** default buffer growth factor. Needs to be studied
 * for optimizing applications*/
@@ -174,9 +175,9 @@ constexpr char PathSeparator =
constexpr bool DebugON = true;
constexpr bool DebugOFF = false;
constexpr size_t UnknownDim = 0;
constexpr size_t JoinedDim = MaxSizeT - 1;
constexpr size_t LocalValueDim = MaxSizeT - 2;
constexpr size_t IrregularDim = MaxSizeT - 3;
constexpr uint64_t JoinedDim = MaxSizeT - 1;
constexpr uint64_t LocalValueDim = MaxSizeT - 2;
constexpr uint64_t IrregularDim = MaxSizeT - 3;
constexpr bool ConstantDims = true;
constexpr bool endl = true;

+2 −0
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@ namespace core
        info.Shape = m_Shape;                                                  \
        info.Start = m_Start;                                                  \
        info.Count = m_Count;                                                  \
        info.BlockID = m_BlockID;                                              \
        info.Selection = m_SelectionType;                                      \
        info.MemoryStart = m_MemoryStart;                                      \
        info.MemoryCount = m_MemoryCount;                                      \
        info.StepsStart = stepsStart;                                          \
Loading