... | ... | @@ -2,9 +2,10 @@ |
|
|
:TOC:
|
|
|
:numbered:
|
|
|
|
|
|
== Open file with default properties
|
|
|
C implementation
|
|
|
== Open a H5hut file
|
|
|
=== Open file with default properties
|
|
|
|
|
|
*C implementation*
|
|
|
----
|
|
|
#include "H5hut.h"
|
|
|
|
... | ... | @@ -14,18 +15,37 @@ main ( |
|
|
char** argv
|
|
|
) {
|
|
|
MPI_Init (&argc, &argv);
|
|
|
|
|
|
h5_file_t f = H5OpenFile ("testfile.h5", H5_O_WRONLY, H5_PROP_DEFAULT);
|
|
|
H5CloseFile (f);
|
|
|
|
|
|
H5CloseFile (f);
|
|
|
MPI_Finalize ();
|
|
|
return 0;
|
|
|
}
|
|
|
----
|
|
|
|
|
|
== Open file in independent mode
|
|
|
C implementation
|
|
|
*Fortran90 implementation*
|
|
|
----
|
|
|
include 'H5hut.f90'
|
|
|
|
|
|
program openclose
|
|
|
use H5hut
|
|
|
implicit none
|
|
|
include 'mpif.h'
|
|
|
|
|
|
integer :: ierr
|
|
|
integer*8 :: file_id, status
|
|
|
|
|
|
call mpi_init(ierr)
|
|
|
file_id = h5_openfile ("testfile.h5", H5_O_WRONLY, H5_PROP_DEFAULT)
|
|
|
|
|
|
status = h5_closefile (file_id);
|
|
|
call mpi_finalize(ierr)
|
|
|
end program openclose
|
|
|
----
|
|
|
|
|
|
=== Open file in independent mode
|
|
|
|
|
|
*C implementation*
|
|
|
----
|
|
|
#include "H5hut.h"
|
|
|
|
... | ... | @@ -36,19 +56,18 @@ main ( |
|
|
) {
|
|
|
MPI_Init (&argc, &argv);
|
|
|
MPI_Comm comm = MPI_COMM_WORLD;
|
|
|
|
|
|
h5_prop_t prop = H5CreateFileProp ();
|
|
|
H5SetPropFileMPIOIndependent (prop, &comm);
|
|
|
h5_file_t f = H5OpenFile ("testfile.h5", H5_O_WRONLY, prop);
|
|
|
|
|
|
H5CloseProp (prop);
|
|
|
H5CloseFile (f);
|
|
|
|
|
|
MPI_Finalize ();
|
|
|
return 0;
|
|
|
}
|
|
|
----
|
|
|
|
|
|
Fortran90 implementation
|
|
|
*Fortran90 implementation*
|
|
|
----
|
|
|
include 'H5hut.f90'
|
|
|
|
... | ... | |