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 @@ -737,15 +737,14 @@ PREFIX (init) (int *argc, char ***argv)
737
737
if (caf_num_images == 0 )
738
738
{
739
739
int ierr = 0 , i = 0 , j = 0 , rc ;
740
-
741
- int is_init = 0 , prior_thread_level = MPI_THREAD_SINGLE ;
740
+ int prov_lev = 0 ;
741
+ int is_init = 0 , prior_thread_level = MPI_THREAD_FUNNELED ;
742
742
MPI_Initialized (& is_init );
743
743
744
744
if (is_init ) {
745
745
MPI_Query_thread (& prior_thread_level );
746
746
}
747
747
#ifdef HELPER
748
- int prov_lev = 0 ;
749
748
if (is_init ) {
750
749
prov_lev = prior_thread_level ;
751
750
caf_owns_mpi = false;
@@ -758,10 +757,12 @@ PREFIX (init) (int *argc, char ***argv)
758
757
caf_runtime_error ("MPI_THREAD_MULTIPLE is not supported: %d" , prov_lev );
759
758
#else
760
759
if (is_init ) {
761
- caf_owns_mpi = false;
760
+ caf_owns_mpi = false;
762
761
} else {
763
- MPI_Init (argc , argv );
764
- caf_owns_mpi = true;
762
+ MPI_Init_thread (argc , argv , prior_thread_level , & prov_lev );
763
+ caf_owns_mpi = true;
764
+ if (caf_this_image == 0 && MPI_THREAD_FUNNELED != prov_lev )
765
+ caf_runtime_error ("MPI_THREAD_FUNNELED is not supported: %d" , prov_lev );
765
766
}
766
767
#endif
767
768
if (unlikely ((ierr != MPI_SUCCESS )))
You can’t perform that action at this time.
0 commit comments