SUBROUTINE local_tremain( remaining_time ) !------------------------------------------------------------------------------! ! Actual revisions: ! ----------------- ! ! ! Former revisions: ! ----------------- ! $Log: local_tremain.f90,v $ ! Revision 1.14 2006/06/02 15:20:33 raasch ! Extended to TIT Sun Fire X4600 System (lctit) ! ! Revision 1.13 2003/05/09 14:39:55 raasch ! Time measurement on IBM is now done using function irtc, which allows correct ! measurements for jobs running over the 24:00 timeline ! ! Revision 1.12 2003/03/16 09:41:49 raasch ! Two underscores (_) are placed in front of all define-strings ! ! Revision 1.11 2003/03/14 13:44:20 raasch ! Print statement for testing removed ! ! Revision 1.10 2003/03/12 16:33:55 raasch ! Extended to NEC-SX6 systems ! ! Revision 1.9 2002/12/19 15:49:17 raasch ! Extended to IBM-Regatta systems ! ! Revision 1.8 2001/03/30 07:35:00 raasch ! Translation of remaining German identifiers (variables, subroutines, etc.) ! ! Revision 1.7 2001/01/22 08:34:53 raasch ! Module test_variables removed ! ! Revision 1.5 1998/07/16 06:51:44 raasch ! cpp-Direktiven fuer t3ej2 und t3ej5 erweitert ! ! Revision 1.4 1998/07/06 12:19:02 raasch ! + USE test_variables ! ! Revision 1.3 1998/03/24 15:27:23 raasch ! Zeitbestimmung auf t3eh aufgenommen ! ! Revision 1.2 1998/03/23 08:39:53 raasch ! Bestimmung der verbleibenden Zeit auf vpp ergaenzt ! ! Revision 1.1 1998/03/18 20:14:47 raasch ! Initial revision ! ! ! Description: ! ------------ ! For different operating systems get the remaining cpu-time of the job !------------------------------------------------------------------------------! USE control_parameters USE cpulog USE pegrid IMPLICIT NONE REAL :: remaining_time !#if defined( __vpp ) ! REAL :: cpu_time_used, rdum !#endif #if defined( __ibm ) INTEGER(8) :: IRTC REAL :: actual_wallclock_time #elif defined( __lctit ) INTEGER :: count, count_rate REAL :: actual_wallclock_time #endif #if defined( __t3eh ) || defined( __t3eb ) || defined( __t3ej2 ) || defined( __t3ej5 ) CALL MPP_TREMAIN( remaining_time ) !#elif defined( __vpp ) ! ! CALL CLOCKV( rdum, cpu_time_used, 0, 2 ) ! remaining_time = maximum_cpu_time_allowed - cpu_time_used #elif defined( __ibm ) ! CALL SYSTEM_CLOCK( count, count_rate ) ! actual_wallclock_time = REAL( count ) / REAL( count_rate ) actual_wallclock_time = IRTC( ) * 1E-9 remaining_time = maximum_cpu_time_allowed - & ( actual_wallclock_time - initial_wallclock_time ) #elif defined( __lctit ) CALL SYSTEM_CLOCK( count, count_rate ) actual_wallclock_time = REAL( count ) / REAL( count_rate ) remaining_time = maximum_cpu_time_allowed - & ( actual_wallclock_time - initial_wallclock_time ) #elif defined( __nec ) CALL TREMAIN( remaining_time ) remaining_time = remaining_time / tasks_per_node #else ! !-- No stop due to running out of cpu-time on other machines remaining_time = 9999999.9 #endif END SUBROUTINE local_tremain