Commit 13d7784c authored by Marc Howison's avatar Marc Howison

added file open flags for Fortran interface

parent 00b0e87f
......@@ -18,6 +18,12 @@ AC_CONFIG_HEADER(config.h)
################# --enable-xxx and --with-xxx Argument ########################
###############################################################################
AC_ARG_ENABLE(
[debug],
[AC_HELP_STRING([--enable-debug],
[Compile with debug support [default=no]])],
[USE_DEBUG=$enableval])
AC_ARG_ENABLE(
[64],
[AC_HELP_STRING([--enable-64],
......@@ -212,6 +218,15 @@ AC_DEFINE_UNQUOTED(MY_UNAME, "$uname", "")
######################## CONFIGURE LINE OPTIONS ###############################
###############################################################################
AC_MSG_CHECKING([if debug is enabled])
if test "X$USE_DEBUG" = "Xyes"; then
AC_MSG_RESULT([yes])
CFLAGS="$CFLAGS -g"
else
AC_MSG_RESULT([no])
fi
###################### 64-bit compilation enabled #############################
AC_MSG_CHECKING([if 64-bit compilation is enabled])
......
......@@ -130,7 +130,7 @@ _h5_error_handler (
static H5PartFile*
_H5Part_open_file (
const char *filename, /*!< [in] The name of the data file to open. */
unsigned flags, /*!< [in] The access mode for the file. */
const char flags, /*!< [in] The access mode for the file. */
MPI_Comm comm, /*!< [in] MPI communicator */
int f_parallel, /*!< [in] 0 for serial io otherwise parallel */
h5part_int64_t align /*!< [in] Number of bytes for setting alignment,
......@@ -376,7 +376,7 @@ _H5Part_open_file (
H5PartFile*
H5PartOpenFileParallel (
const char *filename, /*!< [in] The name of the data file to open. */
unsigned flags, /*!< [in] The access mode for the file. */
const char flags, /*!< [in] The access mode for the file. */
MPI_Comm comm /*!< [in] MPI communicator */
) {
......@@ -399,7 +399,7 @@ H5PartOpenFileParallel (
H5PartFile*
H5PartOpenFileParallelAlign (
const char *filename, /*!< [in] The name of the data file to open. */
unsigned flags, /*!< [in] The access mode for the file. */
const char flags, /*!< [in] The access mode for the file. */
MPI_Comm comm, /*!< [in] MPI communicator */
h5part_int64_t align /*!< [in] Alignment size in bytes. */
) {
......@@ -436,7 +436,7 @@ H5PartOpenFileParallelAlign (
H5PartFile*
H5PartOpenFile (
const char *filename, /*!< [in] The name of the data file to open. */
unsigned flags /*!< [in] The access mode for the file. */
const char flags /*!< [in] The access mode for the file. */
) {
SET_FNAME ( "H5PartOpenFile" );
......@@ -459,7 +459,7 @@ H5PartOpenFile (
H5PartFile*
H5PartOpenFileAlign (
const char *filename, /*!< [in] The name of the data file to open. */
unsigned flags, /*!< [in] The access mode for the file. */
const char flags, /*!< [in] The access mode for the file. */
h5part_int64_t align /*!< [in] Alignment size in bytes. */
) {
SET_FNAME ( "H5PartOpenFile" );
......
......@@ -57,13 +57,13 @@ extern "C" {
H5PartFile*
H5PartOpenFile(
const char *filename,
const unsigned flags
const char flags
);
H5PartFile*
H5PartOpenFileAlign(
const char *filename,
const unsigned flags,
const char flags,
h5part_int64_t align
);
......@@ -74,14 +74,14 @@ H5PartOpenFileAlign(
H5PartFile*
H5PartOpenFileParallel (
const char *filename,
const unsigned flags,
const char flags,
MPI_Comm communicator
);
H5PartFile*
H5PartOpenFileParallelAlign (
const char *filename,
const unsigned flags,
const char flags,
MPI_Comm communicator,
h5part_int64_t align
);
......
......@@ -213,6 +213,27 @@ _H5Part_strc2for (
return str;
}
char
_H5Part_flagsfor2c (
char * flags
) {
char fbits = 0x00;
flags = strtok ( str, "," );
while ( flags != NULL ) {
if ( strcmp ( flags, "vfd_mpiposix" ) == 0 )
fbits |= H5PART_VFD_MPIPOSIX;
else if ( strcmp ( flags, "fs_lustre" ) == 0 )
fbits |= H5PART_FS_LUSTRE;
else if (strcmp ( flags, "fs_gpfs" ) == 0 )
fbits |= H5PART_FS_GPFS;
strtok ( NULL, "," );
}
return fbits;
}
/* open/close interface */
h5part_int64_t
h5pt_openr (
......@@ -372,13 +393,18 @@ h5pt_openw_par_align (
const char *file_name,
MPI_Comm *comm,
const h5part_int64_t *align,
const int l_file_name
const char *flags,
const int l_file_name,
const int l_flags
) {
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
char *flags2 = _H5Part_strdupfor2c ( flags, l_flags );
char fbits = H5PART_WRITE | _H5Part_flagsfor2c ( flags2 );
H5PartFile* f = H5PartOpenFileParallelAlign (
file_name2, H5PART_WRITE, *comm, *align );
file_name2, fbits, *comm, *align );
free ( file_name2 );
return (h5part_int64_t)(size_t)f;
......@@ -389,16 +415,21 @@ h5pt_opena_par_align (
const char *file_name,
MPI_Comm *comm,
const h5part_int64_t *align,
const int l_file_name
const char *flags,
const int l_file_name,
const int l_flags
) {
char *file_name2 = _H5Part_strdupfor2c ( file_name, l_file_name );
char *flags2 = _H5Part_strdupfor2c ( flags, l_flags );
H5PartFile* f = H5PartOpenFileParallelAlign (
file_name2, H5PART_APPEND, *comm, *align );
free ( file_name2 );
return (h5part_int64_t)(size_t)f;
char fbits = H5PART_APPEND | _H5Part_flagsfor2c ( flags2 );
H5PartFile* f = H5PartOpenFileParallelAlign (
file_name2, fbits, *comm, *align );
free ( file_name2 );
return (h5part_int64_t)(size_t)f;
}
#endif
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment