H5hut.i 1.61 KB
Newer Older
gsell's avatar
gsell committed
1 2 3
%module H5hut
%{
#define SWIG_FILE_WITH_INIT
gsell's avatar
gsell committed
4 5 6
#if defined(PARALLEL_IO)
#include <mpi.h>
#endif
gsell's avatar
gsell committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
#include <stdint.h>
#include "h5core/h5_types.h"
//#include "H5.h"
#include "H5hut.h"
%}

%import <stdint.i>

%include numpy.i

%apply unsigned long int { h5_prop_t };
%apply unsigned long int { h5_file_t };


%apply (unsigned long long* IN_ARRAY1) { h5_size_t* };
%apply (unsigned int* IN_ARRAY1) { h5_uint32_t* }; //uint32_t
%apply (unsigned long long* IN_ARRAY1) { h5_uint64_t* }; //uint64_t
%apply (int* IN_ARRAY1) { h5_int32_t* }; //int32_t
%apply (long long* IN_ARRAY1) { h5_int64_t* }; //int64_t
%apply (float* IN_ARRAY1) { h5_float32_t* };
%apply (double* IN_ARRAY1) { h5_float64_t* };


%init %{
import_array();
%}

gsell's avatar
gsell committed
34 35 36 37 38 39 40 41 42 43 44 45 46
#if defined (PARALLEL_IO)
%include mpi4py/mpi4py.i
%mpi4py_typemap(Comm, MPI_Comm);
%typemap(in) MPI_Comm* {
    MPI_Comm *ptr = (MPI_Comm *)0;
    int res = SWIG_AsPtr_MPI_Comm($input, &ptr);
    if (!SWIG_IsOK(res) || !ptr) {
      SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "$symname" "', argument " "$argnum"" of type '" "MPI_Comm""'");
    }
    $1 = ptr;
    if (SWIG_IsNewObj(res)) free((char*)ptr);
}
#endif
gsell's avatar
gsell committed
47 48 49 50 51 52 53 54 55

%ignore h5_report_errorhandler;
%ignore h5_abort_errorhandler;
%ignore h5priv_vprintf;
%ignore h5_verror;
%ignore H5ReportErrorhandler;
%ignore H5AbortErrorhandler;

%include "h5core/h5_types.h"
gsell's avatar
gsell committed
56 57 58

%include "H5_attachments.h"
%include "H5_file.h"
gsell's avatar
gsell committed
59
%include "H5_model.h"
gsell's avatar
gsell committed
60 61 62 63
%include "H5_file_attribs.h"
%include "H5_step_attribs.h"
%include "H5_log.h"

gsell's avatar
gsell committed
64 65 66
%include "H5Block_attribs.h"
%include "H5Block_io.h"
%include "H5Block_model.h"
gsell's avatar
gsell committed
67

gsell's avatar
gsell committed
68 69
%include "H5Part_io.h"
%include "H5Part_model.h"