Ignore:
Timestamp:
03/25/13 12:52:33 (11 years ago)
Author:
ramonb
Message:

libtoga.php:

  • allow jobs and nodes to be set externally for ClusterImage?
  • ONLY parse XML if jobs and nodes not set externally

overview.php:

  • setJobs and setNodes on ClutserImage? (map) to prevent XML parsing
  • major speedup
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.4/web/addons/job_monarch/libtoga.php

    r742 r743  
    13111311        $this->height        = 0;
    13121312        $this->output        = 1;
     1313        $this->jobs         = null;
     1314        $this->nodes        = null;
    13131315    }
    13141316
     
    13331335        $this->output    = 0;
    13341336    }
     1337    function setJobs($jobs )
     1338    {
     1339        $this->jobs     = &$jobs;
     1340    }
     1341    function getJobs()
     1342    {
     1343        if( $this->jobs == null )
     1344        {
     1345            $mydatag = $this->dataget;
     1346            $mydatag->parseXML( $this->data );
     1347            $this->jobs = $mydatag->getJobs();
     1348        }
     1349
     1350        return $this->jobs;
     1351    }
     1352    function getNodes()
     1353    {
     1354        if( $this->nodes== null )
     1355        {
     1356            $mydatag = $this->dataget;
     1357            $mydatag->parseXML( $this->data );
     1358            $this->nodes = $mydatag->getNodes();
     1359        }
     1360
     1361        return $this->nodes;
     1362    }
     1363    function setNodes($nodes)
     1364    {
     1365        $this->nodes    = &$nodes;
     1366    }
    13351367    function isSmall()
    13361368    {
     
    13491381    {
    13501382        $filtered_nodes = array();
     1383
     1384        //print_r( $nodes );
    13511385
    13521386        foreach( $nodes as $node )
     
    14151449        }
    14161450
    1417         $mydatag = $this->dataget;
    1418         $mydatag->parseXML( $this->data );
    1419 
    14201451        if( $this->isSmall() )
    14211452        {
     
    14291460        }
    14301461
    1431         $nodes        = $mydatag->getNodes();
     1462        $nodes        = $this->getNodes();
    14321463        $nodes_hosts    = array_keys( $nodes );
    14331464
     
    14681499        $this->height    = ($y_offset + (($node_rows*$node_width)+1) );
    14691500
    1470         $jobs = $mydatag->getJobs();
     1501        $jobs = $this->getJobs();
    14711502        $filtered_nodes = $this->filterNodes( $jobs, $nodes );
    14721503
Note: See TracChangeset for help on using the changeset viewer.