Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
H5hut
src
Commits
c9044d8e
Commit
c9044d8e
authored
Jul 01, 2016
by
gsell
Browse files
src/h5core/private/h5_init.{c,h}
- initialize MPI if not yet done
parent
5b57beda
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
src/h5core/private/h5_init.c
src/h5core/private/h5_init.c
+7
-1
src/h5core/private/h5_init.h
src/h5core/private/h5_init.h
+1
-0
No files found.
src/h5core/private/h5_init.c
View file @
c9044d8e
...
...
@@ -666,11 +666,17 @@ h5_err_t
h5priv_initialize
(
void
)
{
h5_initialized
=
1
;
memset
(
&
h5_call_stack
,
0
,
sizeof
(
h5_call_stack
));
// must be set here, otherwise next statement will fail!
h5_initialized
=
1
;
H5_CORE_API_ENTER
(
h5_err_t
,
"%s"
,
"void"
);
ret_value
=
H5_SUCCESS
;
#ifdef PARALLEL_IO
int
mpi_is_initialized
;
MPI_Initialized
(
&
mpi_is_initialized
);
if
(
!
mpi_is_initialized
)
{
MPI_Init
(
NULL
,
NULL
);
}
if
(
h5priv_mpi_comm_rank
(
MPI_COMM_WORLD
,
&
h5_myproc
)
<
0
)
{
exit
(
42
);
}
...
...
src/h5core/private/h5_init.h
View file @
c9044d8e
...
...
@@ -19,6 +19,7 @@
#if !defined (PARALLEL_IO)
typedef
int
MPI_Comm
;
#define MPI_Init(argc, argv)
#define MPI_Initialized () (1)
#define MPI_Comm_size(comm, nprocs) {(void)comm; *nprocs = 1; }
#define MPI_Comm_rank(comm, myproc) {(void)comm; *myproc = 0; }
#define MPI_Finalize()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment