Changeset 1905
- Timestamp:
- Nov 20, 2013, 2:08:45 PM (11 years ago)
- Location:
- LMDZ5/trunk/libf/phylmd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/phylmd/mod_phys_lmdz_omp_transfert.F90
r1279 r1905 48 48 49 49 50 PUBLIC bcast_omp,scatter_omp,gather_omp,reduce_sum_omp 50 PUBLIC bcast_omp,scatter_omp,gather_omp,reduce_sum_omp, omp_barrier 51 51 52 52 CONTAINS 53 53 54 SUBROUTINE omp_barrier 55 IMPLICIT NONE 56 57 !$OMP BARRIER 58 59 END SUBROUTINE omp_barrier 60 54 61 SUBROUTINE check_buffer_i(buff_size) 55 62 IMPLICIT NONE -
LMDZ5/trunk/libf/phylmd/mod_synchro_omp.F90
r987 r1905 1 1 MODULE mod_synchro_omp 2 2 3 LOGICAL,SAVE,ALLOCATABLE :: flag_omp(:)4 3 INTEGER,SAVE :: exit_omp 4 5 5 CONTAINS 6 6 … … 8 8 USE mod_phys_lmdz_para 9 9 IMPLICIT NONE 10 11 IF (is_omp_root) THEN12 ALLOCATE(flag_omp(0:omp_size-1)) 13 flag_omp(:)=.FALSE.14 ENDIF 15 !$OMP BARRIER 10 11 CALL omp_barrier 12 !$OMP MASTER 13 exit_omp=0 14 !$OMP END MASTER 15 CALL omp_barrier 16 16 17 17 END SUBROUTINE Init_Synchro_omp 18 18 19 SUBROUTINE Synchro_omp 19 SUBROUTINE Synchro_omp 20 20 USE mod_phys_lmdz_para 21 21 IMPLICIT NONE 22 LOGICAL :: out 22 23 23 flag_omp(omp_rank)=.TRUE.24 out=.FALSE. 24 25 !$OMP BARRIER 25 DO WHILE (.NOT. ALL(flag_omp)) 26 !$OMP BARRIER 27 !$OMP ATOMIC 28 exit_omp=exit_omp+1 29 !$OMP BARRIER 30 !$OMP BARRIER 31 IF (exit_omp==omp_size) THEN 32 out=.TRUE. 33 ENDIF 34 35 DO WHILE (.NOT. out) 36 !$OMP BARRIER 37 IF (exit_omp==omp_size) out=.TRUE. 26 38 !$OMP BARRIER 27 39 ENDDO 28 !$OMP BARRIER 29 flag_omp(omp_rank)=.FALSE. 40 41 !$OMP BARRIER 42 !$OMP MASTER 43 exit_omp=0 44 !$OMP END MASTER 30 45 !$OMP BARRIER 31 46 32 END SUBROUTINE Synchro_omp 47 IF (exit_omp/=0) THEN 48 STOP 'synchro_omp' 49 ENDIF 50 51 END SUBROUTINE Synchro_omp 52 33 53 34 54 END MODULE mod_synchro_omp
Note: See TracChangeset
for help on using the changeset viewer.