Changeset 31 for trunk/gridctl.php
- Timestamp:
- Oct 13, 2017, 9:37:16 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gridctl.php
r29 r31 70 70 // Checking we need to do for each entry 71 71 echo "us3db=$us3_db gfid=$gfacID\n"; 72 //write_log( " us3db=$us3_db gfid=$gfacID" ); 72 73 switch ( $us3_db ) 73 74 { … … 99 100 $status = aira_status( $gfacID, $status_in ); 100 101 if($status != $status_in ) 101 write_log( "$loghdr Set to $status from $status_in" ); 102 write_log( "$loghdr Set to $status from $status_in" ); 103 //write_log( "$loghdr aira status=$status" ); 102 104 } 103 105 else if ( is_gfac_job( $gfacID ) ) … … 112 114 else 113 115 { 116 //write_log( "$loghdr Local gfacID=$gfacID" ); 114 117 $status_gw = $status; 115 118 $status = get_local_status( $gfacID ); … … 136 139 137 140 //echo " st=$status\n"; 141 //write_log( "$loghdr switch status=$status" ); 138 142 switch ( $status ) 139 143 { … … 174 178 case "COMPLETED": 175 179 case "COMPLETE": 176 write_log( "$loghdr COMPLETE gfacID=$gfacID" );180 //write_log( "$loghdr COMPLETE gfacID=$gfacID" ); 177 181 complete(); 178 182 break; … … 833 837 global $self; 834 838 835 $cmd = "/usr/bin/qstat -a $gfacID 2>&1|tail -n 1"; 839 $is_jetstr = preg_match( "/jetstream/", $cluster ); 840 if ( $is_jetstr ) 841 $cmd = "squeue -a $gfacID 2>&1|tail -n 1"; 842 else 843 $cmd = "/usr/bin/qstat -a $gfacID 2>&1|tail -n 1"; 836 844 //write_log( "$self cmd: $cmd" ); 837 845 //write_log( "$self cluster: $cluster" ); 838 846 //write_log( "$self gfacID: $gfacID" ); 847 839 848 if ( ! preg_match( "/us3iab/", $cluster ) ) 840 849 { 841 850 $system = "$cluster.uthscsa.edu"; 851 if ( $is_jetstr ) 852 $system = "$cluster"; 842 853 $system = preg_replace( "/\-local/", "", $system ); 843 //write_log( "$self system: $system" );844 854 $cmd = "/usr/bin/ssh -x us3@$system " . $cmd; 845 855 //write_log( "$self cmd: $cmd" ); … … 849 859 //write_log( "$self result: $result" ); 850 860 851 if ( $result == "" || preg_match( "/^qstat: Unknown/", $result ) ) 861 /////////////////////////////////////////////////////////////////// 862 $secwait = 2; 863 $num_try = 0; 864 // Sleep and retry up to 3 times if ssh has "ssh_exchange_identification" error 865 while ( preg_match( "/ssh_exchange_id/", $result ) && $num_try < 3 ) 866 { 867 sleep( $secwait ); 868 $num_try++; 869 $secwait *= 2; 870 write_log( "$me: num_try=$num_try secwait=$secwait" ); 871 } 872 /////////////////////////////////////////////////////////////////// 873 if ( $result == "" || 874 preg_match( "/^qstat: Unknown/", $result ) || 875 preg_match( "/ssh_exchange_id/", $result ) ) 852 876 { 853 877 write_log( "$self get_local_status: Local job $gfacID unknown" ); … … 857 881 858 882 $values = preg_split( "/\s+/", $result ); 859 //write_log( "$self: get_local_status: job status = /{$values[9]}/"); 860 switch ( $values[ 9 ] ) 883 $jstat = ( $is_jetstr == 0 ) ? $values[ 9 ] : $values[ 4 ]; 884 //write_log( "$self: get_local_status: job status = /$jstat/"); 885 switch ( $jstat ) 861 886 { 862 887 case "W" : // Waiting for execution time to be reached … … 873 898 case "H" : // Held 874 899 case "Q" : // Queued 900 case "PD" : // Queued 875 901 $status = 'SUBMITTED'; 876 902 break; … … 1079 1105 if ( preg_match( "/US3-A/i", $gfacID ) && $devmatch ) 1080 1106 { 1107 //write_log( "$loghdr status_in=$status_in status=$status gfacID=$gfacID" ); 1081 1108 $status_ex = getExperimentStatus( $gfacID ); 1109 //write_log( "$loghdr status_ex=$status_ex" ); 1082 1110 1083 1111 if ( $status_ex == 'COMPLETED' )
Note:
See TracChangeset
for help on using the changeset viewer.