Skip to content
Snippets Groups Projects
Commit 30aa224c authored by Wang, Ruonan's avatar Wang, Ruonan
Browse files

solved conflicts

parents 75ded757 694567f9
No related branches found
No related tags found
1 merge request!270Finished DataMan Transport Manager refactoring but full functionality still pending on Read API
Showing
with 2051 additions and 18 deletions
defaults: &defaults
working_directory: /home/adios2
steps:
- checkout:
path: /home/adios2/source
- run:
name: Update
command: bash source/scripts/circle/runOnCircle.sh update
- run:
name: Configure
command: bash source/scripts/circle/runOnCircle.sh configure
- run:
name: Build
command: bash source/scripts/circle/runOnCircle.sh build
- run:
name: Test
command: bash source/scripts/circle/runOnCircle.sh test
version: 2
jobs:
"el7-gcc48":
<<: *defaults
docker:
- image: ornladios/adios2:el7-ohpc
"el7-gcc7-openmpi":
<<: *defaults
docker:
- image: ornladios/adios2:el7-ohpc
workflows:
version: 2
build:
jobs:
- "el7-gcc48"
- "el7-gcc7-openmpi"
...@@ -23,3 +23,5 @@ ...@@ -23,3 +23,5 @@
*.bp.dir *.bp.dir
build/ build/
# Mac OSX finder-related files
.DS_Store
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# accompanying file Copyright.txt for details. # accompanying file Copyright.txt for details.
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
cmake_minimum_required(VERSION 3.5) cmake_minimum_required(VERSION 3.6)
# Fail immediately if not using an out-of-source build # Fail immediately if not using an out-of-source build
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
...@@ -45,7 +45,7 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) ...@@ -45,7 +45,7 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
include(ADIOSFunctions) include(ADIOSFunctions)
# Default to a debug build if not specified # Default to a debug build if not specified
if(NOT CMAKE_BUILD_TYPE) if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build." FORCE) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build." FORCE)
endif() endif()
...@@ -59,18 +59,10 @@ include(CMakeDependentOption) ...@@ -59,18 +59,10 @@ include(CMakeDependentOption)
# to that. Otherwise base the default on whether or not shared libs are even # to that. Otherwise base the default on whether or not shared libs are even
# supported. # supported.
get_property(SHARED_LIBS_SUPPORTED GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS) get_property(SHARED_LIBS_SUPPORTED GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)
if(DEFINED ADIOS2_BUILD_SHARED_LIBS) cmake_dependent_option(BUILD_SHARED_LIBS
set(ADIOS2_BUILD_SHARED_LIBS_DEFAULT ${ADIOS2_BUILD_SHARED_LIBS}) "Build shared libraries (so/dylib/dll)." ${SHARED_LIBS_SUPPORTED}
elseif(DEFINED BUILD_SHARED_LIBS)
set(ADIOS2_BUILD_SHARED_LIBS_DEFAULT ${BUILD_SHARED_LIBS})
else()
set(ADIOS2_BUILD_SHARED_LIBS_DEFAULT ${SHARED_LIBS_SUPPORTED})
endif()
cmake_dependent_option(ADIOS2_BUILD_SHARED_LIBS
"Build shared libraries (so/dylib/dll)." ${ADIOS2_BUILD_SHARED_LIBS_DEFAULT}
"SHARED_LIBS_SUPPORTED" OFF "SHARED_LIBS_SUPPORTED" OFF
) )
set(BUILD_SHARED_LIBS ${ADIOS2_BUILD_SHARED_LIBS})
mark_as_advanced(BUILD_SHARED_LIBS) mark_as_advanced(BUILD_SHARED_LIBS)
# Setup PIC defaults. If explicitly specified somehow, then default # Setup PIC defaults. If explicitly specified somehow, then default
...@@ -98,15 +90,18 @@ adios_option(ZeroMQ "Enable support for ZeroMQ" AUTO) ...@@ -98,15 +90,18 @@ adios_option(ZeroMQ "Enable support for ZeroMQ" AUTO)
adios_option(HDF5 "Enable support for the HDF5 engine" AUTO) adios_option(HDF5 "Enable support for the HDF5 engine" AUTO)
adios_option(ADIOS1 "Enable support for the ADIOS 1.x engine" AUTO) adios_option(ADIOS1 "Enable support for the ADIOS 1.x engine" AUTO)
adios_option(Python "Enable support for Python bindings" AUTO) adios_option(Python "Enable support for Python bindings" AUTO)
adios_option(Fortran "Enable support for Fortran bindings" OFF)
adios_option(SysVShMem "Enable support for SysV Shared Memory IPC on *NIX" AUTO) adios_option(SysVShMem "Enable support for SysV Shared Memory IPC on *NIX" AUTO)
include(${ADIOS2_SOURCE_DIR}/cmake/DetectOptions.cmake) include(${ADIOS2_SOURCE_DIR}/cmake/DetectOptions.cmake)
if(ADIOS2_HAVE_MPI) if(ADIOS2_HAVE_MPI)
# Workaround for OpenMPI forcing the link of C++ bindings # Workaround for MPI forcing the link of C++ bindings
add_definitions(-DOMPI_SKIP_MPICXX) add_definitions(-DOMPI_SKIP_MPICXX -DMPICH_SKIP_MPICXX)
endif() endif()
GenerateADIOSHeaderConfig(MPI ZFP BZip2 ADIOS1 HDF5 ZeroMQ DataMan Python SysVShMem) GenerateADIOSHeaderConfig(MPI ZFP BZip2 ADIOS1 HDF5 DataMan Python Fortran
SysVShMem)
install(FILES ${ADIOS2_BINARY_DIR}/source/adios2/ADIOSConfig.h install(FILES ${ADIOS2_BINARY_DIR}/source/adios2/ADIOSConfig.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/adios2 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/adios2
) )
...@@ -146,7 +141,9 @@ else() ...@@ -146,7 +141,9 @@ else()
set(ADIOS2_BUILD_TESTING_DEFAULT ON) set(ADIOS2_BUILD_TESTING_DEFAULT ON)
endif() endif()
unset(BUILD_TESTING) unset(BUILD_TESTING)
option(ADIOS2_BUILD_TESTING "Build the ADIOS2 testing tree" ${ADIOS2_BUILD_TESTING_DEFAULT}) option(ADIOS2_BUILD_TESTING "Build the ADIOS2 testing tree"
${ADIOS2_BUILD_TESTING_DEFAULT})
include(CTest) include(CTest)
set(BUILD_TESTING ${ADIOS2_BUILD_TESTING}) set(BUILD_TESTING ${ADIOS2_BUILD_TESTING})
if(BUILD_TESTING) if(BUILD_TESTING)
...@@ -165,9 +162,18 @@ GenerateADIOSPackageConfig() ...@@ -165,9 +162,18 @@ GenerateADIOSPackageConfig()
message("") message("")
message("ADIOS2 build configuration:") message("ADIOS2 build configuration:")
message(" ADIOS Version: ${ADIOS2_VERSION}") message(" ADIOS Version: ${ADIOS2_VERSION}")
message(" C++ Compiler : ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} ${CMAKE_CXX_COMPILER_WRAPPER}") message(" C++ Compiler : ${CMAKE_CXX_COMPILER_ID} "
"${CMAKE_CXX_COMPILER_VERSION} "
"${CMAKE_CXX_COMPILER_WRAPPER}")
message(" ${CMAKE_CXX_COMPILER}") message(" ${CMAKE_CXX_COMPILER}")
message("") message("")
if(ADIOS2_HAVE_Fortran)
message(" Fortran Compiler : ${CMAKE_Fortran_COMPILER_ID} "
"${CMAKE_Fortran_COMPILER_VERSION} "
"${CMAKE_Fortran_COMPILER_WRAPPER}")
message(" ${CMAKE_Fortran_COMPILER}")
message("")
endif()
message(" Installation prefix: ${CMAKE_INSTALL_PREFIX}") message(" Installation prefix: ${CMAKE_INSTALL_PREFIX}")
message(" Features:") message(" Features:")
if(BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
...@@ -181,7 +187,8 @@ message(" Library Type: ${msg_lib_type}") ...@@ -181,7 +187,8 @@ message(" Library Type: ${msg_lib_type}")
message(" Build Type: ${CMAKE_BUILD_TYPE}") message(" Build Type: ${CMAKE_BUILD_TYPE}")
message(" Testing: ${BUILD_TESTING}") message(" Testing: ${BUILD_TESTING}")
message(" Build Options:") message(" Build Options:")
foreach(opt BZip2 ZFP MPI DataMan ZeroMQ HDF5 ADIOS1 Python SysVShMem)
foreach(opt BZip2 ZFP MPI DataMan ZeroMQ HDF5 ADIOS1 Python Fortran SysVShMem)
message_pad(" ${opt}" 15 label) message_pad(" ${opt}" 15 label)
if(${ADIOS2_HAVE_${opt}}) if(${ADIOS2_HAVE_${opt}})
message("${label}: ON") message("${label}: ON")
......
[![GitHub (pre-)release](https://img.shields.io/github/release/ornladios/adios2/all.svg)]()
[![GitHub license](http://dmlc.github.io/img/apache2.svg)](./LICENSE)
[![Circle CI](https://circleci.com/gh/ornladios/ADIOS2.svg?style=shield)](https://circleci.com/gh/ornladios/ADIOS2)
[![Travis CI](https://travis-ci.org/ornladios/ADIOS2.svg)](https://travis-ci.org/ornladios/ADIOS2)
[![AppVeyor CI](https://ci.appveyor.com/api/projects/status/0s2a3qp57hgbvlhj?svg=true)](https://ci.appveyor.com/project/ornladios/adios2)
# Adaptable Input / Output System (ADIOS) v2.0 # Adaptable Input / Output System (ADIOS) v2.0
This is v2.0 of the ADIOS I/O system, developed as part of the This is v2.0 of the ADIOS I/O system, developed as part of the
U.S. Department of Energy Exascale Computing Program. U.S. Department of Energy Exascale Computing Program.
...@@ -72,6 +80,7 @@ ADIOS2 build configuration: ...@@ -72,6 +80,7 @@ ADIOS2 build configuration:
HDF5 : ON HDF5 : ON
ADIOS1 : OFF ADIOS1 : OFF
Python : ON Python : ON
C : ON
SysVShMem: ON SysVShMem: ON
-- Configuring done -- Configuring done
...@@ -92,6 +101,7 @@ The following options can be specified with CMake's `-DVAR=VALUE` syntax to cont ...@@ -92,6 +101,7 @@ The following options can be specified with CMake's `-DVAR=VALUE` syntax to cont
| `ADIOS2_USE_HDF5` | **`AUTO`**/``ON``/``OFF`` | Enable the [HDF5](https://www.hdfgroup.org) engine. | | `ADIOS2_USE_HDF5` | **`AUTO`**/``ON``/``OFF`` | Enable the [HDF5](https://www.hdfgroup.org) engine. |
| `ADIOS2_USE_ADIOS1` | **`AUTO`**/``ON``/``OFF`` | Enable the [ADIOS 1.x](https://www.olcf.ornl.gov/center-projects/adios/) engine. | | `ADIOS2_USE_ADIOS1` | **`AUTO`**/``ON``/``OFF`` | Enable the [ADIOS 1.x](https://www.olcf.ornl.gov/center-projects/adios/) engine. |
| `ADIOS2_USE_Python` | **`AUTO`**/``ON``/``OFF`` | Enable the Python >= 2.7 bindings. | | `ADIOS2_USE_Python` | **`AUTO`**/``ON``/``OFF`` | Enable the Python >= 2.7 bindings. |
| `ADIOS2_USE_C` | **`AUTO`**/``ON``/``OFF`` | Enable the C bindings library libadios2_c.so or libadios2_c.a |
Note: The `ADIOS2_USE_HDF5` and `ADIOS2_USE_ADIOS1` options require the use of a matching serial or parallel version depending on whether `ADIOS2_USE_MPI` is enabled. SImilary, enabling MPI and Python bindings requires the presence of `mpi4py`. Note: The `ADIOS2_USE_HDF5` and `ADIOS2_USE_ADIOS1` options require the use of a matching serial or parallel version depending on whether `ADIOS2_USE_MPI` is enabled. SImilary, enabling MPI and Python bindings requires the presence of `mpi4py`.
......
version: 1.0.{build}
skip_branch_with_pr: true
os:
- Visual Studio 2015
- Visual Studio 2017
platform:
- x86
# install:
# ### Having trouble with enabling python on windows
# - set PATH=C:\Python27-x64;C:\Python27-x64\Scripts;%PATH%
# - "python.exe -m pip install numpy"
# init:
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
before_build:
- del /q /f "C:\Program Files (x86)\MSBuild\14.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets"
- cd C:\projects\adios2
- git reset --hard %APPVEYOR_PULL_REQUEST_HEAD_COMMIT%
- ps: |
$env:CUSTOM_BUILD_NAME = ("{0}_{1}_vs{2}" -f $env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH, $env:APPVEYOR_BUILD_NUMBER, $env:APPVEYOR_BUILD_WORKER_IMAGE.split()[2] )
- ctest.exe -VV -S ../adios2/scripts\appveyor\av_default.cmake
-Ddashboard_full=OFF
-Ddashboard_do_update=true
-DCTEST_BUILD_NAME=%CUSTOM_BUILD_NAME%
build_script:
- ctest.exe -VV -S ../adios2/scripts\appveyor\av_default.cmake
-Ddashboard_full=OFF
-Ddashboard_do_configure=true
-DCTEST_BUILD_NAME=%CUSTOM_BUILD_NAME%
- ctest.exe -VV -S ../adios2/scripts\appveyor\av_default.cmake
-Ddashboard_full=OFF
-Ddashboard_do_build=true
-DCTEST_BUILD_NAME=%CUSTOM_BUILD_NAME%
test_script:
- ctest.exe -VV -S ../adios2/scripts\appveyor\av_default.cmake
-Ddashboard_full=OFF
-Ddashboard_do_test=true
-DCTEST_BUILD_NAME=%CUSTOM_BUILD_NAME%
# on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
#------------------------------------------------------------------------------#
# Distributed under the OSI-approved Apache License, Version 2.0. See
# accompanying file Copyright.txt for details.
#------------------------------------------------------------------------------#
target_sources(adios2 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/adios2_c.cpp)
target_include_directories(adios2
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)
install(
FILES adios2_c.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
FILES adios2/adios2_c_enums.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/adios2
)
/*
* Distributed under the OSI-approved Apache License, Version 2.0. See
* accompanying file Copyright.txt for details.
*
* adios2_c_enums.h
*
* Created on: Aug 7, 2017
* Author: William F Godoy godoywf@ornl.gov
*/
#ifndef ADIOS2_BINDINGS_C_ADIOS2_C_ENUMS_H_
#define ADIOS2_BINDINGS_C_ADIOS2_C_ENUMS_H_
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
adios2_debug_mode_on = 0,
adios2_debug_mode_off = 1,
} adios2_debug_mode;
typedef enum {
adios2_constant_dims_true = 0,
adios2_constant_dims_false = 1,
} adios2_constant_dims;
typedef enum {
adios2_type_char = 0,
adios2_type_int = 1,
adios2_type_float = 2,
adios2_type_double = 3,
adios2_type_float_complex = 4,
adios2_type_double_complex = 5,
adios2_type_int8_t = 6,
adios2_type_int16_t = 7,
adios2_type_int32_t = 8,
adios2_type_int64_t = 9,
adios2_type_string,
adios2_type_signed_char,
adios2_type_short,
adios2_type_long_int,
adios2_type_long_long_int,
adios2_type_unsigned_char,
adios2_type_unsigned_short,
adios2_type_unsigned_int,
adios2_type_unsigned_long_int,
adios2_type_unsigned_long_long_int,
adios2_type_uint8_t,
adios2_type_uint16_t,
adios2_type_uint32_t,
adios2_type_uint64_t
} adios2_type;
typedef enum {
adios2_open_mode_undefined,
adios2_open_mode_write,
adios2_open_mode_read,
adios2_open_mode_append,
adios2_open_mode_read_write
} adios2_open_mode;
#ifdef __cplusplus
} // end extern C
#endif
#endif /* ADIOS2_BINDINGS_C_ADIOS2_C_ENUMS_H_ */
/*
* Distributed under the OSI-approved Apache License, Version 2.0. See
* accompanying file Copyright.txt for details.
*
* adios2_c.h : ADIOS2 C bindings definitions
*
* Created on: Mar 13, 2017
* Author: William F Godoy godoywf@ornl.gov
*/
#include "adios2_c.h"
#include <string>
#include <vector>
#include <adios2.h>
#include <adios2/ADIOSMPI.h>
adios2_ADIOS *adios2_init_config(const char *config_file, MPI_Comm mpi_comm,
const adios2_debug_mode debug_mode)
{
const bool debugBool = (debug_mode == adios2_debug_mode_on) ? true : false;
adios2_ADIOS *adios = reinterpret_cast<adios2_ADIOS *>(
new adios2::ADIOS(config_file, mpi_comm, debugBool));
return adios;
}
adios2_ADIOS *adios2_init(MPI_Comm mpi_comm, const adios2_debug_mode debug_mode)
{
return adios2_init_config("", mpi_comm, debug_mode);
}
adios2_ADIOS *adios2_init_config_nompi(const char *config_file,
const adios2_debug_mode debug_mode)
{
return adios2_init_config(config_file, MPI_COMM_SELF, debug_mode);
}
adios2_ADIOS *adios2_init_nompi(const adios2_debug_mode debug_mode)
{
return adios2_init_config("", MPI_COMM_SELF, debug_mode);
}
adios2_IO *adios2_declare_io(adios2_ADIOS *adios, const char *ioName)
{
adios2_IO *io = reinterpret_cast<adios2_IO *>(
&reinterpret_cast<adios2::ADIOS *>(adios)->DeclareIO(ioName));
return io;
}
adios2_Variable *
adios2_define_variable(adios2_IO *io, const char *name, const adios2_type type,
const size_t ndims, const size_t *shape,
const size_t *start, const size_t *count,
const adios2_constant_dims constant_dims)
{
const bool constantSizeBool =
(constant_dims == adios2_constant_dims_true) ? true : false;
std::vector<size_t> shapeV, startV, countV;
if (shape != NULL)
{
shapeV.assign(shape, shape + ndims);
}
if (start != NULL)
{
startV.assign(start, start + ndims);
}
if (count != NULL)
{
countV.assign(count, count + ndims);
}
adios2::IO &ioCpp = *reinterpret_cast<adios2::IO *>(io);
adios2::VariableBase *variable = nullptr;
switch (type)
{
case (adios2_type_string):;
break;
case (adios2_type_char):
variable =
dynamic_cast<adios2::Variable<char> *>(&ioCpp.DefineVariable<char>(
name, shapeV, startV, countV, constantSizeBool));
break;
case (adios2_type_signed_char):
variable = dynamic_cast<adios2::Variable<signed char> *>(
&ioCpp.DefineVariable<char>(name, shapeV, startV, countV,
constantSizeBool));
break;
case (adios2_type_short):
variable = dynamic_cast<adios2::Variable<short> *>(
&ioCpp.DefineVariable<short>(name, shapeV, startV, countV,
constantSizeBool));
break;
case (adios2_type_int):
variable =
dynamic_cast<adios2::Variable<int> *>(&ioCpp.DefineVariable<int>(
name, shapeV, startV, countV, constantSizeBool));
break;
case (adios2_type_long_int):
variable = dynamic_cast<adios2::Variable<long int> *>(
&ioCpp.DefineVariable<long int>(name, shapeV, startV, countV,
constantSizeBool));
break;
case (adios2_type_long_long_int):
variable = dynamic_cast<adios2::Variable<long long int> *>(
&ioCpp.DefineVariable<long long int>(name, shapeV, startV, countV,
constantSizeBool));
break;
case (adios2_type_unsigned_char):
variable = dynamic_cast<adios2::Variable<unsigned char> *>(
&ioCpp.DefineVariable<unsigned char>(name, shapeV, startV, countV,
constantSizeBool));
break;
case (adios2_type_unsigned_short):
variable = dynamic_cast<adios2::Variable<unsigned short> *>(
&ioCpp.DefineVariable<unsigned short>(name, shapeV, startV, countV,
constantSizeBool));
break;
case (adios2_type_unsigned_int):
variable = dynamic_cast<adios2::Variable<unsigned int> *>(
&ioCpp.DefineVariable<unsigned int>(name, shapeV, startV, countV,
constantSizeBool));
break;
case (adios2_type_unsigned_long_int):
variable = dynamic_cast<adios2::Variable<unsigned long int> *>(
&ioCpp.DefineVariable<unsigned long int>(name, shapeV, startV,
countV, constantSizeBool));
break;
case (adios2_type_unsigned_long_long_int):
variable = dynamic_cast<adios2::Variable<unsigned long long int> *>(
&ioCpp.DefineVariable<unsigned long long int>(
name, shapeV, startV, countV, constantSizeBool));
break;
case (adios2_type_float):
variable = dynamic_cast<adios2::Variable<float> *>(
&ioCpp.DefineVariable<float>(name, shapeV, startV, countV,
constantSizeBool));
break;
case (adios2_type_double):
variable = dynamic_cast<adios2::Variable<double> *>(
&ioCpp.DefineVariable<double>(name, shapeV, startV, countV,
constantSizeBool));
break;
case (adios2_type_float_complex):
variable = dynamic_cast<adios2::Variable<std::complex<float>> *>(
&ioCpp.DefineVariable<std::complex<float>>(
name, shapeV, startV, countV, constantSizeBool));
break;
case (adios2_type_double_complex):
variable = dynamic_cast<adios2::Variable<std::complex<double>> *>(
&ioCpp.DefineVariable<std::complex<double>>(
name, shapeV, startV, countV, constantSizeBool));
break;
case (adios2_type_int8_t):
variable = dynamic_cast<adios2::Variable<int8_t> *>(
&ioCpp.DefineVariable<int8_t>(name, shapeV, startV, countV,
constantSizeBool));
break;
case (adios2_type_int16_t):
variable = dynamic_cast<adios2::Variable<int16_t> *>(
&ioCpp.DefineVariable<int16_t>(name, shapeV, startV, countV,
constantSizeBool));
break;
case (adios2_type_int32_t):
variable = dynamic_cast<adios2::Variable<int32_t> *>(
&ioCpp.DefineVariable<int32_t>(name, shapeV, startV, countV,
constantSizeBool));
break;
case (adios2_type_int64_t):
variable = dynamic_cast<adios2::Variable<int64_t> *>(
&ioCpp.DefineVariable<int64_t>(name, shapeV, startV, countV,
constantSizeBool));
break;
case (adios2_type_uint8_t):
variable = dynamic_cast<adios2::Variable<uint8_t> *>(
&ioCpp.DefineVariable<uint8_t>(name, shapeV, startV, countV,
constantSizeBool));
break;
case (adios2_type_uint16_t):
variable = dynamic_cast<adios2::Variable<uint16_t> *>(
&ioCpp.DefineVariable<uint16_t>(name, shapeV, startV, countV,
constantSizeBool));
break;
case (adios2_type_uint32_t):
variable = dynamic_cast<adios2::Variable<uint32_t> *>(
&ioCpp.DefineVariable<uint32_t>(name, shapeV, startV, countV,
constantSizeBool));
break;
case (adios2_type_uint64_t):
variable = dynamic_cast<adios2::Variable<uint64_t> *>(
&ioCpp.DefineVariable<uint64_t>(name, shapeV, startV, countV,
constantSizeBool));
break;
}
return reinterpret_cast<adios2_Variable *>(variable);
}
adios2_Variable *adios2_get_variable(adios2_IO *io, const char *name)
{
adios2::VariableBase *variable =
reinterpret_cast<adios2::IO *>(io)->GetVariableBase(name);
return reinterpret_cast<adios2_Variable *>(variable);
}
void adios2_set_engine(adios2_IO *io, const char *engine_type)
{
reinterpret_cast<adios2::IO *>(io)->SetEngine(engine_type);
}
void adios2_set_param(adios2_IO *io, const char *key, const char *value)
{
reinterpret_cast<adios2::IO *>(io)->SetSingleParameter(key, value);
}
unsigned int adios2_add_transport(adios2_IO *io, const char *transport_type)
{
return reinterpret_cast<adios2::IO *>(io)->AddTransport(transport_type);
}
void adios2_set_transport_param(adios2_IO *io,
const unsigned int transport_index,
const char *key, const char *value)
{
reinterpret_cast<adios2::IO *>(io)->SetTransportSingleParameter(
transport_index, key, value);
}
struct adios2_Engine
{
std::shared_ptr<adios2::Engine> EngineCpp;
};
adios2_Engine *adios2_open(adios2_IO *io, const char *name,
const adios2_open_mode open_mode)
{
auto &ioCpp = *reinterpret_cast<adios2::IO *>(io);
return adios2_open_new_comm(io, name, open_mode, ioCpp.m_MPIComm);
}
adios2_Engine *adios2_open_new_comm(adios2_IO *io, const char *name,
const adios2_open_mode open_mode,
MPI_Comm mpi_comm)
{
auto &ioCpp = *reinterpret_cast<adios2::IO *>(io);
adios2_Engine *engine = new adios2_Engine;
switch (open_mode)
{
case adios2_open_mode_write:
engine->EngineCpp = ioCpp.Open(name, adios2::OpenMode::Write, mpi_comm);
break;
case adios2_open_mode_read:
engine->EngineCpp = ioCpp.Open(name, adios2::OpenMode::Read, mpi_comm);
break;
case adios2_open_mode_append:
engine->EngineCpp =
ioCpp.Open(name, adios2::OpenMode::Append, mpi_comm);
break;
case adios2_open_mode_read_write:
engine->EngineCpp =
ioCpp.Open(name, adios2::OpenMode::ReadWrite, mpi_comm);
break;
case adios2_open_mode_undefined:
break;
}
return engine;
}
void adios2_write(adios2_Engine *engine, adios2_Variable *variable,
const void *values)
{
auto &variableBase = *reinterpret_cast<adios2::VariableBase *>(variable);
adios2_write_by_name(engine, variableBase.m_Name.c_str(), values);
}
void adios2_write_by_name(adios2_Engine *engine, const char *variable_name,
const void *values)
{
engine->EngineCpp->Write(variable_name, values);
}
void adios2_advance(adios2_Engine *engine) { engine->EngineCpp->Advance(); }
void adios2_close(adios2_Engine *engine)
{
engine->EngineCpp->Close();
delete engine;
}
void adios2_close_by_index(adios2_Engine *engine,
const unsigned int transport_index)
{
engine->EngineCpp->Close(transport_index);
}
void adios2_finalize(adios2_ADIOS *adios)
{
delete reinterpret_cast<adios2::ADIOS *>(adios);
}
/*
* Distributed under the OSI-approved Apache License, Version 2.0. See
* accompanying file Copyright.txt for details.
*
* adios2_c.h : ADIOS2 C bindings declarations
*
* Created on: Mar 13, 2017
* Author: William F Godoy godoywf@ornl.gov
*/
#ifndef ADIOS2_BINDINGS_C_ADIOS2_C_H_
#define ADIOS2_BINDINGS_C_ADIOS2_C_H_
#include <stddef.h> //size_t
#include "adios2/ADIOSConfig.h"
#include "adios2/ADIOSMPICommOnly.h"
#include "adios2/adios2_c_enums.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct adios2_ADIOS adios2_ADIOS;
typedef struct adios2_IO adios2_IO;
typedef struct adios2_Variable adios2_Variable;
typedef struct adios2_Engine adios2_Engine;
/**
* Create an ADIOS struct pointer handler using a runtime config file in MPI
* application.
* @param config_file runtime configuration file, XML format, future: JSON
* @param mpi_comm MPI communicator from application for ADIOS scope
* @param debug_mode adios2_debug_mode_on or adios2_debug_mode_off
* @return valid ADIOS* handler
*/
adios2_ADIOS *adios2_init_config(const char *config_file, MPI_Comm mpi_comm,
const adios2_debug_mode debug_mode);
/**
* Create an ADIOS struct pointer in MPI application.
* @param mpi_comm MPI communicator from application for ADIOS scope
* @param debug_mode adios2_debug_mode_on or adios2_debug_mode_off
* @return valid ADIOS* handler
*/
adios2_ADIOS *adios2_init(MPI_Comm mpi_comm,
const adios2_debug_mode debug_mode);
/**
* Create an ADIOS struct pointer handler using a runtime config file in serial
* nonMPI
* application.
* @param config_file runtime configuration file, XML format, future: JSON
* @param debug_mode adios2_debug_mode_on or adios2_debug_mode_off
* @return valid ADIOS* handler
*/
adios2_ADIOS *adios2_init_config_nompi(const char *config_file,
const adios2_debug_mode debug_mode);
/**
* Create an ADIOS struct pointer handler in serial nonMPI application.
* @param debug_mode adios2_debug_mode_on or adios2_debug_mode_off
* @return valid ADIOS* handler
*/
adios2_ADIOS *adios2_init_nompi(const adios2_debug_mode debug_mode);
/**
* Create an IO struct pointer handler from ADIOS* handler
* @param adios ADIOS* handler that owns the IO* handler
* @param io_name unique name for the newly declared io handler
* @return valid IO* handler
*/
adios2_IO *adios2_declare_io(adios2_ADIOS *adios, const char *io_name);
/**
* Sets engine type for current io handler
* @param io handler
* @param engine_type available engine type
*/
void adios2_set_engine(adios2_IO *io, const char *engine_type);
/**
* Set a single engine parameter
* @param io handler
* @param key parameter key
* @param value parameter value
*/
void adios2_set_param(adios2_IO *io, const char *key, const char *value);
/**
* Set a transport for the present io
* @param io handler
* @param transport_type "File", "WAN"
* @return transport_index handler used for setting transport parameters or at
* Close
*/
unsigned int adios2_add_transport(adios2_IO *io, const char *transport_type);
/**
* Sets a single transport parameter using io and transport_index (from
* adios2_add_transport) handlers
* @param io handler
* @param transport_index handler from adios2_add_transport
* @param key parameter key
* @param value parameter value
*/
void adios2_set_transport_param(adios2_IO *io,
const unsigned int transport_index,
const char *key, const char *value);
/**
*
* @param io handler that owns the variable
* @param name unique variable name inside IO handler
* @param type primitive type
* @param ndims number of dimensions
* @param shape total MPI dimensions
* @param start local MPI start (offset)
* @param count local MPI count
* @param constant_size adios2_constant_dims_true: shape, start and count are
* constant, or
* adios2_constant_size_false
* @return variable handler
*/
adios2_Variable *
adios2_define_variable(adios2_IO *io, const char *name, const adios2_type type,
const size_t ndims, const size_t *shape,
const size_t *start, const size_t *count,
const adios2_constant_dims constant_dims);
/**
* Returns a handler to a previously defined variable identified by a unique
* name
* @param io handler to variable io owner
* @param name unique name input
* @return variable handler if found
*/
adios2_Variable *adios2_get_variable(adios2_IO *io, const char *name);
/**
* Create an adios2_Engine, from adios2_IO, that executes all IO operations.
* Resuse MPI_Comm passed to adios2_ADIOS that created adios2_IO io
* @param io input that creates the adios2_Engine
* @param name engine name
* @param open_mode read, write, append use adios2_open_mode enum
* @return engine handler
*/
adios2_Engine *adios2_open(adios2_IO *io, const char *name,
const adios2_open_mode open_mode);
/**
* Create an adios2_Engine, from adios2_IO, that executes all IO operations.
* Allows passing a new communicator.
* @param io input that creates the adios2_Engine
* @param name engine name
* @param open_mode read, write, append use adios2_open_mode enum
* @param mpi_comm allows passing a new MPI communicator
* @return engine handler
*/
adios2_Engine *adios2_open_new_comm(adios2_IO *io, const char *name,
const adios2_open_mode open_mode,
MPI_Comm mpi_comm);
/**
* Write a variable using a adios2_Variable handler
* @param engine handler for engine executing the write
* @param variable handler for variable from adios2_define_variable
* @param values application data to be written for this variable
*/
void adios2_write(adios2_Engine *engine, adios2_Variable *variable,
const void *values);
/**
* Write a variable using a variable name created from adios2_define_variable
* @param engine handler for engine executing the write
* @param variable_name unique variable name, within io that create the engine.
* @param values application data to be written for this variable
*/
void adios2_write_by_name(adios2_Engine *engine, const char *variable_name,
const void *values);
/**
* Advance time step for writes
* @param engine handler executing IO tasks
*/
void adios2_advance(adios2_Engine *engine);
/**
* Close all transports in adios2_Engine
* @param engine handler containing all transports to
* be closed. engine Becomes NULL after this function is called.
*/
void adios2_close(adios2_Engine *engine);
/**
* Close a particular transport from the index returned by adios2_add_transport
* @param engine handler containing all transports to
* be closed. NOTE: engine NEVER becomes NULL due to this function.
* @param transport_index handler from adios2_add_transport
*/
void adios2_close_by_index(adios2_Engine *engine,
const unsigned int transport_index);
/**
* Final point for adios2_ADIOS handler.
* Deallocate adios pointer. Required to avoid memory leaks.
* @param adios input to be deallocated
*/
void adios2_finalize(adios2_ADIOS *adios);
#ifdef __cplusplus
} // end extern C
#endif
#endif /* ADIOS2_BINDINGS_C_ADIOS2_C_H_ */
#------------------------------------------------------------------------------#
# Distributed under the OSI-approved Apache License, Version 2.0. See
# accompanying file Copyright.txt for details.
#------------------------------------------------------------------------------#
if(ADIOS2_HAVE_Python) if(ADIOS2_HAVE_Python)
add_subdirectory(python) add_subdirectory(python)
endif() endif()
if(ADIOS2_HAVE_Fortran)
add_subdirectory(fortran)
endif()
add_subdirectory(C)
#------------------------------------------------------------------------------#
# Distributed under the OSI-approved Apache License, Version 2.0. See
# accompanying file Copyright.txt for details.
#------------------------------------------------------------------------------#
add_library(adios2_f adios2_mod.f90 adios2_params_mod.f90 adios2_adios_mod.f90
adios2_io_mod.f90 adios2_engine_mod.f90
adios2_engine_write_mod.f90 adios2_functions_mod.f90
adios2_f2c.cpp)
if(ADIOS2_HAVE_MPI)
target_sources(adios2_f PRIVATE mpi/adios2_adios_init_mod.f90
mpi/adios2_io_open_mod.f90)
else()
target_sources(adios2_f PRIVATE nompi/adios2_adios_init_nompi_mod.f90
nompi/adios2_io_open_nompi_mod.f90 )
endif()
target_link_libraries(adios2_f PRIVATE adios2)
if(ADIOS2_HAVE_MPI)
target_compile_definitions(adios2_f PUBLIC ADIOS2_HAVE_MPI_F)
target_include_directories(adios2_f PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
${MPI_C_INCLUDE_PATH}
${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(adios2_f PRIVATE ${MPI_C_LIBRARIES}
${MPI_Fortran_LIBRARIES})
else()
target_include_directories(adios2_f PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR})
endif()
install(
TARGETS ${adios2_f} EXPORT adios2
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
module adios2_adios
use adios2_adios_init
implicit none
contains
subroutine adios2_declare_io(io, adios, io_name, ierr)
integer(kind=8), intent(out) :: io
integer(kind=8), intent(in) :: adios
character*(*), intent(in) :: io_name
integer, intent(out) :: ierr
call adios2_declare_io_f2c(io, adios, TRIM(ADJUSTL(io_name))//char(0), &
& ierr)
end
subroutine adios2_finalize(adios, ierr)
integer(kind=8), intent(in) :: adios
integer, intent(out) :: ierr
call adios2_finalize_f2c(adios, ierr)
end
end module
!
! Distributed under the OSI-approved Apache License, Version 2.0. See
! accompanying file Copyright.txt for details.
!
! adios2_engine_mod.f90 : ADIOS2 Fortran bindings for Engine class
!
! Created on: Aug 22, 2017
! Author: William F Godoy godoywf@ornl.gov
!
module adios2_engine
use adios2_engine_write
implicit none
contains
subroutine adios2_advance(engine, ierr)
integer(kind=8), intent(in) :: engine
integer, intent(out) :: ierr
call adios2_advance_f2c(engine, ierr)
end subroutine
subroutine adios2_close(engine, ierr)
integer(kind=8), intent(in) :: engine
integer, intent(out) :: ierr
call adios2_close_f2c(engine, ierr)
end subroutine
end module
This diff is collapsed.
/*
* Distributed under the OSI-approved Apache License, Version 2.0. See
* accompanying file Copyright.txt for details.
*
* adios2_f.cpp : C-header glue code implmentation for functions called from
* Fortran modules
*
* Created on: Aug 14, 2017
* Author: William F Godoy
*/
#include "adios2_f2c.h"
#include <stdexcept>
#include <type_traits> //std::static_assert
#include <vector>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef ADIOS2_HAVE_MPI_F
void adios2_init_f2c_(adios2_ADIOS **adios, MPI_Fint *comm,
const int *debug_mode, int *ierr)
{
adios2_init_config_f2c_(adios, "", comm, debug_mode, ierr);
}
void adios2_init_config_f2c_(adios2_ADIOS **adios, const char *config_file,
MPI_Fint *comm, const int *debug_mode, int *ierr)
{
*ierr = 0;
try
{
*adios =
adios2_init_config(config_file, MPI_Comm_f2c(*comm),
static_cast<adios2_debug_mode>(*debug_mode));
}
catch (std::exception &e)
{
*ierr = 1;
}
}
#else
void adios2_init_f2c_(adios2_ADIOS **adios, const int *debug_mode, int *ierr)
{
adios2_init_config_f2c_(adios, "", debug_mode, ierr);
}
void adios2_init_config_f2c_(adios2_ADIOS **adios, const char *config_file,
const int *debug_mode, int *ierr)
{
*ierr = 0;
try
{
*adios = adios2_init_config_nompi(
config_file, static_cast<adios2_debug_mode>(*debug_mode));
}
catch (std::exception &e)
{
*ierr = 1;
}
}
#endif
void adios2_declare_io_f2c_(adios2_IO **io, adios2_ADIOS **adios,
const char *io_name, int *ierr)
{
*ierr = 0;
try
{
*io = adios2_declare_io(*adios, io_name);
}
catch (std::exception &e)
{
*ierr = 1;
}
}
void adios2_set_param_f2c_(adios2_IO **io, const char *key, const char *value,
int *ierr)
{
*ierr = 0;
try
{
adios2_set_param(*io, key, value);
}
catch (std::exception &e)
{
*ierr = 1;
}
}
void adios2_add_transport_f2c_(int *transport_index, adios2_IO **io,
const char *transport_type, int *ierr)
{
*ierr = 0;
*transport_index = -1;
try
{
*transport_index =
static_cast<int>(adios2_add_transport(*io, transport_type));
}
catch (std::exception &e)
{
*ierr = 1;
}
if (*transport_index == -1)
{
*ierr = 1;
}
}
void adios2_set_transport_param_f2c_(adios2_IO **io, const int *transport_index,
const char *key, const char *value,
int *ierr)
{
*ierr = 0;
try
{
adios2_set_transport_param(
*io, static_cast<unsigned int>(*transport_index), key, value);
}
catch (std::exception &e)
{
*ierr = 1;
}
}
void adios2_define_variable_f2c_(adios2_Variable **variable, adios2_IO **io,
const char *variable_name, const int *type,
const int *ndims, const int *shape,
const int *start, const int *count,
const int *constant_dims, int *ierr)
{
auto lf_IntToSizeT = [](const int *ndims,
const int *dims) -> std::vector<std::size_t> {
std::vector<std::size_t> vecSizeT(*ndims);
for (unsigned int dim = 0; dim < *ndims; ++dim)
{
vecSizeT[dim] = dims[dim];
}
return vecSizeT;
};
*ierr = 0;
std::vector<std::size_t> shapeV, startV, countV;
if (shape != NULL)
{
shapeV = lf_IntToSizeT(ndims, shape);
}
if (start != NULL)
{
startV = lf_IntToSizeT(ndims, start);
}
if (count != NULL)
{
countV = lf_IntToSizeT(ndims, count);
}
try
{
*variable = adios2_define_variable(
*io, variable_name, static_cast<adios2_type>(*type), *ndims,
shapeV.data(), startV.data(), countV.data(),
static_cast<adios2_constant_dims>(*constant_dims));
}
catch (std::exception &e)
{
*ierr = 1;
}
}
void adios2_open_f2c_(adios2_Engine **engine, adios2_IO **io, const char *name,
const int *open_mode, int *ierr)
{
*ierr = 0;
try
{
*engine =
adios2_open(*io, name, static_cast<adios2_open_mode>(*open_mode));
}
catch (std::exception &e)
{
*ierr = 1;
}
}
#ifdef ADIOS2_HAVE_MPI_F
void adios2_open_new_comm_f2c_(adios2_Engine **engine, adios2_IO **io,
const char *name, const int *open_mode,
MPI_Fint *comm, int *ierr)
{
*ierr = 0;
try
{
*engine = adios2_open_new_comm(
*io, name, static_cast<adios2_open_mode>(*open_mode),
MPI_Comm_f2c(*comm));
}
catch (std::exception &e)
{
*ierr = 1;
}
}
#endif
void adios2_write_f2c_(adios2_Engine **engine, adios2_Variable **variable,
const void *values, int *ierr)
{
*ierr = 0;
try
{
adios2_write(*engine, *variable, values);
}
catch (std::exception &e)
{
*ierr = 1;
}
}
void adios2_advance_f2c_(adios2_Engine **engine, int *ierr)
{
*ierr = 0;
try
{
adios2_advance(*engine);
}
catch (std::exception &e)
{
*ierr = 1;
}
}
void adios2_close_f2c_(adios2_Engine **engine, int *ierr)
{
*ierr = 0;
try
{
adios2_close(*engine);
}
catch (std::exception &e)
{
*ierr = 1;
}
}
void adios2_finalize_f2c_(adios2_ADIOS **adios, int *ierr)
{
*ierr = 0;
try
{
adios2_finalize(*adios);
}
catch (std::exception &e)
{
*ierr = 1;
}
}
#ifdef __cplusplus
}
#endif
/*
* Distributed under the OSI-approved Apache License, Version 2.0. See
* accompanying file Copyright.txt for details.
*
* adios2_f.h : C-header glue code for functions called from Fortran modules
*
* Created on: Aug 15, 2017
* Author: William F Godoy godoywf@ornl.gov
*/
#ifndef BINDINGS_FORTRAN_ADIOS2_F2C_H_
#define BINDINGS_FORTRAN_ADIOS2_F2C_H_
#include <stddef.h>
#ifdef ADIOS2_HAVE_MPI_F
#include <mpi.h>
#endif
#include <adios2_c.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef ADIOS2_HAVE_MPI_F
void adios2_init_f2c_(adios2_ADIOS **adios, MPI_Fint *comm,
const int *debug_mode, int *ierr);
void adios2_init_config_f2c_(adios2_ADIOS **adios, const char *config_file,
MPI_Fint *comm, const int *debug_mode, int *ierr);
#else
void adios2_init_f2c_(adios2_ADIOS **adios, const int *debug_mode, int *ierr);
void adios2_init_config_f2c_(adios2_ADIOS **adios, const char *config_file,
const int *debug_mode, int *ierr);
#endif
void adios2_declare_io_f2c_(adios2_IO **io, adios2_ADIOS **adios,
const char *io_name, int *ierr);
void adios2_set_param_f2c_(adios2_IO **io, const char *key, const char *value,
int *ierr);
void adios2_add_transport_f2c_(int *transport_index, adios2_IO **io,
const char *transport_type, int *ierr);
void adios2_set_transport_param_f2c_(adios2_IO **io, const int *transport_index,
const char *key, const char *value,
int *ierr);
void adios2_define_variable_f2c_(adios2_Variable **variable, adios2_IO **io,
const char *variable_name, const int *type,
const int *ndims, const int *shape,
const int *start, const int *count,
const int *constant_dims, int *ierr);
void adios2_open_f2c_(adios2_Engine **engine, adios2_IO **io, const char *name,
const int *open_mode, int *ierr);
#ifdef ADIOS2_HAVE_MPI_F
void adios2_open_new_comm_f2c_(adios2_Engine **engine, adios2_IO **io,
const char *name, const int *open_mode,
MPI_Fint *comm, int *ierr);
#endif
void adios2_write_f2c_(adios2_Engine **engine, adios2_Variable **variable,
const void *values, int *ierr);
void adios2_advance_f2c_(adios2_Engine **engine, int *ierr);
void adios2_close_f2c_(adios2_Engine **engine, int *ierr);
void adios2_finalize_f2c_(adios2_ADIOS **adios, int *ierr);
#ifdef __cplusplus
}
#endif
#endif /* BINDINGS_FORTRAN_ADIOS2_F2C_H_ */
module adios2_functions
implicit none
contains
integer function adios2_LogicalToInt( logical_value )
logical, value, intent(in) :: logical_value
adios2_LogicalToInt = 0
if( logical_value ) then
adios2_LogicalToInt = 1
end if
end function
end module
!
! Distributed under the OSI-approved Apache License, Version 2.0. See
! accompanying file Copyright.txt for details.
!
! adios2_io.f90 : ADIOS2 Fortran bindings for IO class
!
! Created on: Mar 13, 2017
! Author: William F Godoy godoywf@ornl.gov
!
module adios2_io
use adios2_io_open
use adios2_functions
implicit none
contains
subroutine adios2_set_param(io, key, value, ierr)
integer(kind=8), intent(in) :: io
character*(*), intent(in) :: key
character*(*), intent(in) :: value
integer, intent(out) :: ierr
call adios2_set_param_f2c( io, TRIM(ADJUSTL(key))//char(0), &
& TRIM(ADJUSTL(value))//char(0) )
end subroutine
subroutine adios2_add_transport(transport_index, io, transport_type, ierr)
integer, intent(out):: transport_index
integer(kind=8), intent(in) :: io
character*(*), intent(in) :: transport_type
integer, intent(out) :: ierr
call adios2_add_transport_f2c( transport_index, io, &
& TRIM(ADJUSTL(transport_type))//char(0), ierr)
end subroutine
subroutine adios2_set_transport_param(io, transport_index, key, value, ierr)
integer(kind=8), intent(in):: io
integer, intent(in):: transport_index
character*(*), intent(in) :: key
character*(*), intent(in) :: value
integer, intent(out):: ierr
call adios2_set_transport_param_f2c(io, transport_index, &
& TRIM(ADJUSTL(key))//char(0), TRIM(ADJUSTL(value))//char(0), &
& ierr)
end subroutine
subroutine adios2_define_variable(variable, io, variable_name, &
& adios2_type, ndims, shape_dims, start_dims, count_dims, &
& adios2_constant_dims, ierr)
integer(kind=8), intent(out) :: variable
integer(kind=8), intent(in) :: io
character*(*), intent(in) :: variable_name
integer, intent(in) :: adios2_type
integer, intent(in) :: ndims
integer, dimension(:), intent(in) :: shape_dims
integer, dimension(:), intent(in) :: start_dims
integer, dimension(:), intent(in) :: count_dims
logical, intent(in) :: adios2_constant_dims
integer, intent(out) :: ierr
!local
integer constant_dims
constant_dims = adios2_LogicalToInt(adios2_constant_dims)
call adios2_define_variable_f2c(variable, io, &
& TRIM(ADJUSTL(variable_name))//char(0), adios2_type, ndims, &
& shape_dims, start_dims, count_dims, constant_dims, ierr)
end subroutine
end module
!
! Distributed under the OSI-approved Apache License, Version 2.0. See
! accompanying file Copyright.txt for details.
!
! adios2_mod.f90 : ADIOS2 Fortran bindings central module
!
! Created on: Mar 13, 2017
! Author: William F Godoy godoywf@ornl.gov
!
module adios2
use adios2_params
use adios2_adios
use adios2_io
! use adios2_variable
use adios2_engine
end module
!
! Distributed under the OSI-approved Apache License, Version 2.0. See
! accompanying file Copyright.txt for details.
!
! adios2_mod.f90 : ADIOS2 Fortran bindings central module
!
! Created on: Mar 13, 2017
! Author: William F Godoy godoywf@ornl.gov
!
module adios2_params
implicit none
! Debug mode
logical, parameter :: adios2_debug_mode_on = .true.
logical, parameter :: adios2_debug_mode_off = .false.
! Type
integer, parameter :: adios2_type_character = 0
integer, parameter :: adios2_type_integer = 1
integer, parameter :: adios2_type_real = 2
integer, parameter :: adios2_type_dp = 3
integer, parameter :: adios2_type_complex = 4
integer, parameter :: adios2_type_complex_dp = 5
integer, parameter :: adios2_type_integer1 = 6
integer, parameter :: adios2_type_integer2 = 7
integer, parameter :: adios2_type_integer4 = 8
integer, parameter :: adios2_type_integer8 = 9
! Constant dims
logical, parameter :: adios2_constant_dims_true = .true.
logical, parameter :: adios2_constant_dims_false = .false.
! Open Mode
integer, parameter :: adios2_open_mode_undefined = 0
integer, parameter :: adios2_open_mode_write = 1
integer, parameter :: adios2_open_mode_read = 2
integer, parameter :: adios2_open_mode_append = 3
integer, parameter :: adios2_open_mode_read_write = 4
end module
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment