diff --git a/.gitattributes b/.gitattributes index 5360024..8935dc0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -364,6 +364,7 @@ doc/tetrahedron_refinements/6-edges/edge_01-12-20-23-30-31_refined/output_file.j doc/tetrahedron_refinements/README -text doc/tetrahedron_refinements/text2vtk.py -text examples/H5/Makefile.am -text +examples/H5/attach_file.c -text examples/H5/file_attribs.c -text examples/H5/openclose.c -text examples/H5Block/H5BlockExample.pbs -text @@ -547,7 +548,6 @@ src/include/h5core/h5t_tags.h -text src/include/h5core/h5u_io.h -text src/include/h5core/h5u_model.h -text test/Makefile.am -text -test/h5_attach_test.c -text test/h5b_read.c -text test/h5b_test.c -text test/h5b_write.c -text diff --git a/examples/H5/Makefile.am b/examples/H5/Makefile.am index fdeaccd..2fdcff1 100644 --- a/examples/H5/Makefile.am +++ b/examples/H5/Makefile.am @@ -15,16 +15,17 @@ noinst_PROGRAMS = if ENABLE_C noinst_PROGRAMS += \ openclose \ - file_attribs + file_attribs \ + attach_file endif if ENABLE_FORTRAN noinst_PROGRAMS += endif -EXTRA_PROGRAMS = openclose +#EXTRA_PROGRAMS = openclose -openclose_SOURCES = openclose.c +#openclose_SOURCES = openclose.c -%.o : %.f90 - $(FC) $(FFLAGS) -c $< +#%.o : %.f90 +# $(FC) $(FFLAGS) -c $< diff --git a/test/h5_attach_test.c b/examples/H5/attach_file.c similarity index 61% rename from test/h5_attach_test.c rename to examples/H5/attach_file.c index 688b23d..a143f09 100644 --- a/test/h5_attach_test.c +++ b/examples/H5/attach_file.c @@ -3,18 +3,33 @@ #include #include -#define FNAME "h5_attach.h5" -#define ATTACHMENT "h5_attach_test" +#define FNAME "attach_file.h5" +#define ATTACHMENT "attach_file" +#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 int main ( int argc, char* argv[] ) { + MPI_Comm comm = MPI_COMM_WORLD; + + int myproc; + int nprocs; + MPI_Init (&argc, &argv); + MPI_Comm_size (comm, &nprocs); + MPI_Comm_rank (comm, &myproc); + H5SetErrorHandler (H5AbortErrorhandler); H5SetVerbosityLevel (255); - h5_file_t f = H5OpenFile (FNAME, H5_O_WRONLY, 0); + h5_file_t f = H5OpenFile (FNAME, H5_O_WRONLY, comm); H5AddAttachment (f, ATTACHMENT); H5CloseFile (f); f = H5OpenFile (FNAME, H5_O_RDONLY, 0); diff --git a/examples/H5/file_attribs.c b/examples/H5/file_attribs.c index 06e5627..58c54f1 100644 --- a/examples/H5/file_attribs.c +++ b/examples/H5/file_attribs.c @@ -1,12 +1,5 @@ #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 int main ( diff --git a/test/Makefile.am b/test/Makefile.am index ca783db..4598712 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -7,7 +7,7 @@ LDADD += -lH5hut noinst_PROGRAMS = if ENABLE_C -noinst_PROGRAMS += h5u_test h5b_test h5_attach_test +noinst_PROGRAMS += h5u_test h5b_test endif TESTS_ENVIRONMENT = env LD_LIBRARY_PATH=@HDF5_PREFIX@/lib:$(LD_LIBRARY_PATH)