Skip to Content.
Sympa Menu

h5part - [H5part] small patch

h5part AT lists.psi.ch

Subject: H5Part development and discussion

List archive

[H5part] small patch


Chronological Thread 
  • From: John Biddiscombe <biddisco AT cscs.ch>
  • To: h5part AT lists.psi.ch
  • Subject: [H5part] small patch
  • Date: Thu, 10 Jan 2008 17:56:58 +0100
  • List-archive: <https://lists.web.psi.ch/pipermail/h5part/>
  • List-id: H5Part development and discussion <h5part.lists.psi.ch>

I recently updated H5Part and had compile errors

Briefly outlined
1) _debug was defined as h5part_int64_t in one place and unsigned (int) in another
2) int32_t is undefined on win32 (use __int32)
3) MPIComm is defined as int in mpi.h (win32) and hpmp_comm_s*(linux) but #defined as unsigned long in h5Part (h5_types.h)
4) unistd.h not available openclose.c define _open/_close for win32
5) mpi needs to be #included before h5/h5_types when using cpp compiler

a very small patch is attached and I'd be most grateful if someone could apply it.

I'd also like to flag a problem that I have.
It is possible to have HAVE_PARALLEL (+H5_HAVE_PARALLEL) false when building hdf5, but to 'yes' have mpi present. This case is not handled correctly by H5Part as it only has a flag for PARALLEL_IO - in this case MPI is not pulled in and errors occur. (in particular 3) above is manifested because PARALLEL_IO is false, but we have included MPI so we get a false redefinition- in fact my patch might cause trouble there, so best leave 3 out

I have previously used H5PART_HAS_MPI and H5_PART_PARALLEL_IO as separate definitions and modified the h5part code appropriately - but when merging I threw away my changes. (I am writing this from memory as I had a build error and had to tweak my build back). I would like to fix this issue and submit another patch. I welcome comments.

thanks

JB

--
John Biddiscombe, email:biddisco @ cscs.ch
http://www.cscs.ch/about/BJohn.php
CSCS, Swiss National Supercomputing Centre | Tel: +41 (91) 610.82.07
Via Cantonale, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82

Index: src/h5/h5_types.h
===================================================================
--- src/h5/h5_types.h (revision 3000)
+++ src/h5/h5_types.h (working copy)
@@ -10,6 +10,7 @@

#ifdef WIN32
typedef __int64 int64_t;
+typedef __int32 int32_t;
#endif /* WIN32 */

typedef int64_t h5_int64_t;
@@ -36,7 +37,7 @@
typedef h5_error_handler h5part_error_handler;

#ifndef PARALLEL_IO
-typedef unsigned long MPI_Comm;
+typedef int MPI_Comm;
#endif

struct h5b_fdata;
Index: src/h5/openclose.c
===================================================================
--- src/h5/openclose.c (revision 3000)
+++ src/h5/openclose.c (working copy)
@@ -1,6 +1,12 @@
#include <stdio.h>
#include <stdlib.h>
-#include <unistd.h>
+#ifndef WIN32
+ #include <unistd.h>
+#else
+ #include <io.h>
+ #define open _open
+ #define close _close
+#endif
#include <stdarg.h> /* va_arg - System dependent ?! */
#include <string.h>
#include <errno.h>
@@ -19,7 +25,7 @@

extern h5part_error_handler _err_handler;
extern h5part_int64_t _h5part_errno;
-extern unsigned _debug;
+extern h5part_int64_t _debug;

static h5part_int64_t
_close_block (
Index: src/H5Part.c
===================================================================
--- src/H5Part.c (revision 2998)
+++ src/H5Part.c (working copy)
@@ -98,7 +98,7 @@

extern h5part_error_handler _err_handler;
extern h5part_int64_t _h5part_errno;
-extern unsigned _debug;
+extern h5part_int64_t _debug;

/********* Private Variable Declarations *************/

Index: src/H5PartTypes.h
===================================================================
--- src/H5PartTypes.h (revision 2998)
+++ src/H5PartTypes.h (working copy)
@@ -6,9 +6,12 @@
#ifndef _H5PARTTYPES_H_
#define _H5PARTTYPES_H_

+#ifdef PARALLEL_IO
+#include <mpi.h>
+#endif
+
#include "h5/h5_types.h"

-
typedef struct h5_file H5PartFile;

#ifdef IPL_XT3



Archive powered by MHonArc 2.6.19.

Top of Page