Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ecc4618bd4 | |||
| 8bdebd0c55 | |||
| 5baed631b7 | |||
| 65109b73a9 | |||
| 792e86e01e | |||
| 11ab169164 | |||
| 7c899f99ce | |||
| 12ef028ed2 | |||
| 094117a631 | |||
| acc8b75ad9 | |||
| 078a51d60d | |||
| 06a941eb2c | |||
| 269c5efbde | |||
| e7a60fbe9f | |||
| 2ed8ad093c | |||
| 3a9e0e4153 | |||
| aa1f4eacc8 | |||
| c33ef6d390 | |||
| 9a32a0b7f1 | |||
| 22d6893770 | |||
| 6e0f0eeedd | |||
| 542daf7fc2 | |||
| f79c808e8d | |||
| b6e482f56a | |||
| 6d3014bad5 | |||
| 20424235e8 | |||
| 7d73439b10 |
@@ -9,6 +9,7 @@
|
||||
.deps
|
||||
.dirstamp
|
||||
.libs
|
||||
CMakeFiles
|
||||
INSTALL
|
||||
Makefile
|
||||
Makefile.in
|
||||
|
||||
+3
-1
@@ -1,5 +1,7 @@
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
EXTRA_DIST = autogen.sh
|
||||
EXTRA_DIST = \
|
||||
autogen.sh \
|
||||
ax_pkg_swig.m4
|
||||
|
||||
SUBDIRS = \
|
||||
src \
|
||||
|
||||
@@ -0,0 +1,982 @@
|
||||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Check for baseline language coverage in the compiler for the specified
|
||||
# version of the C++ standard. If necessary, add switches to CXX and
|
||||
# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard)
|
||||
# or '14' (for the C++14 standard).
|
||||
#
|
||||
# The second argument, if specified, indicates whether you insist on an
|
||||
# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
|
||||
# -std=c++11). If neither is specified, you get whatever works, with
|
||||
# preference for an extended mode.
|
||||
#
|
||||
# The third argument, if specified 'mandatory' or if left unspecified,
|
||||
# indicates that baseline support for the specified C++ standard is
|
||||
# required and that the macro should error out if no mode with that
|
||||
# support is found. If specified 'optional', then configuration proceeds
|
||||
# regardless, after defining HAVE_CXX${VERSION} if and only if a
|
||||
# supporting mode is found.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
|
||||
# Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
|
||||
# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
|
||||
# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
|
||||
# Copyright (c) 2015 Paul Norman <penorman@mac.com>
|
||||
# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
|
||||
# Copyright (c) 2016 Krzesimir Nowak <qdlacz@gmail.com>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 7
|
||||
|
||||
dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
|
||||
dnl (serial version number 13).
|
||||
|
||||
AX_REQUIRE_DEFINED([AC_MSG_WARN])
|
||||
AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
|
||||
m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"],
|
||||
[$1], [14], [ax_cxx_compile_alternatives="14 1y"],
|
||||
[$1], [17], [ax_cxx_compile_alternatives="17 1z"],
|
||||
[m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl
|
||||
m4_if([$2], [], [],
|
||||
[$2], [ext], [],
|
||||
[$2], [noext], [],
|
||||
[m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl
|
||||
m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true],
|
||||
[$3], [mandatory], [ax_cxx_compile_cxx$1_required=true],
|
||||
[$3], [optional], [ax_cxx_compile_cxx$1_required=false],
|
||||
[m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])])
|
||||
AC_LANG_PUSH([C++])dnl
|
||||
ac_success=no
|
||||
AC_CACHE_CHECK(whether $CXX supports C++$1 features by default,
|
||||
ax_cv_cxx_compile_cxx$1,
|
||||
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
|
||||
[ax_cv_cxx_compile_cxx$1=yes],
|
||||
[ax_cv_cxx_compile_cxx$1=no])])
|
||||
if test x$ax_cv_cxx_compile_cxx$1 = xyes; then
|
||||
ac_success=yes
|
||||
fi
|
||||
|
||||
m4_if([$2], [noext], [], [dnl
|
||||
if test x$ac_success = xno; then
|
||||
for alternative in ${ax_cxx_compile_alternatives}; do
|
||||
switch="-std=gnu++${alternative}"
|
||||
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
|
||||
AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
|
||||
$cachevar,
|
||||
[ac_save_CXX="$CXX"
|
||||
CXX="$CXX $switch"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
|
||||
[eval $cachevar=yes],
|
||||
[eval $cachevar=no])
|
||||
CXX="$ac_save_CXX"])
|
||||
if eval test x\$$cachevar = xyes; then
|
||||
CXX="$CXX $switch"
|
||||
if test -n "$CXXCPP" ; then
|
||||
CXXCPP="$CXXCPP $switch"
|
||||
fi
|
||||
ac_success=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi])
|
||||
|
||||
m4_if([$2], [ext], [], [dnl
|
||||
if test x$ac_success = xno; then
|
||||
dnl HP's aCC needs +std=c++11 according to:
|
||||
dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf
|
||||
dnl Cray's crayCC needs "-h std=c++11"
|
||||
for alternative in ${ax_cxx_compile_alternatives}; do
|
||||
for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do
|
||||
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
|
||||
AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
|
||||
$cachevar,
|
||||
[ac_save_CXX="$CXX"
|
||||
CXX="$CXX $switch"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
|
||||
[eval $cachevar=yes],
|
||||
[eval $cachevar=no])
|
||||
CXX="$ac_save_CXX"])
|
||||
if eval test x\$$cachevar = xyes; then
|
||||
CXX="$CXX $switch"
|
||||
if test -n "$CXXCPP" ; then
|
||||
CXXCPP="$CXXCPP $switch"
|
||||
fi
|
||||
ac_success=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test x$ac_success = xyes; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi])
|
||||
AC_LANG_POP([C++])
|
||||
if test x$ax_cxx_compile_cxx$1_required = xtrue; then
|
||||
if test x$ac_success = xno; then
|
||||
AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.])
|
||||
fi
|
||||
fi
|
||||
if test x$ac_success = xno; then
|
||||
HAVE_CXX$1=0
|
||||
AC_MSG_NOTICE([No compiler with C++$1 support was found])
|
||||
else
|
||||
HAVE_CXX$1=1
|
||||
AC_DEFINE(HAVE_CXX$1,1,
|
||||
[define if the compiler supports basic C++$1 syntax])
|
||||
fi
|
||||
AC_SUBST(HAVE_CXX$1)
|
||||
m4_if([$1], [17], [AC_MSG_WARN([C++17 is not yet standardized, so the checks may change in incompatible ways anytime])])
|
||||
])
|
||||
|
||||
|
||||
dnl Test body for checking C++11 support
|
||||
|
||||
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11],
|
||||
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
|
||||
)
|
||||
|
||||
|
||||
dnl Test body for checking C++14 support
|
||||
|
||||
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14],
|
||||
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
|
||||
_AX_CXX_COMPILE_STDCXX_testbody_new_in_14
|
||||
)
|
||||
|
||||
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17],
|
||||
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
|
||||
_AX_CXX_COMPILE_STDCXX_testbody_new_in_14
|
||||
_AX_CXX_COMPILE_STDCXX_testbody_new_in_17
|
||||
)
|
||||
|
||||
dnl Tests for new features in C++11
|
||||
|
||||
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[
|
||||
|
||||
// If the compiler admits that it is not ready for C++11, why torture it?
|
||||
// Hopefully, this will speed up the test.
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
#error "This is not a C++ compiler"
|
||||
|
||||
#elif __cplusplus < 201103L
|
||||
|
||||
#error "This is not a C++11 compiler"
|
||||
|
||||
#else
|
||||
|
||||
namespace cxx11
|
||||
{
|
||||
|
||||
namespace test_static_assert
|
||||
{
|
||||
|
||||
template <typename T>
|
||||
struct check
|
||||
{
|
||||
static_assert(sizeof(int) <= sizeof(T), "not big enough");
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace test_final_override
|
||||
{
|
||||
|
||||
struct Base
|
||||
{
|
||||
virtual void f() {}
|
||||
};
|
||||
|
||||
struct Derived : public Base
|
||||
{
|
||||
virtual void f() override {}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace test_double_right_angle_brackets
|
||||
{
|
||||
|
||||
template < typename T >
|
||||
struct check {};
|
||||
|
||||
typedef check<void> single_type;
|
||||
typedef check<check<void>> double_type;
|
||||
typedef check<check<check<void>>> triple_type;
|
||||
typedef check<check<check<check<void>>>> quadruple_type;
|
||||
|
||||
}
|
||||
|
||||
namespace test_decltype
|
||||
{
|
||||
|
||||
int
|
||||
f()
|
||||
{
|
||||
int a = 1;
|
||||
decltype(a) b = 2;
|
||||
return a + b;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace test_type_deduction
|
||||
{
|
||||
|
||||
template < typename T1, typename T2 >
|
||||
struct is_same
|
||||
{
|
||||
static const bool value = false;
|
||||
};
|
||||
|
||||
template < typename T >
|
||||
struct is_same<T, T>
|
||||
{
|
||||
static const bool value = true;
|
||||
};
|
||||
|
||||
template < typename T1, typename T2 >
|
||||
auto
|
||||
add(T1 a1, T2 a2) -> decltype(a1 + a2)
|
||||
{
|
||||
return a1 + a2;
|
||||
}
|
||||
|
||||
int
|
||||
test(const int c, volatile int v)
|
||||
{
|
||||
static_assert(is_same<int, decltype(0)>::value == true, "");
|
||||
static_assert(is_same<int, decltype(c)>::value == false, "");
|
||||
static_assert(is_same<int, decltype(v)>::value == false, "");
|
||||
auto ac = c;
|
||||
auto av = v;
|
||||
auto sumi = ac + av + 'x';
|
||||
auto sumf = ac + av + 1.0;
|
||||
static_assert(is_same<int, decltype(ac)>::value == true, "");
|
||||
static_assert(is_same<int, decltype(av)>::value == true, "");
|
||||
static_assert(is_same<int, decltype(sumi)>::value == true, "");
|
||||
static_assert(is_same<int, decltype(sumf)>::value == false, "");
|
||||
static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
|
||||
return (sumf > 0.0) ? sumi : add(c, v);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace test_noexcept
|
||||
{
|
||||
|
||||
int f() { return 0; }
|
||||
int g() noexcept { return 0; }
|
||||
|
||||
static_assert(noexcept(f()) == false, "");
|
||||
static_assert(noexcept(g()) == true, "");
|
||||
|
||||
}
|
||||
|
||||
namespace test_constexpr
|
||||
{
|
||||
|
||||
template < typename CharT >
|
||||
unsigned long constexpr
|
||||
strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
|
||||
{
|
||||
return *s ? strlen_c_r(s + 1, acc + 1) : acc;
|
||||
}
|
||||
|
||||
template < typename CharT >
|
||||
unsigned long constexpr
|
||||
strlen_c(const CharT *const s) noexcept
|
||||
{
|
||||
return strlen_c_r(s, 0UL);
|
||||
}
|
||||
|
||||
static_assert(strlen_c("") == 0UL, "");
|
||||
static_assert(strlen_c("1") == 1UL, "");
|
||||
static_assert(strlen_c("example") == 7UL, "");
|
||||
static_assert(strlen_c("another\0example") == 7UL, "");
|
||||
|
||||
}
|
||||
|
||||
namespace test_rvalue_references
|
||||
{
|
||||
|
||||
template < int N >
|
||||
struct answer
|
||||
{
|
||||
static constexpr int value = N;
|
||||
};
|
||||
|
||||
answer<1> f(int&) { return answer<1>(); }
|
||||
answer<2> f(const int&) { return answer<2>(); }
|
||||
answer<3> f(int&&) { return answer<3>(); }
|
||||
|
||||
void
|
||||
test()
|
||||
{
|
||||
int i = 0;
|
||||
const int c = 0;
|
||||
static_assert(decltype(f(i))::value == 1, "");
|
||||
static_assert(decltype(f(c))::value == 2, "");
|
||||
static_assert(decltype(f(0))::value == 3, "");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace test_uniform_initialization
|
||||
{
|
||||
|
||||
struct test
|
||||
{
|
||||
static const int zero {};
|
||||
static const int one {1};
|
||||
};
|
||||
|
||||
static_assert(test::zero == 0, "");
|
||||
static_assert(test::one == 1, "");
|
||||
|
||||
}
|
||||
|
||||
namespace test_lambdas
|
||||
{
|
||||
|
||||
void
|
||||
test1()
|
||||
{
|
||||
auto lambda1 = [](){};
|
||||
auto lambda2 = lambda1;
|
||||
lambda1();
|
||||
lambda2();
|
||||
}
|
||||
|
||||
int
|
||||
test2()
|
||||
{
|
||||
auto a = [](int i, int j){ return i + j; }(1, 2);
|
||||
auto b = []() -> int { return '0'; }();
|
||||
auto c = [=](){ return a + b; }();
|
||||
auto d = [&](){ return c; }();
|
||||
auto e = [a, &b](int x) mutable {
|
||||
const auto identity = [](int y){ return y; };
|
||||
for (auto i = 0; i < a; ++i)
|
||||
a += b--;
|
||||
return x + identity(a + b);
|
||||
}(0);
|
||||
return a + b + c + d + e;
|
||||
}
|
||||
|
||||
int
|
||||
test3()
|
||||
{
|
||||
const auto nullary = [](){ return 0; };
|
||||
const auto unary = [](int x){ return x; };
|
||||
using nullary_t = decltype(nullary);
|
||||
using unary_t = decltype(unary);
|
||||
const auto higher1st = [](nullary_t f){ return f(); };
|
||||
const auto higher2nd = [unary](nullary_t f1){
|
||||
return [unary, f1](unary_t f2){ return f2(unary(f1())); };
|
||||
};
|
||||
return higher1st(nullary) + higher2nd(nullary)(unary);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace test_variadic_templates
|
||||
{
|
||||
|
||||
template <int...>
|
||||
struct sum;
|
||||
|
||||
template <int N0, int... N1toN>
|
||||
struct sum<N0, N1toN...>
|
||||
{
|
||||
static constexpr auto value = N0 + sum<N1toN...>::value;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct sum<>
|
||||
{
|
||||
static constexpr auto value = 0;
|
||||
};
|
||||
|
||||
static_assert(sum<>::value == 0, "");
|
||||
static_assert(sum<1>::value == 1, "");
|
||||
static_assert(sum<23>::value == 23, "");
|
||||
static_assert(sum<1, 2>::value == 3, "");
|
||||
static_assert(sum<5, 5, 11>::value == 21, "");
|
||||
static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
|
||||
|
||||
}
|
||||
|
||||
// http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
|
||||
// Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
|
||||
// because of this.
|
||||
namespace test_template_alias_sfinae
|
||||
{
|
||||
|
||||
struct foo {};
|
||||
|
||||
template<typename T>
|
||||
using member = typename T::member_type;
|
||||
|
||||
template<typename T>
|
||||
void func(...) {}
|
||||
|
||||
template<typename T>
|
||||
void func(member<T>*) {}
|
||||
|
||||
void test();
|
||||
|
||||
void test() { func<foo>(0); }
|
||||
|
||||
}
|
||||
|
||||
} // namespace cxx11
|
||||
|
||||
#endif // __cplusplus >= 201103L
|
||||
|
||||
]])
|
||||
|
||||
|
||||
dnl Tests for new features in C++14
|
||||
|
||||
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[
|
||||
|
||||
// If the compiler admits that it is not ready for C++14, why torture it?
|
||||
// Hopefully, this will speed up the test.
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
#error "This is not a C++ compiler"
|
||||
|
||||
#elif __cplusplus < 201402L
|
||||
|
||||
#error "This is not a C++14 compiler"
|
||||
|
||||
#else
|
||||
|
||||
namespace cxx14
|
||||
{
|
||||
|
||||
namespace test_polymorphic_lambdas
|
||||
{
|
||||
|
||||
int
|
||||
test()
|
||||
{
|
||||
const auto lambda = [](auto&&... args){
|
||||
const auto istiny = [](auto x){
|
||||
return (sizeof(x) == 1UL) ? 1 : 0;
|
||||
};
|
||||
const int aretiny[] = { istiny(args)... };
|
||||
return aretiny[0];
|
||||
};
|
||||
return lambda(1, 1L, 1.0f, '1');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace test_binary_literals
|
||||
{
|
||||
|
||||
constexpr auto ivii = 0b0000000000101010;
|
||||
static_assert(ivii == 42, "wrong value");
|
||||
|
||||
}
|
||||
|
||||
namespace test_generalized_constexpr
|
||||
{
|
||||
|
||||
template < typename CharT >
|
||||
constexpr unsigned long
|
||||
strlen_c(const CharT *const s) noexcept
|
||||
{
|
||||
auto length = 0UL;
|
||||
for (auto p = s; *p; ++p)
|
||||
++length;
|
||||
return length;
|
||||
}
|
||||
|
||||
static_assert(strlen_c("") == 0UL, "");
|
||||
static_assert(strlen_c("x") == 1UL, "");
|
||||
static_assert(strlen_c("test") == 4UL, "");
|
||||
static_assert(strlen_c("another\0test") == 7UL, "");
|
||||
|
||||
}
|
||||
|
||||
namespace test_lambda_init_capture
|
||||
{
|
||||
|
||||
int
|
||||
test()
|
||||
{
|
||||
auto x = 0;
|
||||
const auto lambda1 = [a = x](int b){ return a + b; };
|
||||
const auto lambda2 = [a = lambda1(x)](){ return a; };
|
||||
return lambda2();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace test_digit_separators
|
||||
{
|
||||
|
||||
constexpr auto ten_million = 100'000'000;
|
||||
static_assert(ten_million == 100000000, "");
|
||||
|
||||
}
|
||||
|
||||
namespace test_return_type_deduction
|
||||
{
|
||||
|
||||
auto f(int& x) { return x; }
|
||||
decltype(auto) g(int& x) { return x; }
|
||||
|
||||
template < typename T1, typename T2 >
|
||||
struct is_same
|
||||
{
|
||||
static constexpr auto value = false;
|
||||
};
|
||||
|
||||
template < typename T >
|
||||
struct is_same<T, T>
|
||||
{
|
||||
static constexpr auto value = true;
|
||||
};
|
||||
|
||||
int
|
||||
test()
|
||||
{
|
||||
auto x = 0;
|
||||
static_assert(is_same<int, decltype(f(x))>::value, "");
|
||||
static_assert(is_same<int&, decltype(g(x))>::value, "");
|
||||
return x;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // namespace cxx14
|
||||
|
||||
#endif // __cplusplus >= 201402L
|
||||
|
||||
]])
|
||||
|
||||
|
||||
dnl Tests for new features in C++17
|
||||
|
||||
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[
|
||||
|
||||
// If the compiler admits that it is not ready for C++17, why torture it?
|
||||
// Hopefully, this will speed up the test.
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
#error "This is not a C++ compiler"
|
||||
|
||||
#elif __cplusplus <= 201402L
|
||||
|
||||
#error "This is not a C++17 compiler"
|
||||
|
||||
#else
|
||||
|
||||
#if defined(__clang__)
|
||||
#define REALLY_CLANG
|
||||
#else
|
||||
#if defined(__GNUC__)
|
||||
#define REALLY_GCC
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <initializer_list>
|
||||
#include <utility>
|
||||
#include <type_traits>
|
||||
|
||||
namespace cxx17
|
||||
{
|
||||
|
||||
#if !defined(REALLY_CLANG)
|
||||
namespace test_constexpr_lambdas
|
||||
{
|
||||
|
||||
// TODO: test it with clang++ from git
|
||||
|
||||
constexpr int foo = [](){return 42;}();
|
||||
|
||||
}
|
||||
#endif // !defined(REALLY_CLANG)
|
||||
|
||||
namespace test::nested_namespace::definitions
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
namespace test_fold_expression
|
||||
{
|
||||
|
||||
template<typename... Args>
|
||||
int multiply(Args... args)
|
||||
{
|
||||
return (args * ... * 1);
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
bool all(Args... args)
|
||||
{
|
||||
return (args && ...);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace test_extended_static_assert
|
||||
{
|
||||
|
||||
static_assert (true);
|
||||
|
||||
}
|
||||
|
||||
namespace test_auto_brace_init_list
|
||||
{
|
||||
|
||||
auto foo = {5};
|
||||
auto bar {5};
|
||||
|
||||
static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value);
|
||||
static_assert(std::is_same<int, decltype(bar)>::value);
|
||||
}
|
||||
|
||||
namespace test_typename_in_template_template_parameter
|
||||
{
|
||||
|
||||
template<template<typename> typename X> struct D;
|
||||
|
||||
}
|
||||
|
||||
namespace test_fallthrough_nodiscard_maybe_unused_attributes
|
||||
{
|
||||
|
||||
int f1()
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
|
||||
[[nodiscard]] int f2()
|
||||
{
|
||||
[[maybe_unused]] auto unused = f1();
|
||||
|
||||
switch (f1())
|
||||
{
|
||||
case 17:
|
||||
f1();
|
||||
[[fallthrough]];
|
||||
case 42:
|
||||
f1();
|
||||
}
|
||||
return f1();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace test_extended_aggregate_initialization
|
||||
{
|
||||
|
||||
struct base1
|
||||
{
|
||||
int b1, b2 = 42;
|
||||
};
|
||||
|
||||
struct base2
|
||||
{
|
||||
base2() {
|
||||
b3 = 42;
|
||||
}
|
||||
int b3;
|
||||
};
|
||||
|
||||
struct derived : base1, base2
|
||||
{
|
||||
int d;
|
||||
};
|
||||
|
||||
derived d1 {{1, 2}, {}, 4}; // full initialization
|
||||
derived d2 {{}, {}, 4}; // value-initialized bases
|
||||
|
||||
}
|
||||
|
||||
namespace test_general_range_based_for_loop
|
||||
{
|
||||
|
||||
struct iter
|
||||
{
|
||||
int i;
|
||||
|
||||
int& operator* ()
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
const int& operator* () const
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
iter& operator++()
|
||||
{
|
||||
++i;
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
struct sentinel
|
||||
{
|
||||
int i;
|
||||
};
|
||||
|
||||
bool operator== (const iter& i, const sentinel& s)
|
||||
{
|
||||
return i.i == s.i;
|
||||
}
|
||||
|
||||
bool operator!= (const iter& i, const sentinel& s)
|
||||
{
|
||||
return !(i == s);
|
||||
}
|
||||
|
||||
struct range
|
||||
{
|
||||
iter begin() const
|
||||
{
|
||||
return {0};
|
||||
}
|
||||
|
||||
sentinel end() const
|
||||
{
|
||||
return {5};
|
||||
}
|
||||
};
|
||||
|
||||
void f()
|
||||
{
|
||||
range r {};
|
||||
|
||||
for (auto i : r)
|
||||
{
|
||||
[[maybe_unused]] auto v = i;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace test_lambda_capture_asterisk_this_by_value
|
||||
{
|
||||
|
||||
struct t
|
||||
{
|
||||
int i;
|
||||
int foo()
|
||||
{
|
||||
return [*this]()
|
||||
{
|
||||
return i;
|
||||
}();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace test_enum_class_construction
|
||||
{
|
||||
|
||||
enum class byte : unsigned char
|
||||
{};
|
||||
|
||||
byte foo {42};
|
||||
|
||||
}
|
||||
|
||||
namespace test_constexpr_if
|
||||
{
|
||||
|
||||
template <bool cond>
|
||||
int f ()
|
||||
{
|
||||
if constexpr(cond)
|
||||
{
|
||||
return 13;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace test_selection_statement_with_initializer
|
||||
{
|
||||
|
||||
int f()
|
||||
{
|
||||
return 13;
|
||||
}
|
||||
|
||||
int f2()
|
||||
{
|
||||
if (auto i = f(); i > 0)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
switch (auto i = f(); i + 4)
|
||||
{
|
||||
case 17:
|
||||
return 2;
|
||||
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if !defined(REALLY_CLANG)
|
||||
namespace test_template_argument_deduction_for_class_templates
|
||||
{
|
||||
|
||||
// TODO: test it with clang++ from git
|
||||
|
||||
template <typename T1, typename T2>
|
||||
struct pair
|
||||
{
|
||||
pair (T1 p1, T2 p2)
|
||||
: m1 {p1},
|
||||
m2 {p2}
|
||||
{}
|
||||
|
||||
T1 m1;
|
||||
T2 m2;
|
||||
};
|
||||
|
||||
void f()
|
||||
{
|
||||
[[maybe_unused]] auto p = pair{13, 42u};
|
||||
}
|
||||
|
||||
}
|
||||
#endif // !defined(REALLY_CLANG)
|
||||
|
||||
namespace test_non_type_auto_template_parameters
|
||||
{
|
||||
|
||||
template <auto n>
|
||||
struct B
|
||||
{};
|
||||
|
||||
B<5> b1;
|
||||
B<'a'> b2;
|
||||
|
||||
}
|
||||
|
||||
#if !defined(REALLY_CLANG)
|
||||
namespace test_structured_bindings
|
||||
{
|
||||
|
||||
// TODO: test it with clang++ from git
|
||||
|
||||
int arr[2] = { 1, 2 };
|
||||
std::pair<int, int> pr = { 1, 2 };
|
||||
|
||||
auto f1() -> int(&)[2]
|
||||
{
|
||||
return arr;
|
||||
}
|
||||
|
||||
auto f2() -> std::pair<int, int>&
|
||||
{
|
||||
return pr;
|
||||
}
|
||||
|
||||
struct S
|
||||
{
|
||||
int x1 : 2;
|
||||
volatile double y1;
|
||||
};
|
||||
|
||||
S f3()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
auto [ x1, y1 ] = f1();
|
||||
auto& [ xr1, yr1 ] = f1();
|
||||
auto [ x2, y2 ] = f2();
|
||||
auto& [ xr2, yr2 ] = f2();
|
||||
const auto [ x3, y3 ] = f3();
|
||||
|
||||
}
|
||||
#endif // !defined(REALLY_CLANG)
|
||||
|
||||
#if !defined(REALLY_CLANG)
|
||||
namespace test_exception_spec_type_system
|
||||
{
|
||||
|
||||
// TODO: test it with clang++ from git
|
||||
|
||||
struct Good {};
|
||||
struct Bad {};
|
||||
|
||||
void g1() noexcept;
|
||||
void g2();
|
||||
|
||||
template<typename T>
|
||||
Bad
|
||||
f(T*, T*);
|
||||
|
||||
template<typename T1, typename T2>
|
||||
Good
|
||||
f(T1*, T2*);
|
||||
|
||||
static_assert (std::is_same_v<Good, decltype(f(g1, g2))>);
|
||||
|
||||
}
|
||||
#endif // !defined(REALLY_CLANG)
|
||||
|
||||
namespace test_inline_variables
|
||||
{
|
||||
|
||||
template<class T> void f(T)
|
||||
{}
|
||||
|
||||
template<class T> inline T g(T)
|
||||
{
|
||||
return T{};
|
||||
}
|
||||
|
||||
template<> inline void f<>(int)
|
||||
{}
|
||||
|
||||
template<> int g<>(int)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // namespace cxx17
|
||||
|
||||
#endif // __cplusplus <= 201402L
|
||||
|
||||
]])
|
||||
@@ -0,0 +1,39 @@
|
||||
# =============================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
|
||||
# =============================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Check for baseline language coverage in the compiler for the C++11
|
||||
# standard; if necessary, add switches to CXX and CXXCPP to enable
|
||||
# support.
|
||||
#
|
||||
# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX
|
||||
# macro with the version set to C++11. The two optional arguments are
|
||||
# forwarded literally as the second and third argument respectively.
|
||||
# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for
|
||||
# more information. If you want to use this macro, you also need to
|
||||
# download the ax_cxx_compile_stdcxx.m4 file.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
|
||||
# Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
|
||||
# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
|
||||
# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
|
||||
# Copyright (c) 2015 Paul Norman <penorman@mac.com>
|
||||
# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 18
|
||||
|
||||
AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX])
|
||||
AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])])
|
||||
+129
-60
@@ -6,7 +6,7 @@
|
||||
#
|
||||
# License: see file COPYING in top level of source distribution.
|
||||
#
|
||||
AC_INIT([H5hut], [2.0.0rc3], [h5part@lists.psi.ch], H5hut)
|
||||
AC_INIT([H5hut], [2.0.0rc4], [h5part@lists.psi.ch], H5hut)
|
||||
AC_PREREQ(2.60)
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
@@ -119,19 +119,43 @@ if test "x$ENABLE_PARALLEL" = "xyes"; then
|
||||
if test "x$MPICXX" != "x"; then
|
||||
CXX=$MPICXX
|
||||
fi
|
||||
if test "x$MPIFC" != "x"; then
|
||||
FC=$MPIFC
|
||||
else
|
||||
FC=''
|
||||
F77=''
|
||||
F90=''
|
||||
fi
|
||||
c_compilers="mpicc cc"
|
||||
cxx_compilers="mpic++ CC"
|
||||
fc_compiler="mpif90 mpif77 mpifort"
|
||||
else
|
||||
c_compilers="pgcc pathcc icc gcc cc_r cc"
|
||||
cxx_compilers="pgcc pathcc icc g++ cc_r c++"
|
||||
fc_compiler="pgf90 ifort xlf_r pathf90 g95 g90 ftn gfortran"
|
||||
fi
|
||||
|
||||
AC_PROG_CC($c_compilers)
|
||||
if test "x$ac_cv_prog_cc_c89" = "xno"; then
|
||||
AC_MSG_ERROR([C compiler not found!])
|
||||
exit 1
|
||||
fi
|
||||
|
||||
AC_PROG_CXX($cxx_compilers)
|
||||
|
||||
if test "X$ENABLE_FORTRAN" = "Xyes"; then
|
||||
AC_PROG_FC($fc_compiler)
|
||||
if test "x$FC" = "x"; then
|
||||
AC_MSG_ERROR([Fortran compiler not found!])
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
CC=`which $CC`
|
||||
CXX=`which $CXX`
|
||||
FC=`which $FC`
|
||||
|
||||
AX_CXX_COMPILE_STDCXX_11
|
||||
AC_PROG_CC_C99
|
||||
if test "x$ac_cv_prog_cc_c99" = "xno"; then
|
||||
AC_MSG_ERROR([Cannot set C compiler to use C99 standard!])
|
||||
@@ -239,6 +263,69 @@ AC_DEFINE_UNQUOTED(MY_UNAME, "$uname", "")
|
||||
###############################################################################
|
||||
# PROCESS ARGUMENTS
|
||||
|
||||
###############################################################################
|
||||
# check libraries
|
||||
|
||||
AC_CHECK_LIB([z], [compress2])
|
||||
|
||||
# hdf5
|
||||
if test -z "${HDF5_PREFIX}"; then
|
||||
# alternatives to HDF5_PREFIX
|
||||
if test -n "${HDF5_DIR}"; then
|
||||
HDF5_PREFIX=${HDF5_DIR}
|
||||
fi
|
||||
fi
|
||||
if test -n "${HDF5_PREFIX}"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$HDF5_PREFIX/include"
|
||||
LDFLAGS="$LDFLAGS -L$HDF5_PREFIX/lib"
|
||||
fi
|
||||
AC_CHECK_LIB([hdf5], [H5open])
|
||||
AS_IF([test "x$ac_cv_lib_hdf5_H5open" != xyes],
|
||||
[AC_MSG_ERROR([Cannot compile and link a HDF5 program]);
|
||||
exit 1])
|
||||
AC_MSG_CHECKING([checking whether hdf5 lib supports parallel IO])
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include "hdf5.h"
|
||||
#ifndef H5_HAVE_PARALLEL
|
||||
# error macro not defined
|
||||
#endif
|
||||
]])], [H5_HAVE_PARALLEL="yes"], [H5_HAVE_PARALLEL="no"])
|
||||
AC_MSG_RESULT([$H5_HAVE_PARALLEL])
|
||||
|
||||
# lustre
|
||||
AC_MSG_CHECKING([for lustre API ])
|
||||
AC_MSG_RESULT([])
|
||||
if test -n "${LUSTREPATH}"; then
|
||||
P=${LUSTREPATH}
|
||||
elif test -n "${LUSTREROOT}" ; then
|
||||
P=${LUSTREROOT}
|
||||
elif test -n "${LUSTREHOME}" ; then
|
||||
P=${LUSTREHOME}
|
||||
elif test -n "${LUSTRE_DIR}" ; then
|
||||
P=${LUSTRE_DIR}
|
||||
else
|
||||
P=''
|
||||
P="$P /usr"
|
||||
P="$P /usr/local"
|
||||
P="$P /usr/local/lustre"
|
||||
P="$P /opt/lustre"
|
||||
fi
|
||||
PATH_Search LUSTREROOT "$P" usr/include/lustre/liblustreapi.h
|
||||
if test -z "$LUSTREROOT"; then
|
||||
AC_MSG_WARN([Couldn't locate the lustre API... building without support for lustre striping!])
|
||||
else
|
||||
CFLAGS="$CFLAGS -DH5_USE_LUSTRE"
|
||||
CPPFLAGS="$CPPFLAGS -I$LUSTREROOT/usr/include"
|
||||
LDFLAGS="$LDFLAGS -L$LUSTREROOT/usr/lib"
|
||||
LIBS="$LIBS -llustreapi"
|
||||
fi
|
||||
|
||||
LIBS="$LIBS -lm"
|
||||
|
||||
|
||||
|
||||
############################ enabled bindings ###############################
|
||||
|
||||
# C enabled?
|
||||
AC_MSG_CHECKING([if C interface enabled])
|
||||
if test "X$ENABLE_C" = "Xyes"; then
|
||||
@@ -252,15 +339,6 @@ AC_MSG_CHECKING([if fortran interface enabled])
|
||||
if test "X$ENABLE_FORTRAN" = "Xyes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_LANG_PUSH(Fortran)
|
||||
FC=''
|
||||
F77=''
|
||||
F90=''
|
||||
if test "X$ENABLE_PARALLEL" = "Xyes"; then
|
||||
AC_PROG_FC(mpif90 mpif77)
|
||||
else
|
||||
AC_PROG_FC(pgf90 ifort xlf_r pathf90 g95 g90 ftn gfortran)
|
||||
fi
|
||||
FC=`which $FC`
|
||||
|
||||
# Query Fortran symbol mangling. __AC_FC_NAME_MANGLING sets
|
||||
# ac_cv_{f77,fc}_mangling. The value contains three fields, separated
|
||||
@@ -349,6 +427,15 @@ fi
|
||||
AC_MSG_CHECKING([if parallel interface enabled])
|
||||
if test "X$ENABLE_PARALLEL" = "Xyes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
|
||||
AS_IF([test "x$H5_HAVE_PARALLEL" = "xno"],
|
||||
[AC_MSG_ERROR([hdf5 does not support parallel IO!]);
|
||||
exit 1])
|
||||
|
||||
if test "X$ENABLE_VTKCONVERTER" = "Xyes"; then
|
||||
AC_MSG_ERROR([VTK to H5hut grid converter cannot be compiled parallel!])
|
||||
exit 1
|
||||
fi
|
||||
CPPFLAGS="${CPPFLAGS} -DPARALLEL_IO -DMPICH_IGNORE_CXX_SEEK"
|
||||
|
||||
if test "X$ENABLE_EXPERIMENTAL" = "Xyes"; then
|
||||
@@ -371,62 +458,43 @@ if test "X$ENABLE_PARALLEL" = "Xyes"; then
|
||||
fi
|
||||
else # --enable-parallel=no
|
||||
AC_MSG_RESULT([no])
|
||||
AS_IF([test "x$H5_HAVE_PARALLEL" = "xyes"],
|
||||
[AC_MSG_ERROR([hdf5 with support for parallel IO cannot be used for non-parallel H5hut!]);
|
||||
exit 1])
|
||||
fi
|
||||
|
||||
###############################################################################
|
||||
# LIBRARY PATHS
|
||||
if test -z "${HDF5_PREFIX}"; then
|
||||
# alternatives to HDF5_PREFIX
|
||||
if test -n "${HDF5_DIR}"; then
|
||||
HDF5_PREFIX=${HDF5_DIR}
|
||||
fi
|
||||
fi
|
||||
if test -n "${HDF5_PREFIX}"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$HDF5_PREFIX/include"
|
||||
LDFLAGS="$LDFLAGS -L$HDF5_PREFIX/lib"
|
||||
fi
|
||||
AC_CHECK_LIB([z], [compress2])
|
||||
AC_CHECK_LIB([hdf5], [H5open])
|
||||
AS_IF([test "x$ac_cv_lib_hdf5_H5open" != xyes],
|
||||
[AC_MSG_ERROR([Cannot compile and link a HDF5 program]);
|
||||
exit 1])
|
||||
|
||||
|
||||
AC_MSG_CHECKING([for lustre API ])
|
||||
AC_MSG_RESULT([])
|
||||
if test -n "${LUSTREPATH}"; then
|
||||
P=${LUSTREPATH}
|
||||
elif test -n "${LUSTREROOT}" ; then
|
||||
P=${LUSTREROOT}
|
||||
elif test -n "${LUSTREHOME}" ; then
|
||||
P=${LUSTREHOME}
|
||||
elif test -n "${LUSTRE_DIR}" ; then
|
||||
P=${LUSTRE_DIR}
|
||||
else
|
||||
P=''
|
||||
P="$P /usr"
|
||||
P="$P /usr/local"
|
||||
P="$P /usr/local/lustre"
|
||||
P="$P /opt/lustre"
|
||||
fi
|
||||
PATH_Search LUSTREROOT "$P" usr/include/lustre/liblustreapi.h
|
||||
if test -z "$LUSTREROOT"; then
|
||||
AC_MSG_WARN([Couldn't locate the lustre API... building without support for lustre striping!])
|
||||
else
|
||||
CFLAGS="$CFLAGS -DH5_USE_LUSTRE"
|
||||
CPPFLAGS="$CPPFLAGS -I$LUSTREROOT/usr/include"
|
||||
LDFLAGS="$LDFLAGS -L$LUSTREROOT/usr/lib"
|
||||
LIBS="$LIBS -llustreapi"
|
||||
fi
|
||||
|
||||
LIBS="$LIBS -lm"
|
||||
|
||||
###############################################################################
|
||||
# TOOLS
|
||||
AC_MSG_CHECKING([if we have to compile the VTK to H5hut grid converter])
|
||||
if test "X$ENABLE_VTKCONVERTER" = "Xyes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
# :TODO: add test whether we can compile/link a prog with vtk
|
||||
if test -n "$VTK_PREFIX"; then
|
||||
SAVE_C_INCLUDE_PATH="$C_INCLUDE_PATH"
|
||||
SAVE_CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH"
|
||||
SAVE_LIBRARY_PATH="$LIBRARY_PATH"
|
||||
C_INCLUDE_PATH="$C_INCLUDE_PATH $VTK_PREFIX/include"
|
||||
CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH $VTK_PREFIX/include"
|
||||
LIBRARY_PATH="$LIBRARY_PATH $VTK_PREFIX/lib"
|
||||
fi
|
||||
AC_MSG_CHECKING([VTK inlcude files])
|
||||
VTK_INCLUDES=`cmake --find-package -DNAME=VTK -DCOMPILER_ID=GNU -DLANGUAGE=C -DMODE=COMPILE 2>/dev/null`
|
||||
if test "X$?" != "X0"; then
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([Cannot compile VTK to H5hut converter])
|
||||
exit 1
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
AC_MSG_CHECKING([VTK libraries])
|
||||
VTK_LIBS=`cmake --find-package -DNAME=VTK -DCOMPILER_ID=GNU -DLANGUAGE=C -DMODE=LINK 2>/dev/null`
|
||||
if test "X$?" != "X0"; then
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([Cannot compile VTK to H5hut converter]);
|
||||
exit 1
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
@@ -450,7 +518,8 @@ AC_SUBST(CFLAGS)
|
||||
AC_SUBST(FFLAGS)
|
||||
AC_SUBST(AM_CPPFLAGS)
|
||||
AC_SUBST(AM_LDFLAGS)
|
||||
|
||||
AC_SUBST(VTK_INCLUDES)
|
||||
AC_SUBST(VTK_LIBS)
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
src/Makefile
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#
|
||||
|
||||
AM_CPPFLAGS += -I${abs_top_srcdir}/src/include
|
||||
AM_CPPFLAGS += -I${abs_top_srcdir}/examples/include
|
||||
FFLAGS += -cpp $(AM_CPPFLAGS)
|
||||
AM_LDFLAGS += -L${abs_top_builddir}/src/h5core/.libs
|
||||
|
||||
@@ -39,7 +40,6 @@ noinst_PROGRAMS += \
|
||||
endif
|
||||
|
||||
if ENABLE_FORTRAN
|
||||
if ENABLE_PARALLEL
|
||||
noinst_PROGRAMS += \
|
||||
openclosef \
|
||||
queryf \
|
||||
@@ -56,7 +56,8 @@ write_file_attribsf_SOURCES = write_file_attribsf.f90
|
||||
write_step_attribsf_SOURCES = write_step_attribsf.f90
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
%.o : %.f90
|
||||
all: ${noinst_PROGRAMS}
|
||||
|
||||
.f90.o:
|
||||
$(FC) $(FFLAGS) -c $<
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#define VERBOSITY H5_VERBOSE_ERROR
|
||||
#define DEBUG_MSK H5_DEBUG_ALL
|
||||
|
||||
#include "examples.h"
|
||||
|
||||
int
|
||||
main (
|
||||
|
||||
+19
-7
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2006-2015, The Regents of the University of California,
|
||||
Copyright (c) 2006-2018, The Regents of the University of California,
|
||||
through Lawrence Berkeley National Laboratory (subject to receipt of any
|
||||
required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
|
||||
Institut (Switzerland). All rights reserved.
|
||||
@@ -9,6 +9,20 @@
|
||||
|
||||
#include "H5hut.h"
|
||||
|
||||
#include "examples.h"
|
||||
|
||||
#if !defined(VERBOSITY)
|
||||
#define VERBOSITY H5_VERBOSE_ERROR
|
||||
#endif
|
||||
|
||||
/*
|
||||
Use H5_DEBUG_ALL to get full debug output
|
||||
*/
|
||||
#if !defined(DEBUGMASK)
|
||||
#define DEBUGMASK H5_DEBUG_NONE
|
||||
//#define DEBUGMASK H5_DEBUG_ALL
|
||||
#endif
|
||||
|
||||
int
|
||||
main (
|
||||
int argc,
|
||||
@@ -16,18 +30,16 @@ main (
|
||||
) {
|
||||
MPI_Comm comm = MPI_COMM_WORLD;
|
||||
|
||||
int myproc;
|
||||
int nprocs;
|
||||
MPI_Init (&argc, &argv);
|
||||
MPI_Comm_size (comm, &nprocs);
|
||||
MPI_Comm_rank (comm, &myproc);
|
||||
|
||||
H5SetVerbosityLevel (VERBOSITY);
|
||||
H5SetDebugMask (DEBUGMASK);
|
||||
h5_prop_t prop = H5CreateFileProp ();
|
||||
H5SetPropFileMPIOCollective (prop, &comm);
|
||||
h5_file_t f = H5OpenFile ("testfile.h5", H5_O_WRONLY, prop);
|
||||
H5CloseProp (prop);
|
||||
H5CloseFile (f);
|
||||
|
||||
H5Finalize ();
|
||||
MPI_Finalize ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -14,22 +14,33 @@ program openclose
|
||||
|
||||
implicit none
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
include 'mpif.h'
|
||||
|
||||
integer :: comm, rank, ierr
|
||||
#endif
|
||||
integer :: comm, rank
|
||||
integer*8 :: file_id, status
|
||||
integer*8 :: props
|
||||
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
integer :: ierr
|
||||
comm = MPI_COMM_WORLD
|
||||
call mpi_init(ierr)
|
||||
call mpi_comm_rank(comm, rank, ierr)
|
||||
|
||||
#else
|
||||
comm = 0
|
||||
rank = 1
|
||||
#endif
|
||||
|
||||
props = h5_createprop_file ()
|
||||
#if defined(PARALLEL_IO)
|
||||
status = h5_setprop_file_mpio_collective (props, comm)
|
||||
#endif
|
||||
file_id = h5_openfile ("testfile.h5", H5_O_WRONLY, props)
|
||||
status = h5_closeprop (props)
|
||||
status = h5_closefile (file_id);
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
call mpi_finalize(ierr)
|
||||
|
||||
#endif
|
||||
|
||||
end program openclose
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
#include "H5hut.h"
|
||||
|
||||
#include "examples.h"
|
||||
|
||||
#define FNAME1 "example_file_attribs.h5"
|
||||
#define FNAME2 "example_step_attribs.h5"
|
||||
|
||||
|
||||
+10
-5
@@ -1,5 +1,5 @@
|
||||
!
|
||||
! Copyright (c) 2006-2013, The Regents of the University of California,
|
||||
! Copyright (c) 2006-2017, The Regents of the University of California,
|
||||
! through Lawrence Berkeley National Laboratory (subject to receipt of any
|
||||
! required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
|
||||
! Institut (Switzerland). All rights reserved.!
|
||||
@@ -7,15 +7,17 @@
|
||||
! License: see file COPYING in top level of source distribution.
|
||||
!
|
||||
include 'H5hut.f90'
|
||||
|
||||
|
||||
program query
|
||||
use H5hut
|
||||
implicit none
|
||||
#if defined(PARALLEL_IO)
|
||||
include 'mpif.h'
|
||||
#endif
|
||||
|
||||
! the file name we want to read
|
||||
character (len=*), parameter :: FNAME1 = "example_file_attribs.h5"
|
||||
character (len=*), parameter :: FNAME2 = "example_step_attribs.h5"
|
||||
character (len=*), parameter :: FNAME1 = "example_file_attribs.h5"
|
||||
character (len=*), parameter :: FNAME2 = "example_step_attribs.h5"
|
||||
|
||||
! verbosity level: set it to a power of 2 minus one or zero
|
||||
integer*8, parameter :: verbosity_level = 1
|
||||
@@ -23,7 +25,9 @@
|
||||
! used for mpi error return
|
||||
integer :: ierr
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
call mpi_init (ierr)
|
||||
#endif
|
||||
|
||||
! abort program on any H5hut error
|
||||
call h5_abort_on_error ()
|
||||
@@ -33,8 +37,9 @@
|
||||
call query_file (FNAME1);
|
||||
call query_file (FNAME2);
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
call mpi_finalize(ierr)
|
||||
|
||||
#endif
|
||||
call exit (ierr)
|
||||
|
||||
contains
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "H5hut.h"
|
||||
#include "examples.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
program read_file_attribs
|
||||
use H5hut
|
||||
implicit none
|
||||
#if defined(PARALLEL_IO)
|
||||
include 'mpif.h'
|
||||
#endif
|
||||
|
||||
! the file name we want to read
|
||||
character (len=*), parameter :: FNAME = "example_file_attribs.h5"
|
||||
@@ -40,9 +42,6 @@
|
||||
real*4, allocatable :: r4_value (:)
|
||||
real*8, allocatable :: r8_value (:)
|
||||
|
||||
! used for mpi error return
|
||||
integer :: ierr
|
||||
|
||||
! H5hut file id
|
||||
integer*8 :: file_id
|
||||
|
||||
@@ -58,7 +57,12 @@
|
||||
! loop index
|
||||
integer*8 i
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
! used for mpi error return
|
||||
integer :: ierr
|
||||
|
||||
call mpi_init (ierr)
|
||||
#endif
|
||||
|
||||
! abort program on any H5hut error
|
||||
call h5_abort_on_error ()
|
||||
@@ -109,6 +113,7 @@
|
||||
|
||||
! cleanup
|
||||
status = h5_closefile (file_id)
|
||||
#if defined(PARALLEL_IO)
|
||||
call mpi_finalize(ierr)
|
||||
|
||||
#endif
|
||||
end program read_file_attribs
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "H5hut.h"
|
||||
#include "examples.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
@@ -11,8 +11,11 @@
|
||||
program read_step_attribs
|
||||
use H5hut
|
||||
implicit none
|
||||
include 'mpif.h'
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
include 'mpif.h'
|
||||
#endif
|
||||
|
||||
! the file name we want to read
|
||||
character (len=*), parameter :: FNAME = "example_file_attribs.h5"
|
||||
|
||||
@@ -36,9 +39,6 @@
|
||||
real*4, allocatable :: r4_value (:)
|
||||
real*8, allocatable :: r8_value (:)
|
||||
|
||||
! used for mpi error return
|
||||
integer :: ierr
|
||||
|
||||
! H5hut file id
|
||||
integer*8 :: file_id
|
||||
|
||||
@@ -54,8 +54,13 @@
|
||||
! loop index
|
||||
integer*8 i
|
||||
|
||||
call mpi_init (ierr)
|
||||
#if defined(PARALLEL_IO)
|
||||
! used for mpi error return
|
||||
integer :: ierr
|
||||
|
||||
call mpi_init (ierr)
|
||||
#endif
|
||||
|
||||
! abort program on any H5hut error
|
||||
call h5_abort_on_error ()
|
||||
|
||||
@@ -108,6 +113,7 @@
|
||||
|
||||
! cleanup
|
||||
status = h5_closefile (file_id)
|
||||
#if defined(PARALLEL_IO)
|
||||
call mpi_finalize(ierr)
|
||||
|
||||
#endif
|
||||
end program read_step_attribs
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "H5hut.h"
|
||||
#include "examples.h"
|
||||
|
||||
#define FNAME "example_file_attribs.h5"
|
||||
|
||||
|
||||
@@ -11,8 +11,11 @@
|
||||
program write_file_attribs
|
||||
use H5hut
|
||||
implicit none
|
||||
include 'mpif.h'
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
include 'mpif.h'
|
||||
#endif
|
||||
|
||||
integer*8, parameter :: verbosity_level = 1
|
||||
|
||||
character (len=*), parameter :: FNAME = "example_file_attribs.h5"
|
||||
@@ -29,11 +32,13 @@
|
||||
real*4, parameter, dimension(*) :: r4_value = (/2.71828/)
|
||||
real*8, parameter, dimension(*) :: r8_value = (/3.141592653589793238462643383279502884197169/)
|
||||
|
||||
integer :: ierr
|
||||
integer*8 :: file_id, status
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
integer :: ierr
|
||||
call mpi_init(ierr)
|
||||
|
||||
#endif
|
||||
|
||||
! abort program on any H5hut error
|
||||
call h5_abort_on_error()
|
||||
|
||||
@@ -51,6 +56,8 @@
|
||||
|
||||
! cleanup
|
||||
status = h5_closefile (file_id)
|
||||
call mpi_finalize(ierr)
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
call mpi_finalize(ierr)
|
||||
#endif
|
||||
end program write_file_attribs
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "H5hut.h"
|
||||
#include "examples.h"
|
||||
|
||||
#define FNAME "example_step_attribs.h5"
|
||||
|
||||
|
||||
@@ -11,8 +11,11 @@
|
||||
program write_step_attribs
|
||||
use H5hut
|
||||
implicit none
|
||||
include 'mpif.h'
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
include 'mpif.h'
|
||||
#endif
|
||||
|
||||
integer*8, parameter :: verbosity_level = 1
|
||||
character (len=*), parameter :: FNAME = "example_step_attribs.h5"
|
||||
|
||||
@@ -29,11 +32,13 @@
|
||||
real*4, parameter, dimension(*) :: r4_value = (/2.71828/)
|
||||
real*8, parameter, dimension(*) :: r8_value = (/3.141592653589793238462643383279502884197169/)
|
||||
|
||||
integer :: ierr
|
||||
integer*8 :: file_id, status
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
integer :: ierr
|
||||
call mpi_init(ierr)
|
||||
|
||||
#endif
|
||||
|
||||
! abort program on any H5hut error
|
||||
call h5_abort_on_error()
|
||||
|
||||
@@ -54,6 +59,8 @@
|
||||
|
||||
! cleanup
|
||||
status = h5_closefile (file_id)
|
||||
call mpi_finalize(ierr)
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
call mpi_finalize(ierr)
|
||||
#endif
|
||||
end program write_step_attribs
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#
|
||||
|
||||
AM_CPPFLAGS += -I${abs_top_srcdir}/src/include
|
||||
AM_CPPFLAGS += -I${abs_top_srcdir}/examples/include
|
||||
FFLAGS += -cpp $(AM_CPPFLAGS)
|
||||
AM_LDFLAGS += -L${abs_top_builddir}/src/h5core/.libs
|
||||
|
||||
@@ -34,10 +35,8 @@ noinst_PROGRAMS += \
|
||||
endif
|
||||
|
||||
if ENABLE_FORTRAN
|
||||
if ENABLE_PARALLEL
|
||||
noinst_PROGRAMS += read_write_scalar_fieldf
|
||||
endif
|
||||
endif
|
||||
|
||||
attach_field_attributes_SOURCES = attach_field_attributes.c
|
||||
dump_field_attributes_SOURCES = dump_field_attributes.c
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "H5hut.h"
|
||||
#include "examples.h"
|
||||
|
||||
// name of output file
|
||||
const char* fname = "example_field.h5";
|
||||
@@ -23,11 +24,6 @@ main (
|
||||
|
||||
// initialize MPI & H5hut
|
||||
MPI_Init (&argc, &argv);
|
||||
MPI_Comm comm = MPI_COMM_WORLD;
|
||||
int comm_size = 1;
|
||||
MPI_Comm_size (comm, &comm_size);
|
||||
int comm_rank = 0;
|
||||
MPI_Comm_rank (comm, &comm_rank);
|
||||
H5AbortOnError ();
|
||||
H5SetVerbosityLevel (h5_verbosity);
|
||||
//H5SetDebugMask (-1);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2006-2015, The Regents of the University of California,
|
||||
Copyright (c) 2006-2017, The Regents of the University of California,
|
||||
through Lawrence Berkeley National Laboratory (subject to receipt of any
|
||||
required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
|
||||
Institut (Switzerland). All rights reserved.
|
||||
@@ -8,6 +8,9 @@
|
||||
*/
|
||||
|
||||
#include "H5hut.h"
|
||||
#include "examples.h"
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
// name of output file
|
||||
const char* fname = "example_field.h5";
|
||||
@@ -30,9 +33,9 @@ dump_int64_attrib (
|
||||
attrib_data);
|
||||
printf ("Attribute: '%s'\n", attrib_name);
|
||||
printf (" Type: H5_INT64_T\n");
|
||||
printf (" Data: %lld", attrib_data[0]);
|
||||
printf (" Data: %" PRId64, attrib_data[0]);
|
||||
for (size_t i = 1; i < attrib_nelems; i++) {
|
||||
printf (", %lld", attrib_data[i]);
|
||||
printf (", %" PRId64, attrib_data[i]);
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
@@ -174,7 +177,7 @@ main (
|
||||
h5_ssize_t n_attribs = H5BlockGetNumFieldAttribs (
|
||||
file,
|
||||
field_name);
|
||||
printf ("Field has %lld attributes attached.\n",
|
||||
printf ("Field has %" PRId64 " attributes attached.\n",
|
||||
n_attribs);
|
||||
|
||||
// dump all attached attributes
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
/*
|
||||
Copyright (c) 2006-2017, The Regents of the University of California,
|
||||
through Lawrence Berkeley National Laboratory (subject to receipt of any
|
||||
required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
|
||||
Institut (Switzerland). All rights reserved.
|
||||
|
||||
License: see file COPYING in top level of source distribution.
|
||||
*/
|
||||
|
||||
#include <H5hut.h>
|
||||
#include "examples.h"
|
||||
|
||||
#define XSIZE 8
|
||||
#define YSIZE 8
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2006-2015, The Regents of the University of California,
|
||||
Copyright (c) 2006-2017, The Regents of the University of California,
|
||||
through Lawrence Berkeley National Laboratory (subject to receipt of any
|
||||
required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
|
||||
Institut (Switzerland). All rights reserved.
|
||||
@@ -8,6 +8,9 @@
|
||||
*/
|
||||
|
||||
#include "H5hut.h"
|
||||
#include "examples.h"
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
// name of output file
|
||||
const char* fname = "example_write_field.h5";
|
||||
@@ -69,10 +72,10 @@ main (
|
||||
} else if (type == H5_STRING_T) {
|
||||
stype = "H5_STRING_T";
|
||||
}
|
||||
printf ("rank of field: %lld\n", field_rank);
|
||||
printf ("dims of field: [%lld, %lld, %lld]\n",
|
||||
printf ("rank of field: %" PRId64 "\n", field_rank);
|
||||
printf ("dims of field: [%" PRId64 ", %" PRId64 ", %" PRId64"]\n",
|
||||
field_dims[0], field_dims[1], field_dims[2]);
|
||||
printf ("rank of field data: %lld\n", elem_rank);
|
||||
printf ("rank of field data: %" PRId64 "\n", elem_rank);
|
||||
printf ("type of field data: '%s'\n", stype);
|
||||
done:
|
||||
// done
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2006-2015, The Regents of the University of California,
|
||||
Copyright (c) 2006-2017, The Regents of the University of California,
|
||||
through Lawrence Berkeley National Laboratory (subject to receipt of any
|
||||
required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
|
||||
Institut (Switzerland). All rights reserved.
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "H5hut.h"
|
||||
#include "examples.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
@@ -11,13 +11,17 @@ include 'H5hut.f90'
|
||||
program read_write_scalar_field
|
||||
use H5hut
|
||||
implicit none
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
include 'mpif.h'
|
||||
|
||||
integer :: comm = 0
|
||||
integer :: mpi_err
|
||||
#endif
|
||||
|
||||
integer :: nargs = 0
|
||||
integer :: comm_rank = 0
|
||||
integer :: comm_size = 1
|
||||
integer :: comm = 0
|
||||
integer :: mpi_err
|
||||
integer*8 :: h5_err
|
||||
integer :: i
|
||||
character(len=32) :: arg_str
|
||||
@@ -174,10 +178,15 @@ program read_write_scalar_field
|
||||
end do
|
||||
|
||||
! init MPI & H5hut
|
||||
#if defined(PARALLEL_IO)
|
||||
comm = MPI_COMM_WORLD
|
||||
call mpi_init(mpi_err)
|
||||
call mpi_comm_rank(comm, comm_rank, mpi_err)
|
||||
call mpi_comm_size (comm, comm_size, mpi_err)
|
||||
#else
|
||||
comm_size = 1
|
||||
comm_rank = 0
|
||||
#endif
|
||||
call h5_abort_on_error ()
|
||||
call h5_set_verbosity_level (511_8)
|
||||
|
||||
@@ -215,7 +224,9 @@ program read_write_scalar_field
|
||||
|
||||
case default
|
||||
print *, "Run this test on 1, 8, 16 or 32 cores!"
|
||||
#if defined(PARALLEL_IO)
|
||||
call mpi_finalize
|
||||
#endif
|
||||
call exit (1)
|
||||
end select
|
||||
|
||||
@@ -233,7 +244,9 @@ program read_write_scalar_field
|
||||
|
||||
endif
|
||||
print "('[proc ', I3, ']: Cleanup.')", comm_rank
|
||||
#if defined(PARALLEL_IO)
|
||||
call mpi_finalize
|
||||
#endif
|
||||
print "('[proc ', I3, ']: Done.')", comm_rank
|
||||
call exit (0)
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "H5hut.h"
|
||||
#include "examples.h"
|
||||
|
||||
// name of output file
|
||||
const char* fname = "example_field.h5";
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "H5hut.h"
|
||||
|
||||
#ifndef PARALLEL_IO
|
||||
#ifndef H5_HAVE_PARALLEL
|
||||
#ifndef MPI_COMM_WORLD
|
||||
#define MPI_COMM_WORLD 0
|
||||
#endif
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "H5hut.h"
|
||||
|
||||
#ifndef PARALLEL_IO
|
||||
#ifndef H5_HAVE_PARALLEL
|
||||
#ifndef MPI_COMM_WORLD
|
||||
#define MPI_COMM_WORLD 0
|
||||
#endif
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "H5hut.h"
|
||||
|
||||
#ifndef PARALLEL_IO
|
||||
#ifndef H5_HAVE_PARALLEL
|
||||
#ifndef MPI_COMM_WORLD
|
||||
#define MPI_COMM_WORLD 0
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "H5hut.h"
|
||||
#if defined (PARALLEL_IO)
|
||||
#if defined (H5_HAVE_PARALLEL)
|
||||
#include <mpi.h>
|
||||
#endif
|
||||
|
||||
@@ -87,7 +87,7 @@ done:
|
||||
H5FedCloseMesh (m);
|
||||
H5CloseFile (f);
|
||||
|
||||
#if defined (PARALLEL_IO)
|
||||
#if defined (H5_HAVE_PARALLEL)
|
||||
MPI_Finalize ();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "H5hut.h"
|
||||
#if defined (PARALLEL_IO)
|
||||
#if defined (H5_HAVE_PARALLEL)
|
||||
#include <mpi.h>
|
||||
#endif
|
||||
|
||||
@@ -253,7 +253,7 @@ main (
|
||||
|
||||
/* done */
|
||||
H5CloseFile (f);
|
||||
#if defined (PARALLEL_IO)
|
||||
#if defined (H5_HAVE_PARALLEL)
|
||||
MPI_Finalize ();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "H5hut.h"
|
||||
|
||||
#ifndef PARALLEL_IO
|
||||
#ifndef H5_HAVE_PARALLEL
|
||||
#ifndef MPI_COMM_WORLD
|
||||
#define MPI_COMM_WORLD 0
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2006-2015, The Regents of the University of California,
|
||||
# Copyright (c) 2006-2017, The Regents of the University of California,
|
||||
# through Lawrence Berkeley National Laboratory (subject to receipt of any
|
||||
# required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
|
||||
# Institut (Switzerland). All rights reserved.!
|
||||
@@ -8,6 +8,7 @@
|
||||
#
|
||||
|
||||
AM_CPPFLAGS += -I${abs_top_srcdir}/src/include
|
||||
AM_CPPFLAGS += -I${abs_top_srcdir}/examples/include
|
||||
FFLAGS += -cpp $(AM_CPPFLAGS)
|
||||
AM_LDFLAGS += -L${abs_top_builddir}/src/h5core/.libs
|
||||
|
||||
@@ -42,7 +43,6 @@ noinst_PROGRAMS += \
|
||||
endif
|
||||
|
||||
if ENABLE_FORTRAN
|
||||
if ENABLE_PARALLEL
|
||||
noinst_PROGRAMS += \
|
||||
read_core_vfdf \
|
||||
read_canonicalviewf \
|
||||
@@ -54,7 +54,6 @@ noinst_PROGRAMS += \
|
||||
write_setviewf \
|
||||
write_stridedf
|
||||
endif
|
||||
endif
|
||||
|
||||
EXTRA_PROGRAMS =
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "H5hut.h"
|
||||
#include "examples.h"
|
||||
|
||||
#define FNAME "example_setview.h5"
|
||||
#define VERBOSITY H5_VERBOSE_ERROR
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "H5hut.h"
|
||||
#include "examples.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -25,8 +26,6 @@ main (
|
||||
// initialize MPI & H5hut
|
||||
MPI_Init (&argc, &argv);
|
||||
MPI_Comm comm = MPI_COMM_WORLD;
|
||||
int comm_size = 1;
|
||||
MPI_Comm_size (comm, &comm_size);
|
||||
int comm_rank = 0;
|
||||
MPI_Comm_rank (comm, &comm_rank);
|
||||
H5AbortOnError ();
|
||||
|
||||
@@ -11,7 +11,10 @@ include 'H5hut.f90'
|
||||
program read_canonicalview
|
||||
use H5hut
|
||||
implicit none
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
include 'mpif.h'
|
||||
#endif
|
||||
|
||||
! name of input file
|
||||
character (len=*), parameter :: fname = "example_setview.h5"
|
||||
@@ -19,17 +22,19 @@ program read_canonicalview
|
||||
! H5hut verbosity level
|
||||
integer*8, parameter :: h5_verbosity = H5_VERBOSE_DEFAULT
|
||||
|
||||
integer :: comm, comm_size, comm_rank, mpi_ierror
|
||||
integer :: comm_rank = 0
|
||||
integer*8 :: file, h5_ierror
|
||||
integer*8 :: num_particles
|
||||
integer*8 :: i
|
||||
integer*4, allocatable :: data(:)
|
||||
|
||||
! initialize MPI & H5hut
|
||||
#if defined(PARALLEL_IO)
|
||||
integer :: comm, mpi_ierror
|
||||
comm = MPI_COMM_WORLD
|
||||
call mpi_init (mpi_ierror)
|
||||
call mpi_comm_size (comm, comm_size, mpi_ierror)
|
||||
call mpi_comm_rank (comm, comm_rank, mpi_ierror)
|
||||
#endif
|
||||
call h5_abort_on_error ()
|
||||
call h5_set_verbosity_level (h5_verbosity)
|
||||
|
||||
@@ -53,6 +58,9 @@ program read_canonicalview
|
||||
! cleanup
|
||||
deallocate (data)
|
||||
h5_ierror = h5_closefile (file)
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
call mpi_finalize (mpi_ierror)
|
||||
#endif
|
||||
|
||||
end program read_canonicalview
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
the VFD core driver.
|
||||
*/
|
||||
#include "H5hut.h"
|
||||
#include "examples.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -32,8 +33,6 @@ main (
|
||||
// initialize MPI & H5hut
|
||||
MPI_Init (&argc, &argv);
|
||||
MPI_Comm comm = MPI_COMM_WORLD;
|
||||
int comm_size = 1;
|
||||
MPI_Comm_size (comm, &comm_size);
|
||||
int comm_rank = 0;
|
||||
MPI_Comm_rank (comm, &comm_rank);
|
||||
H5AbortOnError ();
|
||||
|
||||
@@ -11,7 +11,10 @@ include 'H5hut.f90'
|
||||
program read_core_vfd
|
||||
use H5hut
|
||||
implicit none
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
include 'mpif.h'
|
||||
#endif
|
||||
|
||||
! name of input file
|
||||
character (len=*), parameter :: fname = "example_core_vfd.h5"
|
||||
@@ -19,8 +22,6 @@ program read_core_vfd
|
||||
! H5hut verbosity level
|
||||
integer*8, parameter :: h5_verbosity = H5_VERBOSE_DEFAULT
|
||||
|
||||
|
||||
integer :: comm, comm_size, comm_rank, mpi_ierror
|
||||
integer*8 :: file, h5_ierror
|
||||
integer*8 :: prop
|
||||
integer*8 :: num_particles
|
||||
@@ -28,10 +29,13 @@ program read_core_vfd
|
||||
integer*4, allocatable :: data(:)
|
||||
|
||||
! initialize MPI & H5hut
|
||||
integer :: comm_rank = 0
|
||||
#if defined(PARALLEL_IO)
|
||||
integer :: comm, mpi_ierror
|
||||
comm = MPI_COMM_WORLD
|
||||
call mpi_init (mpi_ierror)
|
||||
call mpi_comm_size (comm, comm_size, mpi_ierror)
|
||||
call mpi_comm_rank (comm, comm_rank, mpi_ierror)
|
||||
#endif
|
||||
call h5_abort_on_error ()
|
||||
call h5_set_verbosity_level (h5_verbosity)
|
||||
|
||||
@@ -57,6 +61,9 @@ program read_core_vfd
|
||||
! cleanup
|
||||
deallocate (data)
|
||||
h5_ierror = h5_closefile (file)
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
call mpi_finalize (mpi_ierror)
|
||||
#endif
|
||||
|
||||
end program read_core_vfd
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "H5hut.h"
|
||||
#include "examples.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
@@ -11,7 +11,10 @@ include 'H5hut.f90'
|
||||
program read_setnparticles
|
||||
use H5hut
|
||||
implicit none
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
include 'mpif.h'
|
||||
#endif
|
||||
|
||||
! name of input file
|
||||
character (len=*), parameter :: fname = "example_setnparticles.h5"
|
||||
@@ -19,17 +22,21 @@ program read_setnparticles
|
||||
! H5hut verbosity level
|
||||
integer*8, parameter :: h5_verbosity = H5_VERBOSE_DEFAULT
|
||||
|
||||
integer :: comm, comm_size, comm_rank, mpi_ierror
|
||||
integer :: comm_size = 1
|
||||
integer :: comm_rank = 0
|
||||
integer*8 :: file, h5_ierror
|
||||
integer*8 :: num_particles, num_particles_total
|
||||
integer*8 :: i
|
||||
integer*4, allocatable :: data(:)
|
||||
|
||||
! initialize MPI & H5hut
|
||||
#if defined(PARALLEL_IO)
|
||||
integer :: comm, mpi_ierror
|
||||
comm = MPI_COMM_WORLD
|
||||
call mpi_init (mpi_ierror)
|
||||
call mpi_comm_size (comm, comm_size, mpi_ierror)
|
||||
call mpi_comm_rank (comm, comm_rank, mpi_ierror)
|
||||
#endif
|
||||
call h5_abort_on_error ()
|
||||
call h5_set_verbosity_level (h5_verbosity)
|
||||
|
||||
@@ -61,6 +68,9 @@ program read_setnparticles
|
||||
! cleanup
|
||||
deallocate (data)
|
||||
h5_ierror = h5_closefile (file)
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
call mpi_finalize (mpi_ierror)
|
||||
#endif
|
||||
|
||||
end program read_setnparticles
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "H5hut.h"
|
||||
#include "examples.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
@@ -11,25 +11,32 @@ include 'H5hut.f90'
|
||||
program read_setviewf
|
||||
use H5hut
|
||||
implicit none
|
||||
#if defined(PARALLEL_IO)
|
||||
include 'mpif.h'
|
||||
|
||||
#endif
|
||||
|
||||
! name of input file
|
||||
character (len=*), parameter :: fname = "example_setview.h5"
|
||||
|
||||
! H5hut verbosity level
|
||||
integer*8, parameter :: h5_verbosity = H5_VERBOSE_DEFAULT
|
||||
|
||||
integer :: comm, comm_size, comm_rank, mpi_ierror
|
||||
integer :: comm_size = 1
|
||||
integer :: comm_rank = 0
|
||||
integer*8 :: file, h5_ierror
|
||||
integer*8 :: num_particles, num_particles_total
|
||||
integer*8 :: i, start, end, remainder
|
||||
integer*4, allocatable :: data(:)
|
||||
|
||||
! initialize MPI & H5hut
|
||||
#if defined(PARALLEL_IO)
|
||||
integer :: comm, mpi_ierror
|
||||
comm = MPI_COMM_WORLD
|
||||
call mpi_init (mpi_ierror)
|
||||
call mpi_comm_size (comm, comm_size, mpi_ierror)
|
||||
call mpi_comm_rank (comm, comm_rank, mpi_ierror)
|
||||
#endif
|
||||
|
||||
call h5_abort_on_error ()
|
||||
call h5_set_verbosity_level (h5_verbosity)
|
||||
|
||||
@@ -78,6 +85,9 @@ program read_setviewf
|
||||
! cleanup
|
||||
deallocate (data)
|
||||
h5_ierror = h5_closefile (file)
|
||||
call mpi_finalize (mpi_ierror)
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
call mpi_finalize (mpi_ierror)
|
||||
#endif
|
||||
|
||||
end program read_setviewf
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "H5hut.h"
|
||||
#include "examples.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
@@ -11,24 +11,33 @@ include 'H5hut.f90'
|
||||
program read_stridedf
|
||||
use H5hut
|
||||
implicit none
|
||||
#if defined(PARALLEL_IO)
|
||||
include 'mpif.h'
|
||||
#endif
|
||||
|
||||
! name of input file
|
||||
character (len=*), parameter :: fname = "example_strided.h5"
|
||||
|
||||
! H5hut verbosity level
|
||||
integer*8, parameter :: h5_verbosity = H5_VERBOSE_DEFAULT
|
||||
|
||||
integer :: comm, comm_size, comm_rank, mpi_ierror
|
||||
integer*8 :: file, h5_ierror
|
||||
integer*8 :: num_particles, num_particles_total
|
||||
real*8, allocatable :: data(:)
|
||||
integer*8 :: i, start
|
||||
|
||||
! initialize MPI & H5hut
|
||||
#if defined(PARALLEL_IO)
|
||||
integer :: comm, comm_size, comm_rank, mpi_ierror
|
||||
comm = MPI_COMM_WORLD
|
||||
call mpi_init (mpi_error)
|
||||
call mpi_comm_size (comm, comm_size, mpi_ierror)
|
||||
call mpi_comm_rank (comm, comm_rank, mpi_ierror)
|
||||
#else
|
||||
integer :: comm_size = 1
|
||||
integer :: comm_rank = 0
|
||||
#endif
|
||||
|
||||
call h5_abort_on_error ()
|
||||
call h5_set_verbosity_level (h5_verbosity)
|
||||
|
||||
@@ -68,6 +77,9 @@ program read_stridedf
|
||||
! cleanup
|
||||
deallocate (data)
|
||||
h5_ierror = h5_closefile (file)
|
||||
call mpi_finalize (mpi_ierror)
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
call mpi_finalize (mpi_ierror)
|
||||
#endif
|
||||
|
||||
end program read_stridedf
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
the VFD core driver.
|
||||
*/
|
||||
#include "H5hut.h"
|
||||
#include "examples.h"
|
||||
|
||||
// name of output file
|
||||
const char* fname = "example_core_vfd.h5";
|
||||
@@ -33,8 +34,6 @@ main (
|
||||
// initialize MPI & H5hut
|
||||
MPI_Init (&argc, &argv);
|
||||
MPI_Comm comm = MPI_COMM_WORLD;
|
||||
int comm_size = 1;
|
||||
MPI_Comm_size (comm, &comm_size);
|
||||
int comm_rank = 0;
|
||||
MPI_Comm_rank (comm, &comm_rank);
|
||||
H5AbortOnError ();
|
||||
|
||||
@@ -11,8 +11,11 @@ include 'H5hut.f90'
|
||||
program write_core_vfd
|
||||
use H5hut
|
||||
implicit none
|
||||
include 'mpif.h'
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
include 'mpif.h'
|
||||
#endif
|
||||
|
||||
! name of output file
|
||||
character (len=*), parameter :: fname = "example_core_vfd.h5"
|
||||
|
||||
@@ -22,17 +25,20 @@ program write_core_vfd
|
||||
! number of particles we are going to write per core
|
||||
integer*4, parameter :: num_particles = 32
|
||||
|
||||
integer :: comm, comm_size, comm_rank, mpi_ierror
|
||||
integer :: comm_rank = 0
|
||||
integer*8 :: file, h5_ierror
|
||||
integer*8 :: prop
|
||||
integer*4 :: i
|
||||
integer*4, allocatable :: data(:)
|
||||
|
||||
! initialize MPI & H5hut
|
||||
#if defined(PARALLEL_IO)
|
||||
integer :: comm, mpi_ierror
|
||||
comm = MPI_COMM_WORLD
|
||||
call mpi_init (mpi_ierror)
|
||||
call mpi_comm_size (comm, comm_size, mpi_ierror)
|
||||
call mpi_comm_rank (comm, comm_rank, mpi_ierror)
|
||||
#endif
|
||||
|
||||
call h5_abort_on_error ()
|
||||
call h5_set_verbosity_level (h5_verbosity)
|
||||
|
||||
@@ -57,6 +63,9 @@ program write_core_vfd
|
||||
! cleanup
|
||||
deallocate (data)
|
||||
h5_ierror = h5_closefile (file)
|
||||
call mpi_finalize (mpi_ierror)
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
call mpi_finalize (mpi_ierror)
|
||||
#endif
|
||||
|
||||
end program write_core_vfd
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "H5hut.h"
|
||||
#include "examples.h"
|
||||
|
||||
// name of output file
|
||||
const char* fname = "example_setnparticles.h5";
|
||||
@@ -27,8 +28,6 @@ main (
|
||||
// initialize MPI & H5hut
|
||||
MPI_Init (&argc, &argv);
|
||||
MPI_Comm comm = MPI_COMM_WORLD;
|
||||
int comm_size = 1;
|
||||
MPI_Comm_size (comm, &comm_size);
|
||||
int comm_rank = 0;
|
||||
MPI_Comm_rank (comm, &comm_rank);
|
||||
H5AbortOnError ();
|
||||
|
||||
@@ -11,8 +11,10 @@ include 'H5hut.f90'
|
||||
program write_setnparticles
|
||||
use H5hut
|
||||
implicit none
|
||||
include 'mpif.h'
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
include 'mpif.h'
|
||||
#endif
|
||||
|
||||
! name of output file
|
||||
character (len=*), parameter :: fname = "example_setnparticles.h5"
|
||||
@@ -23,16 +25,19 @@ program write_setnparticles
|
||||
! number of particles we are going to write per core
|
||||
integer*8, parameter :: num_particles = 32
|
||||
|
||||
integer :: comm, comm_size, comm_rank, mpi_ierror
|
||||
integer :: comm_rank = 0
|
||||
integer*8 :: file, h5_ierror
|
||||
integer*4 :: i
|
||||
integer*4, allocatable :: data(:)
|
||||
|
||||
! initialize MPI & H5hut
|
||||
#if defined(PARALLEL_IO)
|
||||
integer :: comm, mpi_ierror
|
||||
comm = MPI_COMM_WORLD
|
||||
call mpi_init (mpi_ierror)
|
||||
call mpi_comm_size (comm, comm_size, mpi_ierror)
|
||||
call mpi_comm_rank (comm, comm_rank, mpi_ierror)
|
||||
#endif
|
||||
|
||||
call h5_abort_on_error ()
|
||||
call h5_set_verbosity_level (h5_verbosity)
|
||||
|
||||
@@ -55,6 +60,9 @@ program write_setnparticles
|
||||
! cleanup
|
||||
deallocate (data)
|
||||
h5_ierror = h5_closefile (file)
|
||||
call mpi_finalize (mpi_ierror)
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
call mpi_finalize (mpi_ierror)
|
||||
#endif
|
||||
|
||||
end program write_setnparticles
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "H5hut.h"
|
||||
#include "examples.h"
|
||||
|
||||
// name of output file
|
||||
const char* fname = "example_setview.h5";
|
||||
@@ -28,8 +29,6 @@ main (
|
||||
// initialize MPI & H5hut
|
||||
MPI_Init (&argc, &argv);
|
||||
MPI_Comm comm = MPI_COMM_WORLD;
|
||||
int comm_size = 1;
|
||||
MPI_Comm_size (comm, &comm_size);
|
||||
int comm_rank = 0;
|
||||
MPI_Comm_rank (comm, &comm_rank);
|
||||
H5AbortOnError ();
|
||||
|
||||
@@ -11,8 +11,11 @@ include 'H5hut.f90'
|
||||
program write_setview
|
||||
use H5hut
|
||||
implicit none
|
||||
include 'mpif.h'
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
include 'mpif.h'
|
||||
#endif
|
||||
|
||||
! name of output file
|
||||
character (len=*), parameter :: fname = "example_setview.h5"
|
||||
|
||||
@@ -23,16 +26,19 @@ program write_setview
|
||||
integer*8, parameter :: num_blocks = 4;
|
||||
integer*8, parameter :: num_particles_per_block = 32
|
||||
|
||||
integer :: comm, comm_size, comm_rank, mpi_ierror
|
||||
integer :: comm_rank = 0
|
||||
integer*8 :: file, h5_ierror
|
||||
integer*8 :: i, j, offset
|
||||
integer*4, allocatable :: data(:)
|
||||
|
||||
! initialize MPI & H5hut
|
||||
#if defined(PARALLEL_IO)
|
||||
integer :: comm, mpi_ierror
|
||||
comm = MPI_COMM_WORLD
|
||||
call mpi_init (mpi_ierror)
|
||||
call mpi_comm_size (comm, comm_size, mpi_ierror)
|
||||
call mpi_comm_rank (comm, comm_rank, mpi_ierror)
|
||||
#endif
|
||||
|
||||
call h5_abort_on_error ()
|
||||
call h5_set_verbosity_level (h5_verbosity)
|
||||
|
||||
@@ -61,6 +67,9 @@ program write_setview
|
||||
! cleanup
|
||||
deallocate (data)
|
||||
h5_ierror = h5_closefile (file)
|
||||
call mpi_finalize (mpi_ierror)
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
call mpi_finalize (mpi_ierror)
|
||||
#endif
|
||||
|
||||
end program write_setview
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "H5hut.h"
|
||||
#include "examples.h"
|
||||
|
||||
// name of output file
|
||||
const char* fname = "example_strided.h5";
|
||||
@@ -27,8 +28,6 @@ main (
|
||||
// initialize MPI & H5hut
|
||||
MPI_Init (&argc, &argv);
|
||||
MPI_Comm comm = MPI_COMM_WORLD;
|
||||
int comm_size = 1;
|
||||
MPI_Comm_size (comm, &comm_size);
|
||||
int comm_rank = 0;
|
||||
MPI_Comm_rank (comm, &comm_rank);
|
||||
H5AbortOnError ();
|
||||
|
||||
@@ -11,22 +11,29 @@ include 'H5hut.f90'
|
||||
program write_stridedf
|
||||
use H5hut
|
||||
implicit none
|
||||
include 'mpif.h'
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
include 'mpif.h'
|
||||
#endif
|
||||
|
||||
! the file name we want to read
|
||||
character (len=*), parameter :: FNAME = "example_strided.h5"
|
||||
integer*8, parameter :: NPOINTS = 99
|
||||
|
||||
integer :: comm, rank, ierr
|
||||
integer :: rank = 0
|
||||
integer*8 :: file, status
|
||||
integer*4 :: i
|
||||
real*8, allocatable :: particles(:)
|
||||
integer*8, allocatable :: id(:)
|
||||
|
||||
! init MPI & H5hut
|
||||
#if defined(PARALLEL_IO)
|
||||
integer :: comm, ierr
|
||||
comm = MPI_COMM_WORLD
|
||||
call mpi_init(ierr)
|
||||
call mpi_comm_rank(comm, rank, ierr)
|
||||
#endif
|
||||
|
||||
call h5_abort_on_error ()
|
||||
|
||||
! create fake data
|
||||
@@ -66,6 +73,8 @@ program write_stridedf
|
||||
|
||||
deallocate(particles, id)
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
call mpi_finalize(ierr)
|
||||
#endif
|
||||
|
||||
end program write_stridedf
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
#ifndef PARALLEL_IO
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef __EXAMPLES_H
|
||||
#define __EXAMPLES_H
|
||||
|
||||
#if !defined (H5_HAVE_PARALLEL)
|
||||
|
||||
#define MPI_COMM_WORLD (0)
|
||||
#define MPI_Init(argc, argv)
|
||||
#define MPI_Comm_size(comm,nprocs) {comm = 0; *nprocs = 1;}
|
||||
#define MPI_Comm_rank(comm,rank) {comm = 0; (void)(comm); *rank = 0;}
|
||||
#define MPI_Finalize()
|
||||
|
||||
#endif
|
||||
#endif
|
||||
+2
-2
@@ -25,7 +25,7 @@ h5_createprop_file (
|
||||
H5_API_RETURN ((h5_int64_t)h5_create_prop (H5_PROP_FILE));
|
||||
}
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
#if defined(H5_HAVE_PARALLEL)
|
||||
#define h5_setprop_file_mpio FC_MANGLING( \
|
||||
h5_setprop_file_mpio, \
|
||||
H5_SETPROP_FILE_MPIO)
|
||||
@@ -233,7 +233,7 @@ h5_finalize (
|
||||
void
|
||||
) {
|
||||
H5_API_ENTER (h5_int64_t, "%s", "");
|
||||
H5_API_RETURN (h5_close_hdf5());
|
||||
H5_API_RETURN (h5_close_h5hut ());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ h5bl_3d_getchunk (
|
||||
}
|
||||
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
#if defined(H5_HAVE_PARALLEL)
|
||||
#define h5bl_3d_setgrid FC_MANGLING ( \
|
||||
h5bl_3d_setgrid, \
|
||||
h5bl_3d_setgrid)
|
||||
|
||||
+3
-1
@@ -11,6 +11,8 @@
|
||||
#include "h5core/h5_err.h"
|
||||
#include "private/h5_init.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static h5_errorhandler_t h5_errhandler = h5_report_errorhandler;
|
||||
h5_err_t h5_errno;
|
||||
|
||||
@@ -143,7 +145,7 @@ h5_abort_errorhandler (
|
||||
if (h5_log_level > 0) {
|
||||
h5_verror (fmt, ap);
|
||||
}
|
||||
#ifdef PARALLEL_IO
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
MPI_Abort(MPI_COMM_WORLD, -(int)h5_errno);
|
||||
#else
|
||||
exit (-(int)h5_errno);
|
||||
|
||||
+30
-7
@@ -80,7 +80,7 @@ mpi_init (
|
||||
const h5_file_p f
|
||||
) {
|
||||
H5_INLINE_FUNC_ENTER (h5_err_t);
|
||||
#ifdef PARALLEL_IO
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
TRY (h5priv_mpi_comm_size (f->props->comm, &f->nprocs));
|
||||
TRY (h5priv_mpi_comm_rank (f->props->comm, &f->myproc));
|
||||
|
||||
@@ -141,7 +141,7 @@ mpi_init (
|
||||
TRY (h5_optimize_for_lustre(f, filename));
|
||||
}
|
||||
#endif
|
||||
#endif /* PARALLEL_IO */
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -181,7 +181,9 @@ set_default_file_props (
|
||||
H5_STEPNAME,
|
||||
H5_STEPNAME_LEN - 1);
|
||||
props->width_step_idx = H5_STEPWIDTH;
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
props->comm = MPI_COMM_WORLD;
|
||||
#endif
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -199,6 +201,7 @@ h5_set_prop_file_mpio_collective (
|
||||
"Invalid property class: %lld",
|
||||
(long long int)props->class);
|
||||
}
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
props->flags &= ~(H5_VFD_MPIO_POSIX | H5_VFD_MPIO_INDEPENDENT | H5_VFD_CORE);
|
||||
props->flags |= H5_VFD_MPIO_COLLECTIVE;
|
||||
props->comm = *comm;
|
||||
@@ -206,7 +209,9 @@ h5_set_prop_file_mpio_collective (
|
||||
h5_warn ("Throttling is not permitted with collective VFD. Reset throttling.");
|
||||
props->throttle = 0;
|
||||
}
|
||||
|
||||
#else
|
||||
h5_info ("Setting MPIO collective property ignored in serial H5hut");
|
||||
#endif
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -224,9 +229,13 @@ h5_set_prop_file_mpio_independent (
|
||||
"Invalid property class: %lld",
|
||||
(long long int)props->class);
|
||||
}
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
props->flags &= ~(H5_VFD_MPIO_COLLECTIVE | H5_VFD_MPIO_POSIX | H5_VFD_CORE);
|
||||
props->flags |= H5_VFD_MPIO_INDEPENDENT;
|
||||
props->comm = *comm;
|
||||
#else
|
||||
h5_info ("Setting MPIO independent property ignored in serial H5hut");
|
||||
#endif
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -245,9 +254,13 @@ h5_set_prop_file_mpio_posix (
|
||||
"Invalid property class: %lld",
|
||||
(long long int)props->class);
|
||||
}
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
props->flags &= ~(H5_VFD_MPIO_COLLECTIVE | H5_VFD_MPIO_POSIX | H5_VFD_CORE);
|
||||
props->flags |= H5_VFD_MPIO_INDEPENDENT;
|
||||
props->comm = *comm;
|
||||
#else
|
||||
h5_info ("Setting MPIO POSIX property ignored in serial H5hut");
|
||||
#endif
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
#endif
|
||||
@@ -266,6 +279,7 @@ h5_set_prop_file_core_vfd (
|
||||
"Invalid property class: %lld",
|
||||
(long long int)props->class);
|
||||
}
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
props->flags &= ~(H5_VFD_MPIO_COLLECTIVE | H5_VFD_MPIO_INDEPENDENT | H5_VFD_MPIO_POSIX);
|
||||
props->flags |= H5_VFD_MPIO_INDEPENDENT;
|
||||
props->comm = MPI_COMM_SELF;
|
||||
@@ -274,6 +288,9 @@ h5_set_prop_file_core_vfd (
|
||||
h5_warn ("Throttling is not permitted with core VFD. Reset throttling.");
|
||||
props->throttle = 0;
|
||||
}
|
||||
#else
|
||||
h5_info ("Setting MPIO core property ignored in serial H5hut");
|
||||
#endif
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -335,6 +352,7 @@ h5_set_prop_file_throttle (
|
||||
"Invalid property class: %lld",
|
||||
(long long int)props->class);
|
||||
}
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
// throttle only if VFD is MPIO independent od POSIX
|
||||
h5_int64_t mask = H5_VFD_MPIO_INDEPENDENT;
|
||||
#if H5_VERSION_LE(1,8,12)
|
||||
@@ -354,6 +372,9 @@ h5_set_prop_file_throttle (
|
||||
}
|
||||
|
||||
props->throttle = throttle;
|
||||
#else
|
||||
h5_info ("Setting the throttle property in serial H5hut");
|
||||
#endif
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -489,7 +510,6 @@ h5_open_file2 (
|
||||
TRY (f = h5_calloc (1, sizeof (*f)));
|
||||
|
||||
TRY (f->props = (h5_prop_file_t*)h5_create_prop (H5_PROP_FILE));
|
||||
TRY (set_default_file_props (f->props));
|
||||
|
||||
if (props != H5_PROP_DEFAULT) {
|
||||
if (props->class != H5_PROP_FILE) {
|
||||
@@ -498,7 +518,9 @@ h5_open_file2 (
|
||||
"Invalid property class: %lld.",
|
||||
(long long int)props->class);
|
||||
}
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
f->props->comm = props->comm;
|
||||
#endif
|
||||
f->props->flags = props->flags;
|
||||
f->props->throttle = props->throttle;
|
||||
f->props->align = props->align;
|
||||
@@ -591,12 +613,13 @@ h5_close_file (
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5_close_hdf5 (
|
||||
h5_close_h5hut (
|
||||
void
|
||||
) {
|
||||
H5_CORE_API_ENTER (h5_err_t, "%s", "");
|
||||
TRY (ret_value = hdf5_close ());
|
||||
H5_RETURN (ret_value);
|
||||
TRY (h5priv_finalize ());
|
||||
TRY (hdf5_close ());
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
|
||||
+23
-23
@@ -15,29 +15,29 @@ h5_int32_t h5_log_level = H5_VERBOSE_ERROR;
|
||||
struct call_stack h5_call_stack;
|
||||
|
||||
char *h5_rfmts[] = {
|
||||
[e_int] "%d",
|
||||
[e_ssize_t] "%ld",
|
||||
[e_char_p] "%s",
|
||||
[e_void_p] "%p",
|
||||
[e_h5_err_t] "%lld",
|
||||
[e_h5_int64_t] "%lld",
|
||||
[e_h5_id_t] "%lld",
|
||||
[e_h5_ssize_t] "%lld",
|
||||
[e_h5_errorhandler_t] "%p",
|
||||
[e_h5_file_p] "%p",
|
||||
[e_h5_file_t] "0x%08x",
|
||||
[e_h5_lvl_idx_t] "%d",
|
||||
[e_h5t_iterator_p] "%p",
|
||||
[e_h5_loc_id_t] "%ld",
|
||||
[e_h5_loc_idx_t] "%ld",
|
||||
[e_hid_t] "%lld",
|
||||
[e_H5O_type_t] "%ld",
|
||||
[e_h5_glb_elem_p] "%p",
|
||||
[e_h5_prop_p] "%p",
|
||||
[e_h5_prop_t] "0x%08x",
|
||||
[e_h5_prop_file_p] "%p",
|
||||
[e_h5_prop_file_t] "0x%08x",
|
||||
[e_herr_t] "%ld"
|
||||
[e_int] = "%d",
|
||||
[e_ssize_t] = "%ld",
|
||||
[e_char_p] = "%s",
|
||||
[e_void_p] = "%p",
|
||||
[e_h5_err_t] = "%lld",
|
||||
[e_h5_int64_t] = "%lld",
|
||||
[e_h5_id_t] = "%lld",
|
||||
[e_h5_ssize_t] = "%lld",
|
||||
[e_h5_errorhandler_t] = "%p",
|
||||
[e_h5_file_p] = "%p",
|
||||
[e_h5_file_t] = "0x%08x",
|
||||
[e_h5_lvl_idx_t] = "%d",
|
||||
[e_h5t_iterator_p] = "%p",
|
||||
[e_h5_loc_id_t] = "%ld",
|
||||
[e_h5_loc_idx_t] = "%ld",
|
||||
[e_hid_t] = "%lld",
|
||||
[e_H5O_type_t] = "%ld",
|
||||
[e_h5_glb_elem_p] = "%p",
|
||||
[e_h5_prop_p] = "%p",
|
||||
[e_h5_prop_t] = "0x%08x",
|
||||
[e_h5_prop_file_p] = "%p",
|
||||
[e_h5_prop_file_t] = "0x%08x",
|
||||
[e_herr_t] = "%ld"
|
||||
};
|
||||
|
||||
/*!
|
||||
|
||||
+2
-2
@@ -47,7 +47,7 @@ h5bpriv_open_file (
|
||||
b = f->b;
|
||||
memset (b, 0, sizeof (*b));
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
size_t n = sizeof (struct h5b_partition) / sizeof (h5_int64_t);
|
||||
TRY (h5priv_mpi_type_contiguous(n, MPI_LONG_LONG, &b->partition_mpi_t));
|
||||
#endif
|
||||
@@ -88,7 +88,7 @@ h5bpriv_close_file (
|
||||
TRY (hdf5_close_dataspace (b->diskshape));
|
||||
TRY (hdf5_close_dataspace (b->memshape));
|
||||
TRY (hdf5_close_property (b->dcreate_prop));
|
||||
#if defined(PARALLEL_IO)
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
TRY (h5priv_mpi_type_free (&b->partition_mpi_t));
|
||||
#endif
|
||||
TRY (h5_free (f->b));
|
||||
|
||||
+16
-8
@@ -74,7 +74,7 @@ _normalize_partition (
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
/* MLH: this could be improved with an MPI_Reduce and MAX operator...
|
||||
* but the user_layout array-of-structs would need to be a struct-of-arrays */
|
||||
static void
|
||||
@@ -571,7 +571,7 @@ h5b_3d_set_view (
|
||||
b->user_layout[0].k_end = k_end;
|
||||
_normalize_partition(&b->user_layout[0]);
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
h5b_partition_t *user_layout;
|
||||
h5b_partition_t *write_layout;
|
||||
|
||||
@@ -762,7 +762,6 @@ h5b_3d_get_chunk (
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
h5_err_t
|
||||
h5b_3d_set_grid (
|
||||
const h5_file_t fh, /*!< IN: File handle */
|
||||
@@ -796,11 +795,13 @@ h5b_3d_set_grid (
|
||||
|
||||
int dims[3] = { k, j, i };
|
||||
int period[3] = { 0, 0, 0 };
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
TRY( h5priv_mpi_cart_create(
|
||||
f->props->comm, 3, dims, period, 0, &f->b->cart_comm) );
|
||||
|
||||
#else
|
||||
h5_warn ("Defining a grid in serial case doesn't make much sense!");
|
||||
#endif
|
||||
f->b->have_grid = 1;
|
||||
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -824,11 +825,16 @@ h5b_3d_get_grid_coords (
|
||||
"%s",
|
||||
"Grid dimensions have not been set!");
|
||||
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
int coords[3];
|
||||
TRY( h5priv_mpi_cart_coords(f->b->cart_comm, proc, 3, coords) );
|
||||
*k = coords[0];
|
||||
*j = coords[1];
|
||||
*i = coords[2];
|
||||
#else
|
||||
*k = *j = *i = 1;
|
||||
h5_warn ("Defining grid in serial case doesn't make much sense!");
|
||||
#endif
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -855,11 +861,14 @@ h5b_3d_set_dims (
|
||||
"Grid dimensions have not been set!");
|
||||
|
||||
h5_size_t dims[3] = { k, j, i };
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
h5_size_t check_dims[3] = { k, j, i };
|
||||
|
||||
TRY( h5priv_mpi_bcast(
|
||||
check_dims, 3, MPI_LONG_LONG, 0, f->props->comm) );
|
||||
|
||||
#else
|
||||
h5_size_t check_dims[3] = { 1, 1, 1 };
|
||||
h5_warn ("Defining grid in serial case doesn't make much sense!");
|
||||
#endif
|
||||
if ( dims[0] != check_dims[0] ||
|
||||
dims[1] != check_dims[1] ||
|
||||
dims[2] != check_dims[2]
|
||||
@@ -899,7 +908,6 @@ h5b_3d_set_dims (
|
||||
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5b_3d_set_halo (
|
||||
|
||||
@@ -691,8 +691,9 @@ rebuild_map_elem_g2l (
|
||||
Rebuild mapping of global element indices to their local indices.
|
||||
*/
|
||||
static h5_err_t
|
||||
rebuild_map_elem_g2l_partial ( // we need that to update map for the refined elems before we have the
|
||||
// refined elements from the other proces
|
||||
rebuild_map_elem_g2l_partial (
|
||||
// we need that to update map for the refined elems before we have the
|
||||
// refined elements from the other proces
|
||||
h5t_mesh_t* const m
|
||||
) {
|
||||
H5_PRIV_FUNC_ENTER (h5_err_t, "m=%p", m);
|
||||
|
||||
+7
-13
@@ -130,13 +130,7 @@ h5u_set_num_points (
|
||||
hsize_t start;
|
||||
hsize_t dmax = H5S_UNLIMITED;
|
||||
|
||||
if (nparticles < 0)
|
||||
H5_RETURN_ERROR (
|
||||
H5_ERR_INVAL,
|
||||
"Invalid number of particles: %lld!\n",
|
||||
(long long)nparticles);
|
||||
|
||||
#ifndef PARALLEL_IO
|
||||
#ifndef H5_HAVE_PARALLEL
|
||||
/*
|
||||
if we are not using parallel-IO, there is enough information
|
||||
to know that we can short circuit this routine. However,
|
||||
@@ -174,12 +168,12 @@ h5u_set_num_points (
|
||||
NULL));
|
||||
}
|
||||
|
||||
#ifndef PARALLEL_IO
|
||||
#ifndef H5_HAVE_PARALLEL
|
||||
count = u->nparticles;
|
||||
TRY( u->shape = hdf5_create_dataspace (1, &count, NULL));
|
||||
u->viewstart = 0;
|
||||
u->viewend = nparticles - 1; // view range is *inclusive*
|
||||
#else /* PARALLEL_IO */
|
||||
#else /* H5_HAVE_PARALLEL */
|
||||
/*
|
||||
The Gameplan here is to declare the overall size of the on-disk
|
||||
data structure the same way we do for the serial case. But
|
||||
@@ -231,7 +225,7 @@ h5u_set_num_points (
|
||||
|
||||
h5_err_t
|
||||
h5u_has_view (
|
||||
const const h5_file_t fh
|
||||
const h5_file_t fh
|
||||
) {
|
||||
h5_file_p f = (h5_file_p)fh;
|
||||
H5_CORE_API_ENTER (h5_ssize_t, "f=%p", f);
|
||||
@@ -317,7 +311,7 @@ h5u_set_view (
|
||||
(long long)end,
|
||||
(long long)start);
|
||||
}
|
||||
#if PARALLEL_IO
|
||||
#if H5_HAVE_PARALLEL
|
||||
TRY (
|
||||
h5priv_mpi_allreduce_max (
|
||||
&end, &total, 1, MPI_LONG_LONG, f->props->comm)
|
||||
@@ -575,7 +569,7 @@ h5u_set_canonical_view (
|
||||
|
||||
u->nparticles = total / f->nprocs;
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
h5_int64_t remainder = 0;
|
||||
remainder = total % f->nprocs;
|
||||
start = f->myproc * u->nparticles;
|
||||
@@ -588,7 +582,7 @@ h5u_set_canonical_view (
|
||||
start += f->myproc;
|
||||
else
|
||||
start += remainder;
|
||||
#endif // PARALLEL_IO
|
||||
#endif // H5_HAVE_PARALLEL
|
||||
|
||||
h5_int64_t length = u->nparticles;
|
||||
TRY (h5u_set_view_length (fh, start, length));
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
h5_err_t
|
||||
h5priv_link_exists_ (
|
||||
const hid_t loc_id,
|
||||
const char const* path[],
|
||||
const char *const path[],
|
||||
size_t size
|
||||
) {
|
||||
H5_PRIV_FUNC_ENTER (h5_err_t,
|
||||
|
||||
@@ -163,12 +163,12 @@ hdf5_create_group (
|
||||
h5_err_t
|
||||
h5priv_link_exists_ (
|
||||
const hid_t loc_id,
|
||||
const char const* path[],
|
||||
const char *const path[],
|
||||
size_t size
|
||||
);
|
||||
#define h5priv_link_exists(loc_id, ...) \
|
||||
(h5priv_link_exists_ (loc_id, \
|
||||
(const char const*[]){__VA_ARGS__}, \
|
||||
(const char *const[]){__VA_ARGS__}, \
|
||||
PP_NARG(__VA_ARGS__)))
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ hdf5_close_group (
|
||||
static inline hid_t
|
||||
h5priv_create_group (
|
||||
const hid_t loc_id,
|
||||
const char const* group_name
|
||||
const char *const group_name
|
||||
) {
|
||||
H5_PRIV_FUNC_ENTER (hid_t,
|
||||
"loc_id=%lld, (%s), group_name=%s",
|
||||
@@ -214,7 +214,7 @@ h5priv_create_group (
|
||||
static inline hid_t
|
||||
h5priv_open_group (
|
||||
const hid_t loc_id,
|
||||
const char const* group_name
|
||||
const char *const group_name
|
||||
) {
|
||||
H5_PRIV_FUNC_ENTER (hid_t,
|
||||
"loc_id=%lld, (%s), group_name=%s",
|
||||
@@ -809,17 +809,17 @@ get_class_type_name (
|
||||
const hid_t class_id
|
||||
) {
|
||||
const char* const map[] = {
|
||||
[H5T_INTEGER] "H5T_INTEGER",
|
||||
[H5T_FLOAT] "H5T_FLOAT",
|
||||
[H5T_TIME] "H5T_TIME",
|
||||
[H5T_STRING] "H5T_STRING",
|
||||
[H5T_BITFIELD] "H5T_BITFIELD",
|
||||
[H5T_OPAQUE] "H5T_OPAQUE",
|
||||
[H5T_COMPOUND] "H5T_COMPOUND",
|
||||
[H5T_REFERENCE] "H5T_REFERENCE",
|
||||
[H5T_ENUM] "H5T_ENUM",
|
||||
[H5T_VLEN] "H5T_VLEN",
|
||||
[H5T_ARRAY] "H5T_ARRAY"
|
||||
[H5T_INTEGER] = "H5T_INTEGER",
|
||||
[H5T_FLOAT] = "H5T_FLOAT",
|
||||
[H5T_TIME] = "H5T_TIME",
|
||||
[H5T_STRING] = "H5T_STRING",
|
||||
[H5T_BITFIELD] = "H5T_BITFIELD",
|
||||
[H5T_OPAQUE] = "H5T_OPAQUE",
|
||||
[H5T_COMPOUND] = "H5T_COMPOUND",
|
||||
[H5T_REFERENCE] = "H5T_REFERENCE",
|
||||
[H5T_ENUM] = "H5T_ENUM",
|
||||
[H5T_VLEN] = "H5T_VLEN",
|
||||
[H5T_ARRAY] = "H5T_ARRAY"
|
||||
};
|
||||
if (class_id < 0 || class_id >= H5T_NCLASSES) {
|
||||
return ("[unknown]");
|
||||
@@ -1048,7 +1048,7 @@ hdf5_set_layout_property (
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
static inline h5_err_t
|
||||
hdf5_set_fapl_mpio_property (
|
||||
hid_t fapl_id,
|
||||
|
||||
@@ -69,6 +69,19 @@ create_array_types (
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
close_array_types (
|
||||
void
|
||||
) {
|
||||
H5_PRIV_FUNC_ENTER (h5_err_t, "%s", "void");
|
||||
TRY (hdf5_close_type (h5_dta_types.h5_coord3d_t));
|
||||
TRY (hdf5_close_type (h5_dta_types.h5_3glb_idx_t));
|
||||
TRY (hdf5_close_type (h5_dta_types.h5_4glb_idx_t));
|
||||
TRY (hdf5_close_type (h5_dta_types.h5_4chk_idx_t));
|
||||
TRY (hdf5_close_type (h5_dta_types.h5_coord6d_t));
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
create_vertex_type (
|
||||
void
|
||||
@@ -95,6 +108,16 @@ create_vertex_type (
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
close_vertex_type (
|
||||
void
|
||||
) {
|
||||
H5_PRIV_FUNC_ENTER (h5_err_t, "%s", "void");
|
||||
TRY (hdf5_close_type (h5_dta_types.h5_vertex_t));
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
static inline h5_err_t
|
||||
create_triangle_type (
|
||||
void
|
||||
@@ -158,7 +181,16 @@ create_triangle_type (
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
create_tag_types (
|
||||
close_triangle_type (
|
||||
void
|
||||
) {
|
||||
H5_PRIV_FUNC_ENTER (h5_err_t, "%s", "void");
|
||||
TRY (hdf5_close_type (h5_dta_types.h5_triangle_t));
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
create_tag_type (
|
||||
void
|
||||
) {
|
||||
H5_PRIV_FUNC_ENTER (h5_err_t, "%s", "void");
|
||||
@@ -183,6 +215,15 @@ create_tag_types (
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
close_tag_type (
|
||||
void
|
||||
) {
|
||||
H5_PRIV_FUNC_ENTER (h5_err_t, "%s", "void");
|
||||
TRY (hdf5_close_type (h5_dta_types.h5t_glb_tag_idx_t));
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
create_tet_type (
|
||||
void
|
||||
@@ -245,6 +286,15 @@ create_tet_type (
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
close_tet_type (
|
||||
void
|
||||
) {
|
||||
H5_PRIV_FUNC_ENTER (h5_err_t, "%s", "void");
|
||||
TRY (hdf5_close_type (h5_dta_types.h5_tet_t));
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
#if defined(WITH_PARALLEL_H5GRID)
|
||||
|
||||
static inline h5_err_t
|
||||
@@ -301,6 +351,16 @@ create_chunk_type (
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
close_chunk_type (
|
||||
void
|
||||
) {
|
||||
H5_PRIV_FUNC_ENTER (h5_err_t, "%s", "void");
|
||||
TRY (hdf5_close_type (h5_dta_types.h5_chunk_t));
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
static inline h5_err_t
|
||||
create_octree_type (
|
||||
void
|
||||
@@ -350,6 +410,15 @@ create_octree_type (
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
close_octree_type (
|
||||
void
|
||||
) {
|
||||
H5_PRIV_FUNC_ENTER (h5_err_t, "%s", "void");
|
||||
TRY (hdf5_close_type (h5_dta_types.h5_octree_t));
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
create_userdata_type (
|
||||
void
|
||||
@@ -369,6 +438,15 @@ create_userdata_type (
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
close_userdata_type (
|
||||
void
|
||||
) {
|
||||
H5_PRIV_FUNC_ENTER (h5_err_t, "%s", "void");
|
||||
TRY (hdf5_close_type (h5_dta_types.h5_userdata_t));
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
static inline h5_err_t
|
||||
create_mpi_type_glb_tet (
|
||||
void
|
||||
@@ -669,9 +747,9 @@ h5priv_initialize (
|
||||
memset (&h5_call_stack, 0, sizeof (h5_call_stack));
|
||||
// must be set here, otherwise next statement will fail!
|
||||
h5_initialized = 1;
|
||||
H5_CORE_API_ENTER (h5_err_t, "%s", "void");
|
||||
H5_PRIV_FUNC_ENTER (h5_err_t, "%s", "void");
|
||||
ret_value = H5_SUCCESS;
|
||||
#ifdef PARALLEL_IO
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
int mpi_is_initialized;
|
||||
MPI_Initialized (&mpi_is_initialized);
|
||||
if (!mpi_is_initialized) {
|
||||
@@ -690,7 +768,7 @@ h5priv_initialize (
|
||||
TRY (create_vertex_type ());
|
||||
TRY (create_triangle_type ());
|
||||
TRY (create_tet_type ());
|
||||
TRY (create_tag_types ());
|
||||
TRY (create_tag_type ());
|
||||
|
||||
#if defined(WITH_PARALLEL_H5GRID)
|
||||
TRY (create_chunk_type ());
|
||||
@@ -705,3 +783,21 @@ h5priv_initialize (
|
||||
#endif
|
||||
H5_RETURN ((ret_value != H5_SUCCESS) ? _h5_exit (42) : H5_SUCCESS);
|
||||
}
|
||||
|
||||
h5_err_t
|
||||
h5priv_finalize (
|
||||
void
|
||||
) {
|
||||
H5_PRIV_FUNC_ENTER (h5_err_t, "%s", "void");
|
||||
TRY (close_array_types ());
|
||||
TRY (close_vertex_type ());
|
||||
TRY (close_triangle_type ());
|
||||
TRY (close_tag_type ());
|
||||
TRY (close_tet_type ());
|
||||
#if defined(WITH_PARALLEL_H5GRID)
|
||||
TRY (close_chunk_type ());
|
||||
TRY (close_octree_type ());
|
||||
TRY (close_userdata_type ());
|
||||
#endif
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -15,18 +15,6 @@
|
||||
|
||||
#define UNUSED_ARGUMENT(x) (void)x
|
||||
|
||||
// dummy MPI calls for serial code
|
||||
#if !defined (PARALLEL_IO)
|
||||
typedef int MPI_Comm;
|
||||
#define MPI_Init(argc, argv)
|
||||
#define MPI_Initialized () (1)
|
||||
#define MPI_Comm_size(comm, nprocs) {(void)comm; *nprocs = 1; }
|
||||
#define MPI_Comm_rank(comm, myproc) {(void)comm; *myproc = 0; }
|
||||
#define MPI_Finalize()
|
||||
#define MPI_COMM_WORLD (0)
|
||||
#define MPI_COMM_SELF (1)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -34,6 +22,9 @@ extern "C" {
|
||||
h5_err_t
|
||||
h5priv_initialize (void);
|
||||
|
||||
h5_err_t
|
||||
h5priv_finalize (void);
|
||||
|
||||
extern int h5_initialized;
|
||||
extern h5_dta_types_t h5_dta_types;
|
||||
extern int h5_myproc;
|
||||
|
||||
@@ -62,7 +62,7 @@ grow_strlist (
|
||||
ssize_t
|
||||
h5priv_insert_strlist (
|
||||
h5_strlist_t** list,
|
||||
const char const* item,
|
||||
const char *const item,
|
||||
size_t idx
|
||||
) {
|
||||
H5_PRIV_API_ENTER (ssize_t,
|
||||
|
||||
@@ -160,7 +160,7 @@ h5_err_t
|
||||
h5priv_free_strlist (h5_strlist_t**);
|
||||
|
||||
ssize_t
|
||||
h5priv_insert_strlist (h5_strlist_t**, const char const*, size_t);
|
||||
h5priv_insert_strlist (h5_strlist_t**, const char *const, size_t);
|
||||
|
||||
ssize_t
|
||||
h5priv_find_strlist (h5_strlist_t*, const char* const item);
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "private/h5_mpi.h"
|
||||
#include "private/h5_hdf5.h"
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
static inline h5_err_t
|
||||
h5priv_start_throttle (
|
||||
const h5_file_p f
|
||||
@@ -98,7 +98,7 @@ h5priv_end_throttle (
|
||||
}
|
||||
H5_RETURN (H5_SUCCESS);
|
||||
}
|
||||
#else // PARALLEL_IO
|
||||
#else // H5_HAVE_PARALLEL
|
||||
static inline h5_err_t
|
||||
h5priv_start_throttle (const h5_file_p f) {
|
||||
UNUSED_ARGUMENT (f);
|
||||
@@ -111,7 +111,7 @@ h5priv_end_throttle (const h5_file_p f) {
|
||||
return H5_SUCCESS;
|
||||
}
|
||||
|
||||
#endif // PARALLEL_IO
|
||||
#endif // H5_HAVE_PARALLEL
|
||||
|
||||
|
||||
h5_err_t
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#ifndef __PRIVATE_H5_MPI_H
|
||||
#define __PRIVATE_H5_MPI_H
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
|
||||
#include "h5core/h5_types.h"
|
||||
#include "h5core/h5_err.h"
|
||||
|
||||
@@ -35,7 +35,9 @@ struct h5_prop_file { // file property
|
||||
h5_int64_t align; // HDF5 alignment
|
||||
h5_int64_t increment; // increment for core vfd
|
||||
h5_int64_t throttle;
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
MPI_Comm comm;
|
||||
#endif
|
||||
hid_t xfer_prop; // dataset transfer properties
|
||||
hid_t access_prop; // file access properties
|
||||
hid_t create_prop; // file create properties
|
||||
|
||||
@@ -136,7 +136,6 @@ h5tpriv_traverse_tv (
|
||||
unsigned int* i
|
||||
) {
|
||||
assert (i != NULL);
|
||||
if (*i < 0) i = 0;
|
||||
if (*i >= m->num_loc_vertices[m->num_loaded_levels-1]) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -166,7 +165,6 @@ h5tpriv_traverse_td (
|
||||
unsigned int* i
|
||||
) {
|
||||
assert (i != NULL);
|
||||
if (*i < 0) i = 0;
|
||||
h5t_td_entry_t* entry = h5priv_htraverse (&m->adjacencies.td_hash, i);
|
||||
h5_loc_idlist_t* result = NULL;
|
||||
if (entry) {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "h5core/h5_types.h"
|
||||
#include "h5core/h5t_octree.h"
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
#if defined(H5_HAVE_PARALLEL)
|
||||
#include <mpi.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ const h5t_ref_elem_t h5t_tet_ref_elem = {
|
||||
[3][0] = {{0,1,2,3}},
|
||||
[3][1] = {{0,1,2,3,4,5}},
|
||||
[3][2] = {{0,1,2,3}},
|
||||
[3][2] = {{0}}
|
||||
[3][3] = {{0}}
|
||||
},
|
||||
{ // coordinates
|
||||
{0.0, 0.0, 0.0},
|
||||
|
||||
@@ -110,6 +110,7 @@ typedef struct h5_loc_elem {
|
||||
/*** type ids' for compound types ***/
|
||||
typedef struct h5_dta_types {
|
||||
hid_t h5_glb_idx_t; /* ID's */
|
||||
hid_t h5_int32_t;
|
||||
hid_t h5_int64_t; /* 64 bit signed integer */
|
||||
hid_t h5_float64_t; /* 64 bit floating point */
|
||||
hid_t h5_coord3d_t; /* 3-tuple of 64-bit float */
|
||||
@@ -120,16 +121,17 @@ typedef struct h5_dta_types {
|
||||
hid_t h5_vertex_t; /* vertex structure */
|
||||
hid_t h5_triangle_t; /* triangle structure */
|
||||
hid_t h5_tet_t; /* tetrahedron structure */
|
||||
hid_t h5t_glb_tag_idx_t;
|
||||
#if defined(WITH_PARALLEL_H5GRID)
|
||||
hid_t h5_chunk_t; // chunk structure
|
||||
hid_t h5_octree_t; // octree structure
|
||||
hid_t h5_userdata_t; // userdata structure
|
||||
hid_t h5t_glb_tag_idx_t;
|
||||
hid_t h5_int32_t;
|
||||
MPI_Datatype mpi_glb_triangle;
|
||||
MPI_Datatype mpi_glb_tet;
|
||||
MPI_Datatype mpi_glb_vtx;
|
||||
MPI_Datatype mpi_chunk;
|
||||
MPI_Datatype mpi_edge_list_elem;
|
||||
#endif
|
||||
} h5_dta_types_t;
|
||||
|
||||
typedef struct h5t_adjacencies {
|
||||
|
||||
@@ -336,7 +336,6 @@ H5Block3dGetChunkSize (
|
||||
i, j, k));
|
||||
}
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
/**
|
||||
Define an underlying 3D Cartesian grid on the processors with dimensions
|
||||
(\c i,\c j,\c k). You can look up a processor's index into the grid
|
||||
@@ -347,6 +346,9 @@ H5Block3dGetChunkSize (
|
||||
|
||||
The product of the dimensions must equal the size of the MPI communicator.
|
||||
|
||||
\note This function is also available in a serial version of H5hut - even it
|
||||
doesn't make much sense.
|
||||
|
||||
\return \c H5_SUCCESS on success
|
||||
\return \c H5_FAILURE on error
|
||||
*/
|
||||
@@ -373,6 +375,9 @@ H5Block3dSetGrid (
|
||||
Look up the index (\c i, \c j, \c k) in the grid belonging to MPI processor
|
||||
\c proc.
|
||||
|
||||
\note This function is also available in a serial version of H5hut - even it
|
||||
doesn't make much sense.
|
||||
|
||||
\return \c H5_SUCCESS on success
|
||||
\return \c H5_FAILURE on error
|
||||
*/
|
||||
@@ -401,6 +406,9 @@ H5Block3dGetGridCoords (
|
||||
A grid must be already set with \ref H5Block3dSetGrid, and all processors
|
||||
must specify the same dimensions.
|
||||
|
||||
\note This function is also available in a serial version of H5hut - even it
|
||||
doesn't make much sense.
|
||||
|
||||
\return \c H5_SUCCESS on success
|
||||
\return \c H5_FAILURE on error
|
||||
*/
|
||||
@@ -422,7 +430,6 @@ H5Block3dSetDims (
|
||||
f,
|
||||
i, j, k));
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
Sets the additional cells (\c i, \c j, \c k) in each direction to use as
|
||||
|
||||
@@ -399,7 +399,7 @@ H5Finalize (
|
||||
void
|
||||
) {
|
||||
H5_API_ENTER (h5_err_t, "%s", "");
|
||||
H5_API_RETURN (h5_close_hdf5 ());
|
||||
H5_API_RETURN (h5_close_h5hut ());
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -102,6 +102,7 @@ H5GetVerbosityLevel (
|
||||
/**
|
||||
Set debug mask. The debug mask is an or'ed value of
|
||||
|
||||
- \c H5_DEBUG_NONE: debug output disabled
|
||||
- \c H5_DEBUG_API: C-API calls
|
||||
- \c H5_DEBUG_CORE_API: core API calls.
|
||||
- \c H5_DEBUG_PRIV_API: private API calls
|
||||
|
||||
@@ -10,11 +10,6 @@
|
||||
#ifndef __H5CORE_H5_FILE_H
|
||||
#define __H5CORE_H5_FILE_H
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
#include <mpi.h>
|
||||
#endif
|
||||
|
||||
#include <hdf5.h>
|
||||
|
||||
#include "h5core/h5_types.h"
|
||||
|
||||
@@ -71,7 +66,7 @@ h5_close_file (
|
||||
const h5_file_t);
|
||||
|
||||
h5_err_t
|
||||
h5_close_hdf5 (
|
||||
h5_close_h5hut (
|
||||
void);
|
||||
|
||||
h5_err_t
|
||||
|
||||
@@ -35,6 +35,7 @@ extern const char* H5_VER_STRING;
|
||||
#define H5_DEBUG_MALLOC (1<<9)
|
||||
#define H5_DEBUG_CLIB (1<<10)
|
||||
|
||||
#define H5_DEBUG_NONE (0)
|
||||
#define H5_DEBUG_ALL (-1 & ~0x3)
|
||||
|
||||
extern char* h5_rfmts[];
|
||||
|
||||
@@ -13,6 +13,21 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <hdf5.h>
|
||||
|
||||
#ifndef H5_HAVE_PARALLEL
|
||||
/*
|
||||
If someone want's to use serial H5hut with MPI, he must include
|
||||
the header file "mpi.h" before including H5hut's header file. According
|
||||
to the MPI standard the macro MPI_VERSION must be defined after reading
|
||||
"mpi.h".
|
||||
*/
|
||||
#ifndef MPI_VERSION
|
||||
typedef int MPI_Comm;
|
||||
typedef int MPI_Datatype;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
H5_STRING_T,
|
||||
H5_INT16_T,
|
||||
@@ -107,11 +122,6 @@ typedef h5_err_t (*h5_errorhandler_t)(
|
||||
const char*,
|
||||
va_list ap );
|
||||
|
||||
#ifndef PARALLEL_IO
|
||||
typedef int MPI_Comm;
|
||||
typedef int MPI_Datatype;
|
||||
#endif
|
||||
|
||||
typedef struct h5_loc_idlist {
|
||||
int32_t size; /* allocated space in number of items */
|
||||
int32_t num_items; /* stored items */
|
||||
|
||||
@@ -78,7 +78,6 @@ h5b_3d_get_chunk (
|
||||
const char*,
|
||||
h5_size_t* const, h5_size_t* const, h5_size_t* const);
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
h5_err_t
|
||||
h5b_3d_set_grid (
|
||||
const h5_file_t,
|
||||
@@ -94,7 +93,6 @@ h5_err_t
|
||||
h5b_3d_set_dims (
|
||||
const h5_file_t,
|
||||
const h5_size_t, const h5_size_t, const h5_size_t);
|
||||
#endif
|
||||
|
||||
h5_err_t
|
||||
h5b_3d_set_halo (
|
||||
|
||||
+3
-3
@@ -82,7 +82,7 @@ test_read_data64(h5_file_t file, int step)
|
||||
|
||||
TEST("Verifying dataset info");
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
#if defined(H5_HAVE_PARALLEL)
|
||||
int rank, nprocs;
|
||||
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
|
||||
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
|
||||
@@ -202,7 +202,7 @@ test_read_data32(h5_file_t file, int step)
|
||||
RETURN(status, H5_SUCCESS, "H5SetStep");
|
||||
|
||||
test_read_field_attribs(file, "e", t);
|
||||
#if defined(PARALLEL_IO)
|
||||
#if defined(H5_HAVE_PARALLEL)
|
||||
status = H5Block3dSetGrid(file, grid[0], grid[1], grid[2]);
|
||||
RETURN(status, H5_SUCCESS, "H5Block3dSetGrid");
|
||||
|
||||
@@ -239,7 +239,7 @@ void h5b_test_read1(void)
|
||||
|
||||
TEST("Opening file once, read-only");
|
||||
h5_prop_t props = H5CreateFileProp ();
|
||||
#if defined(PARALLEL_IO)
|
||||
#if defined(H5_HAVE_PARALLEL)
|
||||
MPI_Comm comm = MPI_COMM_WORLD;
|
||||
status = H5SetPropFileMPIOCollective (props, &comm);
|
||||
RETURN(status, H5_SUCCESS, "H5SetPropFileMPIOCollective");
|
||||
|
||||
+5
-5
@@ -18,7 +18,7 @@ void h5b_test_write2(void);
|
||||
void h5b_test_read1(void);
|
||||
void h5b_test_read2(void);
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
static int
|
||||
_nth_root_int_divisor (const int m, const int n)
|
||||
{
|
||||
@@ -39,7 +39,7 @@ _nth_root_int_divisor (const int m, const int n)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
extern h5_size_t layout[6];
|
||||
#ifdef PARALLEL_IO
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
MPI_Init(&argc, &argv);
|
||||
|
||||
int procs, rank;
|
||||
@@ -69,7 +69,7 @@ int main(int argc, char **argv)
|
||||
layout[3] = (j+1)*NBLOCKY - 1;
|
||||
layout[4] = k*NBLOCKZ;
|
||||
layout[5] = (k+1)*NBLOCKZ - 1;
|
||||
#else // PARALLEL_IO
|
||||
#else // H5_HAVE_PARALLEL
|
||||
grid[0] = 1;
|
||||
grid[1] = 1;
|
||||
grid[2] = 1;
|
||||
@@ -88,7 +88,7 @@ int main(int argc, char **argv)
|
||||
/* Tests are generally arranged from least to most complexity... */
|
||||
AddTest("write1", h5b_test_write1, NULL, "Write 64-bit data", NULL);
|
||||
AddTest("read1", h5b_test_read1, NULL, "Read 64-bit data", NULL);
|
||||
#ifdef PARALLEL_IO
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
AddTest("write2", h5b_test_write2, NULL, "Write 32-bit data", NULL);
|
||||
AddTest("read2", h5b_test_read2, NULL, "Read 32-bit data", NULL);
|
||||
#endif
|
||||
@@ -111,7 +111,7 @@ int main(int argc, char **argv)
|
||||
//if (GetTestCleanup() && !getenv("HDF5_NOCLEANUP"))
|
||||
// TestCleanup();
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
TestPrintf ("reached end\n");
|
||||
fflush(stdout);
|
||||
MPI_Finalize();
|
||||
|
||||
+2
-2
@@ -149,7 +149,7 @@ test_write_data32(h5_file_t file, int step)
|
||||
|
||||
if (val == 0) test_write_field_attribs(file, "e", t);
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
#if defined(H5_HAVE_PARALLEL)
|
||||
extern h5_size_t grid[3];
|
||||
|
||||
status = H5Block3dSetGrid(file, grid[0], grid[1], grid[2]);
|
||||
@@ -181,7 +181,7 @@ void h5b_test_write1(void)
|
||||
|
||||
TEST("Opening file once, write-truncate");
|
||||
h5_prop_t props = H5CreateFileProp ();
|
||||
#if defined (PARALLEL_IO)
|
||||
#if defined (H5_HAVE_PARALLEL)
|
||||
MPI_Comm comm = MPI_COMM_WORLD;
|
||||
status = H5SetPropFileMPIOCollective (props, &comm);
|
||||
RETURN(status, H5_SUCCESS, "H5SetPropFileMPIOCollective");
|
||||
|
||||
+3
-3
@@ -106,7 +106,7 @@ test_read_data64(h5_file_t file, int nparticles, int step)
|
||||
|
||||
TEST("Verifying dataset info");
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
#if defined(H5_HAVE_PARALLEL)
|
||||
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
|
||||
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
|
||||
#else
|
||||
@@ -479,7 +479,7 @@ void h5u_test_read3(void)
|
||||
|
||||
TEST("Opening file once, read-only, MPI-POSIX VFD");
|
||||
h5_prop_t props = H5CreateFileProp ();
|
||||
#if defined(PARALLEL_IO)
|
||||
#if defined(H5_HAVE_PARALLEL)
|
||||
MPI_Comm comm = MPI_COMM_WORLD;
|
||||
status = H5SetPropFileMPIOPosix (props, &comm);
|
||||
RETURN(status, H5_SUCCESS, "H5SetPropFileMPIOPosix");
|
||||
@@ -508,7 +508,7 @@ void h5u_test_read4(void)
|
||||
|
||||
TEST("Opening file twice, read-only, MPI-IO Independent VFD");
|
||||
h5_prop_t props = H5CreateFileProp ();
|
||||
#if defined(PARALLEL_IO)
|
||||
#if defined(H5_HAVE_PARALLEL)
|
||||
MPI_Comm comm = MPI_COMM_WORLD;
|
||||
status = H5SetPropFileMPIOIndependent (props, &comm);
|
||||
RETURN(status, H5_SUCCESS, "H5SetPropFileMPIOIndependent");
|
||||
|
||||
+2
-2
@@ -20,7 +20,7 @@ void h5u_test_read4(void);
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#ifdef PARALLEL_IO
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
MPI_Init(&argc, &argv);
|
||||
int procs;
|
||||
MPI_Comm_size(MPI_COMM_WORLD, &procs);
|
||||
@@ -66,7 +66,7 @@ int main(int argc, char **argv)
|
||||
//if (GetTestCleanup() && !getenv("HDF5_NOCLEANUP"))
|
||||
// TestCleanup();
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
TestPrintf ("reached end\n");
|
||||
fflush(stdout);
|
||||
MPI_Finalize();
|
||||
|
||||
+5
-5
@@ -211,7 +211,7 @@ test_write_data32(h5_file_t file, int nparticles, int step)
|
||||
status = H5PartSetNumParticles(file, nparticles);
|
||||
RETURN(status, H5_SUCCESS, "H5PartSetNumParticles");
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
#if defined(H5_HAVE_PARALLEL)
|
||||
int rank, nprocs;
|
||||
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
|
||||
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
|
||||
@@ -358,7 +358,7 @@ void h5u_test_write1(void)
|
||||
TEST("Opening file once, write-truncate");
|
||||
h5_prop_t props = H5CreateFileProp ();
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
#if defined(H5_HAVE_PARALLEL)
|
||||
MPI_Comm comm = MPI_COMM_WORLD;
|
||||
status = H5SetPropFileMPIOCollective (props, &comm);
|
||||
RETURN(status, H5_SUCCESS, "H5SetPropFileMPIOCollective");
|
||||
@@ -386,7 +386,7 @@ void h5u_test_write2(void)
|
||||
TEST("Opening file twice, write-append + read-only");
|
||||
h5_prop_t props = H5CreateFileProp ();
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
#if defined(H5_HAVE_PARALLEL)
|
||||
MPI_Comm comm = MPI_COMM_WORLD;
|
||||
status = H5SetPropFileMPIOCollective (props, &comm);
|
||||
RETURN(status, H5_SUCCESS, "H5SetPropFileMPIOCollective");
|
||||
@@ -421,7 +421,7 @@ void h5u_test_write3(void)
|
||||
|
||||
h5_prop_t props = H5CreateFileProp ();
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
#if defined(H5_HAVE_PARALLEL)
|
||||
MPI_Comm comm = MPI_COMM_WORLD;
|
||||
status = H5SetPropFileMPIOPosix (props, &comm);
|
||||
RETURN(status, H5_SUCCESS, "H5SetPropFileMPIOPosix");
|
||||
@@ -457,7 +457,7 @@ void h5u_test_write4(void)
|
||||
TEST("Opening file twice, write-append + read-only, MPI-IO Independent VFD");
|
||||
|
||||
props = H5CreateFileProp ();
|
||||
#if defined(PARALLEL_IO)
|
||||
#if defined(H5_HAVE_PARALLEL)
|
||||
MPI_Comm comm = MPI_COMM_WORLD;
|
||||
status = H5SetPropFileMPIOIndependent (props, &comm);
|
||||
RETURN(status, H5_SUCCESS, "H5SetPropFileMPIOIndependent");
|
||||
|
||||
+2
-2
@@ -530,7 +530,7 @@ TestPrintf(const char *format, ...)
|
||||
va_list arglist;
|
||||
int ret_value = -1;
|
||||
|
||||
#if defined(PARALLEL_IO)
|
||||
#if defined(H5_HAVE_PARALLEL)
|
||||
int nproc;
|
||||
MPI_Comm_rank(MPI_COMM_WORLD, &nproc);
|
||||
if ( nproc == 0 || VERBOSE_HI ) {
|
||||
@@ -564,7 +564,7 @@ TestErrPrintf(const char *format, ...)
|
||||
/* Increment the error count */
|
||||
num_errs++;
|
||||
|
||||
#if PARALLEL_IO
|
||||
#if H5_HAVE_PARALLEL
|
||||
int nproc;
|
||||
MPI_Comm_rank(MPI_COMM_WORLD, &nproc);
|
||||
if ( nproc == 0 || VERBOSE_HI ) {
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
AM_CPPFLAGS = -I${abs_top_srcdir}/src/include -Wno-deprecated
|
||||
AM_CPPFLAGS = -I${abs_top_srcdir}/src/include -Wno-deprecated @VTK_INCLUDES@
|
||||
FFLAGS += -cpp $(AM_CPPFLAGS)
|
||||
AM_LDFLAGS += -L${abs_top_builddir}/src/h5core
|
||||
|
||||
LDADD =
|
||||
|
||||
LDADD += -lH5hut -lvtkIO -lvtkFiltering -lvtkCommon -lvtksys -lpthread -ldl
|
||||
|
||||
LDADD = -lH5hut
|
||||
LDADD += @VTK_LIBS@
|
||||
|
||||
bin_PROGRAMS =
|
||||
|
||||
|
||||
Reference in New Issue
Block a user