1 | ! Parallel tools : Barrier and Finalize. |
---|
2 | |
---|
3 | !- |
---|
4 | !- $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_parallel/tools_para.f90,v 1.3 2008/10/13 14:19:47 ssipsl Exp $ |
---|
5 | !- |
---|
6 | |
---|
7 | MODULE tools_para |
---|
8 | !- |
---|
9 | USE ioipsl |
---|
10 | USE defprec |
---|
11 | USE timer |
---|
12 | USE data_para |
---|
13 | !- |
---|
14 | #include "src_parallel.h" |
---|
15 | !- |
---|
16 | CONTAINS |
---|
17 | SUBROUTINE stop_mpi() |
---|
18 | #ifdef CPP_PARA |
---|
19 | CALL MPI_COMM_FREE(MPI_COMM_ORCH,ierr) |
---|
20 | CALL MPI_FINALIZE(ierr) |
---|
21 | #endif |
---|
22 | CALL ipslerr(3,'STOP_MPI','MPI has been stopped in ORCHIDEE.',& |
---|
23 | & "Don't know the reason","Please verify output.") |
---|
24 | ENd subroutine stop_mpi |
---|
25 | |
---|
26 | SUBROUTINE barrier_para() |
---|
27 | #ifdef CPP_PARA |
---|
28 | CALL MPI_BARRIER(MPI_COMM_ORCH,ierr) |
---|
29 | #endif |
---|
30 | END SUBROUTINE barrier_para |
---|
31 | |
---|
32 | SUBROUTINE finalize_para(timer_global,timer_mpi) |
---|
33 | INTEGER, INTENT(IN) :: timer_global, timer_mpi |
---|
34 | DOUBLE PRECISION :: cpu_time_mpi |
---|
35 | |
---|
36 | cpu_time_mpi = Get_cpu_time(timer_mpi) |
---|
37 | WRITE(numout,*) '*********************************************************' |
---|
38 | WRITE(numout,*) ' TEMPS GLOBAL ---> REAL TIME :',Get_real_time(timer_global) |
---|
39 | WRITE(numout,*) ' TEMPS GLOBAL ---> CPU TIME :',Get_cpu_time(timer_global) |
---|
40 | WRITE(numout,*) ' TEMPS HORS MPI ---> REAL TIME :',Get_real_time(timer_mpi) |
---|
41 | WRITE(numout,*) ' TEMPS HORS MPI ---> CPU TIME :',cpu_time_mpi |
---|
42 | WRITE(numout,*) '*********************************************************' |
---|
43 | WRITE(numout,*) 'END OF RUN.' |
---|
44 | |
---|
45 | CALL Write_Load_Balance(REAL(cpu_time_mpi, r_std)) |
---|
46 | #ifdef CPP_PARA |
---|
47 | ! CALL MPI_COMM_FREE(MPI_COMM_ORCH,ierr) |
---|
48 | CALL MPI_FINALIZE(ierr) |
---|
49 | #endif |
---|
50 | END SUBROUTINE finalize_para |
---|
51 | |
---|
52 | END MODULE tools_para |
---|