File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 9090extern  bool  ompi_enable_timing ;
9191extern  bool  ompi_enable_timing_ext ;
9292
93+ static  void  fence_cbfunc (int  status , void  * cbdata )
94+ {
95+   volatile  bool  * active  =  (volatile  bool * )cbdata ;
96+   * active  =  false;
97+ }
98+ 
9399int  ompi_mpi_finalize (void )
94100{
95101    int  ret  =  MPI_SUCCESS ;
96102    opal_list_item_t  * item ;
97103    ompi_proc_t * *  procs ;
98104    size_t  nprocs ;
105+     volatile  bool  active ;
99106    OPAL_TIMING_DECLARE (tm );
100107    OPAL_TIMING_INIT_EXT (& tm , OPAL_TIMING_GET_TIME_OF_DAY );
101108
@@ -239,7 +246,14 @@ int ompi_mpi_finalize(void)
239246       del_procs behavior around May of 2014 (see 
240247       https://svn.open-mpi.org/trac/ompi/ticket/4669#comment:4 for 
241248       more details). */ 
242-     opal_pmix .fence (NULL , 0 );
249+     if  (NULL  !=  opal_pmix .fence_nb ) {
250+       active  =  true;
251+       opal_pmix .fence_nb (NULL , 0 , fence_cbfunc , (void * )& active );
252+       OMPI_WAIT_FOR_COMPLETION (active );
253+     } else  {
254+       MPI_Barrier (MPI_COMM_WORLD );
255+       opal_pmix .fence (NULL , 0 );
256+     }
243257
244258    /* check for timing request - get stop time and report elapsed 
245259     time if so */ 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments