This commit is contained in:
2009-03-26 14:22:39 +00:00
parent 25de55c54b
commit b3e7f433ee
3 changed files with 99 additions and 0 deletions
+2
View File
@@ -390,6 +390,8 @@ src/h5_core/h5_hdf5.c -text
src/h5_core/h5_hdf5_private.h -text
src/h5_core/h5_maps.c -text
src/h5_core/h5_maps.h -text
src/h5_core/h5_mpi.c -text
src/h5_core/h5_mpi_private.h -text
src/h5_core/h5_openclose.c -text
src/h5_core/h5_openclose.h -text
src/h5_core/h5_qsort.c -text
+66
View File
@@ -0,0 +1,66 @@
#include <hdf5.h>
#include "h5_core/h5_core.h"
#include "h5_core/h5_core_private.h"
#ifdef PARALLEL_IO
h5_err_t
_h5_mpi_allgather (
h5_file_t * const f,
const void * sendbuf,
const int sendcount,
const MPI_Datatype sendtype,
void * recvbuf,
const int recvcount,
const MPI_Datatype recvtype,
const MPI_Comm comm
) {
int err = MPI_Allgather (
sendbuf,
sendcount,
sendtype,
recvbuf,
recvcount,
recvtype,
comm );
if ( err != MPI_SUCCESS )
return h5_error (
f,
H5_ERR_MPI,
"Cannot gather data." );
return H5_SUCCESS;
}
h5_err_t
_h5_mpi_comm_size (
h5_file_t * const f,
MPI_comm comm,
int *size
) {
int err = MPI_Comm_size ( comm, size );
if ( err != MPI_SUCCESS )
h5_error (
f,
H5_ERR_MPI,
"Cannot get number of processes in my group." );
return H5_SUCCESS;
}
h5_err_t
_h5_mpi_comm_rank (
h5_file_t * const f,
MPI_comm comm,
int *rank
) {
int err = MPI_Comm_rank ( comm, rank );
if ( err != MPI_SUCCESS )
h5_error (
f,
H5_ERR_MPI,
"Cannot get rank of the calling process in my group." );
return H5_SUCCESS;
}
#endif
+31
View File
@@ -0,0 +1,31 @@
#ifndef __H5_MPI_PRIVATE_H
#define __H5_MPI_PRIVATE_H
#ifdef PARALLEL_IO
h5_err_t
_h5_mpi_allgather (
h5_file_t * const f,
const void * sendbuf,
const int sendcount,
const MPI_Datatype sendtype,
void * recvbuf,
const int recvcount,
const MPI_Datatype recvtype,
const MPI_Comm comm
);
h5_err_t
_h5_mpi_comm_size (
h5_file_t * const f,
MPI_comm comm,
int *size
);
h5_err_t
_h5_mpi_comm_rank (
h5_file_t * const f,
MPI_comm comm,
int *rank
);
#endif
#endif