Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AGULLO Emmanuel
Chameleon
Commits
83ed8667
Commit
83ed8667
authored
Feb 11, 2015
by
PRUVOST Florent
Browse files
avoid to call MPI_Finalize if MPI has been initialized by user
parent
10286ffe
Changes
2
Hide whitespace changes
Inline
Side-by-side
control/control.c
View file @
83ed8667
...
...
@@ -110,7 +110,7 @@ int MORSE_InitPar(int nworkers, int ncudas, int nthreads_per_worker)
return MORSE_ERR_NOT_FOUND;
}
nworkers = morse->world_size;
/* Get the size of each NUMA node */
morse->group_size = morse_get_numthreads_numa();
while ( ((morse->world_size)%(morse->group_size)) != 0 )
...
...
@@ -121,6 +121,7 @@ int MORSE_InitPar(int nworkers, int ncudas, int nthreads_per_worker)
{
int
flag
=
0
,
provided
=
0
;
MPI_Initialized
(
&
flag
);
morse
->
mpi_outer_init
=
flag
;
if
(
!
flag
)
{
MPI_Init_thread
(
NULL
,
NULL
,
MPI_THREAD_MULTIPLE
,
&
provided
);
}
...
...
@@ -160,7 +161,8 @@ int MORSE_Finalize(void)
morse_context_destroy
();
#if defined(CHAMELEON_USE_MPI)
MPI_Barrier
(
MPI_COMM_WORLD
);
MPI_Finalize
();
if
(
!
morse
->
mpi_outer_init
)
MPI_Finalize
();
#endif
return
MORSE_SUCCESS
;
...
...
include/morse_struct.h
View file @
83ed8667
...
...
@@ -139,7 +139,8 @@ typedef struct morse_context_s {
int
nbnbsize
;
// tile size in elements (possibly padded)
int
ibnbsize
;
// T or L tile size in elements (---''---)
int
rhblock
;
// block size for tree-based (reduction) Householder
void
*
schedopt
;
void
*
schedopt
;
// structure for runtimes
int
mpi_outer_init
;
// MPI has been initialized outside our functions
}
MORSE_context_t
;
...
...
Write
Preview
Supports
Markdown
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