File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -731,15 +731,14 @@ PREFIX (init) (int *argc, char ***argv)
731
731
if (caf_num_images == 0 )
732
732
{
733
733
int ierr = 0 , i = 0 , j = 0 , rc ;
734
-
735
- int is_init = 0 , prior_thread_level = MPI_THREAD_SINGLE ;
734
+ int prov_lev = 0 ;
735
+ int is_init = 0 , prior_thread_level = MPI_THREAD_FUNNELED ;
736
736
MPI_Initialized (& is_init );
737
737
738
738
if (is_init ) {
739
739
MPI_Query_thread (& prior_thread_level );
740
740
}
741
741
#ifdef HELPER
742
- int prov_lev = 0 ;
743
742
if (is_init ) {
744
743
prov_lev = prior_thread_level ;
745
744
caf_owns_mpi = false;
@@ -752,10 +751,12 @@ PREFIX (init) (int *argc, char ***argv)
752
751
caf_runtime_error ("MPI_THREAD_MULTIPLE is not supported: %d" , prov_lev );
753
752
#else
754
753
if (is_init ) {
755
- caf_owns_mpi = false;
754
+ caf_owns_mpi = false;
756
755
} else {
757
- MPI_Init (argc , argv );
758
- caf_owns_mpi = true;
756
+ MPI_Init_thread (argc , argv , prior_thread_level , & prov_lev );
757
+ caf_owns_mpi = true;
758
+ if (caf_this_image == 0 && MPI_THREAD_FUNNELED != prov_lev )
759
+ caf_runtime_error ("MPI_THREAD_FUNNELED is not supported: %d" , prov_lev );
759
760
}
760
761
#endif
761
762
if (unlikely ((ierr != MPI_SUCCESS )))
You can’t perform that action at this time.
0 commit comments