H5hut_mpi.i 1.71 KB
Newer Older
gsell's avatar
gsell committed
1 2 3 4 5 6 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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
%module H5hut_mpi
%{
#define SWIG_FILE_WITH_INIT
#define PARALLEL_IO 1
#include <mpi.h>
#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();
%}

%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);
}

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

%include "h5core/h5_types.h"
//%include "H5.h"
//%include "H5_attribs.h"
%include "H5_model.h"
%include "H5hut.h"
%include "H5Block_attribs.h"
//%include "H5Block.h"
%include "H5Block_io.h"
%include "H5Block_model.h"
//%include "H5Part.h"
%include "H5Part_io.h"
%include "H5Part_model.h"
//%include "H5Fed_adjacency.h"
//%include "H5Fed.h"
//%include "H5Fed_model.h"
//%include "H5Fed_retrieve.h"
//%include "H5Fed_store.h"
//%include "H5Fed_tags.h"