Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1c8a5dd0d1 | |||
| 64f8552443 | |||
| da1ceec4f5 | |||
| b12b39dedf | |||
| aac94b38e8 | |||
| 3e918f8001 | |||
| 0be5518252 | |||
| 9fa5becf1e | |||
| 8d04bca079 | |||
| fda65e5527 |
@@ -1,3 +1,11 @@
|
||||
*.o
|
||||
*.lo
|
||||
*.la
|
||||
*~
|
||||
*.h5
|
||||
*.vtk
|
||||
.deps
|
||||
.libs
|
||||
/H5hut
|
||||
/INSTALL
|
||||
/Makefile
|
||||
@@ -5,6 +13,7 @@
|
||||
/aclocal.m4
|
||||
/autom4te.cache
|
||||
/build
|
||||
/compile
|
||||
/config.guess
|
||||
/config.h
|
||||
/config.h.in
|
||||
|
||||
+19
-10
@@ -1,4 +1,4 @@
|
||||
AC_INIT([H5hut], [1.99.11], [h5part@lists.psi.ch], H5hut)
|
||||
AC_INIT([H5hut], [1.99.14], [h5part@lists.psi.ch], H5hut)
|
||||
AC_PREREQ(2.60)
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
@@ -62,7 +62,7 @@ AC_ARG_WITH(
|
||||
[hdf5],
|
||||
[AS_HELP_STRING([--with-hdf5],
|
||||
[path to HDF5 installation [default=""]])],
|
||||
[HDF5_PREFIX=$withval], [HDF5_PREFIX=""])
|
||||
[HDF5_PREFIX=$withval], [])
|
||||
|
||||
AC_ARG_WITH(
|
||||
[mpi],
|
||||
@@ -259,13 +259,13 @@ fi
|
||||
AC_MSG_CHECKING([if parallel interface enabled])
|
||||
if test "X$ENABLE_PARALLEL" = "Xyes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
AM_CPPFLAGS="${AM_CPPFLAGS} -DPARALLEL_IO -DMPICH_IGNORE_CXX_SEEK"
|
||||
CPPFLAGS="${CPPFLAGS} -DPARALLEL_IO -DMPICH_IGNORE_CXX_SEEK"
|
||||
|
||||
if test "X$ENABLE_EXPERIMENTAL" = "Xyes"; then
|
||||
AC_MSG_CHECKING([for ParMETIS])
|
||||
if test "X$PARMETISPATH" != "X"; then
|
||||
AM_CPPFLAGS="$AM_CPPFLAGS -I$PARMETISPATH/include"
|
||||
AM_LDFLAGS="$AM_LDFLAGS -L$PARMETISPATH/lib"
|
||||
CPPFLAGS="$CPPFLAGS -I$PARMETISPATH/include"
|
||||
LDFLAGS="$LDFLAGS -L$PARMETISPATH/lib"
|
||||
fi
|
||||
|
||||
LIBS="$LIBS -lparmetis -lmetis"
|
||||
@@ -284,9 +284,15 @@ fi
|
||||
|
||||
###############################################################################
|
||||
# LIBRARY PATHS
|
||||
if test -n "${HDF5_PREFIX}" ; then
|
||||
AM_CPPFLAGS="$AM_CPPFLAGS -I$HDF5_PREFIX/include"
|
||||
AM_LDFLAGS="$AM_LDFLAGS -L$HDF5_PREFIX/lib"
|
||||
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])
|
||||
@@ -317,8 +323,8 @@ 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"
|
||||
AM_CPPFLAGS="$AM_CPPFLAGS -I$LUSTREROOT/usr/include"
|
||||
AM_LDFLAGS="$AM_LDFLAGS -L$LUSTREROOT/usr/lib"
|
||||
CPPFLAGS="$CPPFLAGS -I$LUSTREROOT/usr/include"
|
||||
LDFLAGS="$LDFLAGS -L$LUSTREROOT/usr/lib"
|
||||
LIBS="$LIBS -llustreapi"
|
||||
fi
|
||||
|
||||
@@ -336,6 +342,9 @@ fi
|
||||
|
||||
###############################################################################
|
||||
# EXPORTING VARIABLES & CREATING OUTPUT FILES
|
||||
AM_CPPFLAGS=$CPPFLAGS
|
||||
AM_LDFLAGS=$LDFLAGS
|
||||
|
||||
AC_SUBST(HDF5_PREFIX)
|
||||
AC_SUBST(CFLAGS)
|
||||
AC_SUBST(FFLAGS)
|
||||
|
||||
@@ -925,6 +925,7 @@ hdf5_set_fapl_mpio_property (
|
||||
HDF5_WRAPPER_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
#if H5_VERSION_LE(1,8,12)
|
||||
static inline h5_err_t
|
||||
hdf5_set_fapl_mpiposix_property (
|
||||
hid_t fapl_id,
|
||||
@@ -942,6 +943,7 @@ hdf5_set_fapl_mpiposix_property (
|
||||
" the file access property list."));
|
||||
HDF5_WRAPPER_RETURN (H5_SUCCESS);
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline h5_err_t
|
||||
hdf5_set_dxpl_mpio_property (
|
||||
|
||||
@@ -139,11 +139,14 @@ h5_err_t mpi_init (
|
||||
TRY (f->access_prop = hdf5_create_property(H5P_FILE_ACCESS));
|
||||
|
||||
/* select the HDF5 VFD */
|
||||
#if H5_VERSION_LE(1,8,12)
|
||||
if (f->mode & H5_VFD_MPIPOSIX) {
|
||||
h5_info("Selecting MPI-POSIX VFD");
|
||||
hbool_t use_gpfs = 0; // TODO autodetect GPFS?
|
||||
TRY (hdf5_set_fapl_mpiposix_property(f->access_prop, comm, use_gpfs));
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
h5_info("Selecting MPI-IO VFD");
|
||||
TRY (hdf5_set_fapl_mpio_property(f->access_prop, comm, MPI_INFO_NULL));
|
||||
if (f->mode & H5_VFD_INDEPENDENT) {
|
||||
|
||||
@@ -292,7 +292,11 @@ h5_set_throttle (
|
||||
const int factor
|
||||
) {
|
||||
H5_CORE_API_ENTER (h5_err_t, "f=%p, factor=%d", f, factor);
|
||||
#if H5_VERSION_LE(1,8,12)
|
||||
if ( (f->mode & H5_VFD_INDEPENDENT) || (f->mode & H5_VFD_MPIPOSIX) ) {
|
||||
#else
|
||||
if (f->mode & H5_VFD_INDEPENDENT) {
|
||||
#endif
|
||||
f->throttle = factor;
|
||||
h5_info ("Throttling enabled with factor = %d", f->throttle );
|
||||
} else {
|
||||
|
||||
@@ -547,8 +547,8 @@ h5b_3d_set_view (
|
||||
p->k_end = k_end;
|
||||
_normalize_partition(p);
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
h5b_fdata_t *b = f->b;
|
||||
#ifdef PARALLEL_IO
|
||||
h5b_partition_t *user_layout;
|
||||
h5b_partition_t *write_layout;
|
||||
|
||||
@@ -565,7 +565,6 @@ h5b_3d_set_view (
|
||||
TRY( _dissolve_ghostzones(f, user_layout, write_layout) );
|
||||
b->user_layout[0] = user_layout[f->myproc];
|
||||
b->write_layout[0] = write_layout[f->myproc];
|
||||
b->have_layout = 1;
|
||||
|
||||
p = b->user_layout;
|
||||
h5_debug (
|
||||
@@ -587,9 +586,9 @@ h5b_3d_set_view (
|
||||
|
||||
h5_free(user_layout);
|
||||
h5_free(write_layout);
|
||||
|
||||
TRY( h5bpriv_release_hyperslab(f) );
|
||||
#endif
|
||||
TRY( h5bpriv_release_hyperslab(f) );
|
||||
b->have_layout = 1;
|
||||
|
||||
H5_CORE_API_RETURN (H5_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,8 @@ _select_hyperslab_for_writing (
|
||||
/*
|
||||
re-use existing hyperslab
|
||||
*/
|
||||
if ( f->b->shape >= 0 ) return H5_SUCCESS;
|
||||
if ( f->b->shape >= 0 )
|
||||
H5_PRIV_FUNC_LEAVE (H5_SUCCESS);
|
||||
|
||||
h5b_fdata_t *b = f->b;
|
||||
h5b_partition_t *p = b->write_layout;
|
||||
|
||||
+2
-1
@@ -28,7 +28,8 @@ extern "C" {
|
||||
|
||||
You can also select a "virtual file driver" in the HDF5 layer using:
|
||||
- H5_VFD_INDEPENDENT: MPI-IO in independent (asynchronous) mode
|
||||
- H5_VFD_MPIPOSIX: parallel I/O implemented directly by HDF5, bypassing MPI-IO
|
||||
- H5_VFD_MPIPOSIX: parallel I/O implemented directly by HDF5, bypassing
|
||||
MPI-IO (only for hdf5 <= 1.8.12)
|
||||
|
||||
\return File handle.
|
||||
\return NULL on error.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
AM_CPPFLAGS = -I${abs_top_builddir}/src/include -Wno-deprecated
|
||||
AM_CPPFLAGS = -I${abs_top_srcdir}/src/include -Wno-deprecated
|
||||
FFLAGS += -cpp $(AM_CPPFLAGS)
|
||||
LDFLAGS += -L${abs_top_builddir}/src/lib
|
||||
|
||||
LDADD =
|
||||
|
||||
LDADD += -lH5hut -lvtkIO -lvtkFiltering -lvtkCommon -lvtksys
|
||||
LDADD += -lH5hut -lvtkIO -lvtkFiltering -lvtkCommon -lvtksys -lpthread -ldl
|
||||
|
||||
|
||||
bin_PROGRAMS =
|
||||
|
||||
@@ -14,9 +14,21 @@
|
||||
|
||||
#include "H5hut.h"
|
||||
|
||||
#if !defined (PARALLEL_IO)
|
||||
#define MPI_Init(argc, argv)
|
||||
#define MPI_Comm_size(comm, nprocs) { *nprocs = 1; }
|
||||
#define MPI_Comm_rank(comm, myproc) { *myproc = 0; }
|
||||
#define MPI_Finalize()
|
||||
#define MPI_COMM_WORLD (0)
|
||||
#endif
|
||||
|
||||
const char* version = "0.1.0";
|
||||
int convert_boundary = 1;
|
||||
int convert_volume = 0;
|
||||
double x_shift = 0.0;
|
||||
double y_shift = 0.0;
|
||||
double z_shift = 0.0;
|
||||
|
||||
const struct option longopts[] = {
|
||||
{"version", no_argument, 0, 'v'},
|
||||
{"help", no_argument, 0, 'h'},
|
||||
@@ -24,6 +36,7 @@ const struct option longopts[] = {
|
||||
{"volume", no_argument, &convert_volume, 1},
|
||||
{"no-boundary", no_argument, &convert_boundary, 0},
|
||||
{"no-volume", no_argument, &convert_volume, 0},
|
||||
{"shift", required_argument, 0, 's'},
|
||||
{0,0,0,0},
|
||||
};
|
||||
|
||||
@@ -75,6 +88,10 @@ init (
|
||||
case 'v':
|
||||
print_version (argv[0]);
|
||||
break;
|
||||
case 's':
|
||||
sscanf (optarg, "%lf,%lf,%lf", &x_shift, &y_shift, &z_shift);
|
||||
cout << "shift = (" << x_shift << ", " << y_shift << ", " << z_shift << ")" << endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return argc - optind;
|
||||
@@ -106,6 +123,9 @@ convert_vtk2h5grid (
|
||||
// add point to H5hut mesh
|
||||
double pt[3];
|
||||
vtk_grid->GetPoint (pts[i], pt);
|
||||
pt[0] += x_shift;
|
||||
pt[1] += y_shift;
|
||||
pt[2] += z_shift;
|
||||
H5FedStoreVertex (h5_grid, -1, pt);
|
||||
// map pt index in vtk file to pt index in H5hut file
|
||||
idmap.insert (IdMap::value_type (pts[i], h5_vertex_idx));
|
||||
@@ -145,6 +165,10 @@ main (
|
||||
int argc,
|
||||
char* argv[]
|
||||
) {
|
||||
MPI_Init (&argc, &argv);
|
||||
MPI_Comm comm = MPI_COMM_WORLD;
|
||||
int comm_size;
|
||||
MPI_Comm_size (comm,&comm_size);
|
||||
|
||||
argc = init (argc, argv);
|
||||
if (argc == 0) {
|
||||
@@ -200,5 +224,6 @@ main (
|
||||
}
|
||||
H5CloseFile (f);
|
||||
}
|
||||
MPI_Finalize ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user