Changeset 115 for trunk


Ignore:
Timestamp:
05/30/05 10:54:38 (19 years ago)
Author:
bastiaans
Message:

toga/conf.php, toga/libtoga.php:

  • Will now use a 'J' marking for all nodes with a running job Not depending on number of cpus in use anymore

toga/overview.php:

  • Fixed makeTime()
Location:
trunk/web/addons/toga
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/addons/toga/conf.php

    r111 r115  
    1818// singlecpu when less than all cpus are in use
    1919//
    20 $JOB_NODE_MARKING_ALLCPUS = "J";
    21 $JOB_NODE_MARKING_SINGLECPU = "j";
     20//$JOB_NODE_MARKING_ALLCPUS = "J";
     21//$JOB_NODE_MARKING_SINGLECPU = "j";
     22$JOB_NODE_MARKING = "J";
    2223
    2324// XML Datasource for Toga
  • trunk/web/addons/toga/libtoga.php

    r114 r115  
    391391
    392392                global $SMALL_CLUSTERIMAGE_NODEWIDTH, $JOB_NODE_MARKING_ALLCPUS, $JOB_NODE_MARKING_SINGLECPU;
     393                global $JOB_NODE_MARKING;
    393394
    394395                $this->load = $this->determineLoad();
     
    417418
    418419                if( count( $this->jobs ) > 0 )
    419 
    420                         if( $this->tasks < $this->cpus )
    421                                 $node_mark = $JOB_NODE_MARKING_SINGLECPU;
    422 
    423                         else if( $this->tasks == $this->cpus )
    424                                 $node_mark = $JOB_NODE_MARKING_ALLCPUS;
     420                        $node_mark = $JOB_NODE_MARKING;
     421
     422                //      if( $this->tasks < $this->cpus )
     423                //              $node_mark = $JOB_NODE_MARKING_SINGLECPU;
     424
     425                //      else if( $this->tasks == $this->cpus )
     426                //              $node_mark = $JOB_NODE_MARKING_ALLCPUS;
    425427
    426428                if( $node_mark )
  • trunk/web/addons/toga/overview.php

    r114 r115  
    3333
    3434        $days = intval( $time / 86400 );
     35        $time = $days ? $time % ($days * 86400) : $time;
     36
    3537        if( $days > 0 ) {
    36                 $time = $time % ($days * 86400);
    3738                if( $days > 1 )
    3839                        $date_str .= $days . 'days - ';
     
    4041                        $date_str .= $days . 'day - ';
    4142        }
     43
    4244        $hours = intval( $time / 3600 );
     45        $time = $hours ? $time % ($hours * 3600) : $time;
     46
    4347        if( $hours > 0 ) {
    44                 $time = $time % ($hours * 3600);
    4548                $date_str .= $hours . ':';
    4649                $date_unit = ' hours';
    4750        }
     51               
    4852        $minutes = intval( $time / 60 );
     53        $seconds = $minutes ? $time % ($minutes * 60) : $time;
     54
    4955        if( $minutes > 0 ) {
    50                 $seconds = $time % ($minutes * 60);
    51                 $date_str .= $minutes . ':';
     56
     57                if( $minutes >= 10 )
     58                        $date_str .= $minutes . ':';
     59                else
     60                        $date_str .= '0' . $minutes . ':';
     61
    5262                $date_unit = (!isset($date_unit)) ? 'minutes' : $date_unit;
    53         }
     63        } else if( $days > 0 or $hours > 0 ) {
     64                $date_str .= '00:';
     65                $date_unit = (!isset($date_unit)) ? 'minutes' : $date_unit;
     66        }
     67
    5468        $date_unit = (!isset($date_unit)) ? 'seconds' : $date_unit;
    55         $date_str .= $seconds . ' ' . $date_unit;
     69
     70        if( $seconds > 0 ) {
     71
     72                if( $seconds >= 10 )
     73                        $date_str .= $seconds . ' ' . $date_unit;
     74                else
     75                        $date_str .= '0' . $seconds . ' ' . $date_unit;
     76                       
     77        } else if ( $days > 0 or $hours > 0 or $minutes > 0 )
     78                $date_str .= '00 ' . $date_unit;
    5679
    5780        return $date_str;
Note: See TracChangeset for help on using the changeset viewer.