[1] | 1 | SUBROUTINE local_tremain( remaining_time ) |
---|
| 2 | |
---|
| 3 | !------------------------------------------------------------------------------! |
---|
| 4 | ! Actual revisions: |
---|
| 5 | ! ----------------- |
---|
| 6 | ! |
---|
| 7 | ! |
---|
| 8 | ! Former revisions: |
---|
| 9 | ! ----------------- |
---|
| 10 | ! $Log: local_tremain.f90,v $ |
---|
| 11 | ! Revision 1.14 2006/06/02 15:20:33 raasch |
---|
| 12 | ! Extended to TIT Sun Fire X4600 System (lctit) |
---|
| 13 | ! |
---|
| 14 | ! Revision 1.13 2003/05/09 14:39:55 raasch |
---|
| 15 | ! Time measurement on IBM is now done using function irtc, which allows correct |
---|
| 16 | ! measurements for jobs running over the 24:00 timeline |
---|
| 17 | ! |
---|
| 18 | ! Revision 1.12 2003/03/16 09:41:49 raasch |
---|
| 19 | ! Two underscores (_) are placed in front of all define-strings |
---|
| 20 | ! |
---|
| 21 | ! Revision 1.11 2003/03/14 13:44:20 raasch |
---|
| 22 | ! Print statement for testing removed |
---|
| 23 | ! |
---|
| 24 | ! Revision 1.10 2003/03/12 16:33:55 raasch |
---|
| 25 | ! Extended to NEC-SX6 systems |
---|
| 26 | ! |
---|
| 27 | ! Revision 1.9 2002/12/19 15:49:17 raasch |
---|
| 28 | ! Extended to IBM-Regatta systems |
---|
| 29 | ! |
---|
| 30 | ! Revision 1.8 2001/03/30 07:35:00 raasch |
---|
| 31 | ! Translation of remaining German identifiers (variables, subroutines, etc.) |
---|
| 32 | ! |
---|
| 33 | ! Revision 1.7 2001/01/22 08:34:53 raasch |
---|
| 34 | ! Module test_variables removed |
---|
| 35 | ! |
---|
| 36 | ! Revision 1.5 1998/07/16 06:51:44 raasch |
---|
| 37 | ! cpp-Direktiven fuer t3ej2 und t3ej5 erweitert |
---|
| 38 | ! |
---|
| 39 | ! Revision 1.4 1998/07/06 12:19:02 raasch |
---|
| 40 | ! + USE test_variables |
---|
| 41 | ! |
---|
| 42 | ! Revision 1.3 1998/03/24 15:27:23 raasch |
---|
| 43 | ! Zeitbestimmung auf t3eh aufgenommen |
---|
| 44 | ! |
---|
| 45 | ! Revision 1.2 1998/03/23 08:39:53 raasch |
---|
| 46 | ! Bestimmung der verbleibenden Zeit auf vpp ergaenzt |
---|
| 47 | ! |
---|
| 48 | ! Revision 1.1 1998/03/18 20:14:47 raasch |
---|
| 49 | ! Initial revision |
---|
| 50 | ! |
---|
| 51 | ! |
---|
| 52 | ! Description: |
---|
| 53 | ! ------------ |
---|
| 54 | ! For different operating systems get the remaining cpu-time of the job |
---|
| 55 | !------------------------------------------------------------------------------! |
---|
| 56 | |
---|
| 57 | USE control_parameters |
---|
| 58 | USE cpulog |
---|
| 59 | USE pegrid |
---|
| 60 | |
---|
| 61 | IMPLICIT NONE |
---|
| 62 | |
---|
| 63 | REAL :: remaining_time |
---|
| 64 | !#if defined( __vpp ) |
---|
| 65 | ! REAL :: cpu_time_used, rdum |
---|
| 66 | !#endif |
---|
| 67 | #if defined( __ibm ) |
---|
| 68 | INTEGER(8) :: IRTC |
---|
| 69 | REAL :: actual_wallclock_time |
---|
| 70 | #elif defined( __lctit ) |
---|
| 71 | INTEGER :: count, count_rate |
---|
| 72 | REAL :: actual_wallclock_time |
---|
| 73 | #endif |
---|
| 74 | |
---|
| 75 | #if defined( __t3eh ) || defined( __t3eb ) || defined( __t3ej2 ) || defined( __t3ej5 ) |
---|
| 76 | |
---|
| 77 | CALL MPP_TREMAIN( remaining_time ) |
---|
| 78 | |
---|
| 79 | !#elif defined( __vpp ) |
---|
| 80 | ! |
---|
| 81 | ! CALL CLOCKV( rdum, cpu_time_used, 0, 2 ) |
---|
| 82 | ! remaining_time = maximum_cpu_time_allowed - cpu_time_used |
---|
| 83 | |
---|
| 84 | #elif defined( __ibm ) |
---|
| 85 | |
---|
| 86 | ! CALL SYSTEM_CLOCK( count, count_rate ) |
---|
| 87 | ! actual_wallclock_time = REAL( count ) / REAL( count_rate ) |
---|
| 88 | actual_wallclock_time = IRTC( ) * 1E-9 |
---|
| 89 | remaining_time = maximum_cpu_time_allowed - & |
---|
| 90 | ( actual_wallclock_time - initial_wallclock_time ) |
---|
| 91 | |
---|
| 92 | #elif defined( __lctit ) |
---|
| 93 | |
---|
| 94 | CALL SYSTEM_CLOCK( count, count_rate ) |
---|
| 95 | actual_wallclock_time = REAL( count ) / REAL( count_rate ) |
---|
| 96 | remaining_time = maximum_cpu_time_allowed - & |
---|
| 97 | ( actual_wallclock_time - initial_wallclock_time ) |
---|
| 98 | |
---|
| 99 | #elif defined( __nec ) |
---|
| 100 | |
---|
| 101 | CALL TREMAIN( remaining_time ) |
---|
| 102 | remaining_time = remaining_time / tasks_per_node |
---|
| 103 | |
---|
| 104 | #else |
---|
| 105 | |
---|
| 106 | ! |
---|
| 107 | !-- No stop due to running out of cpu-time on other machines |
---|
| 108 | remaining_time = 9999999.9 |
---|
| 109 | |
---|
| 110 | #endif |
---|
| 111 | |
---|
| 112 | END SUBROUTINE local_tremain |
---|