Changeset 248 for tbroadcast


Ignore:
Timestamp:
Sep 25, 2006, 3:39:11 PM (18 years ago)
Author:
garonne
Message:

Mise au propre option + script generateGantt

Location:
tbroadcast/HEAD
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tbroadcast/HEAD/python/tbroadcast.py

    r245 r248  
    3939        self.silent          = silent
    4040        self.perf            = perf
    41         if self.perf:
    42             f = open ('performances.log', 'w+')
     41        if self.perf is not False:
     42            f = open (self.perf, 'w+')
    4343            f.close()
    4444        if output is not None:
     
    444444      if self.perf:
    445445          self.semaphore.acquire ()       
    446           f = open ('performances.log', 'a')
     446          f = open (self.perf, 'a')
    447447          f.write (arg['package']+" "+str(self.packages[arg['package']] ['startTime'])+" "+str(self.packages[arg['package']] ['endTime'] )+'\n') 
    448448          f.close()
  • tbroadcast/HEAD/scripts/generateGantt

    r247 r248  
    11#!/usr/bin/env python
     2#----------------------------------#
     3# -- Author: V. Garonne
     4# -- Mail: garonne@lal.in2p3.fr
     5# -- Date: 08/25/2006
     6# -- Name: generateGantt
     7# -- Description: script to generate
     8# -- the gantt chart from a input file
     9# -- It uses Paw.
     10#----------------------------------#
    211
    312import os
     
    514import time
    615import string
     16import commands
     17
     18def usage ():
     19    print 'Usage : > generateGannt <input file>'
    720
    821if __name__ == '__main__':
    9     file = sys.argv[1]
    10     f = open (file)
     22    if len(sys.argv) != 2:
     23        usage ()
     24        sys.exit(-1)
     25   
     26    # First read the file   
     27    file  = sys.argv[1]
     28    f     = open (file)
    1129    lines = f.readlines()
    1230    f.close ()
     31   
     32    # Instanciate constants
    1333    total = len(lines)
    1434    min   = time.time()
     
    2242            max = float(end)
    2343
     44    # then compute for each package its line
    2445    packages = {}
    2546    for line in lines:
     
    4061                    packages[package]['index']= index
    4162                    done.append(package)
    42                     print i,index, package
     63                    #print i,index, package
    4364            if not package in start:
    4465                if packages[package]['start']> i:       
     
    5071    y = 0
    5172    for package in packages:
     73        print package
    5274        if packages[package]['index'] > y:
    5375            y = packages[package]['index']
     
    105127
    106128    f = open ("exec.kumac", "w+")
    107     f.write  ("\n\n kumac/"+string.lower(Site)+".kumac")
     129    f.write  ("\n\n gantt.kumac")
    108130    f.close  ()
    109131
    110     status, output = commands.getstatusoutput ("paw<exec.kumac")
    111 #    status, output = commands.getstatusoutput (cmd)
    112 #
    113 #           
    114 #   
    115 #    for package in packages:
    116 #        #print packages[package]['start'], packages[package]['end']
    117 #        concurent = list()
    118 #        for pack in packages:           
    119 #            if (packages[package]['start'] < packages[pack]['start'] and packages[pack]['start'] < packages[package]['end'])\
    120 #            or (packages[package]['start'] < packages[pack]['end'] and packages[pack]['end'] < packages[package]['end']):           
    121 #                concurent.append (pack)
    122 #        packages[package]['concurent'] =  concurent
    123 #
    124 #    total = 0
    125 #    for package in packages:
    126 #        if len(packages[package]['concurent'])> total:
    127 #            total = len(packages[package]['concurent'])       
    128 #        if not packages[package].has_key('index'):
    129 #            index = 1
    130 #            for pack in packages[package]['concurent']:           
    131 #                if packages[package]['end']<packages[pack]['end']:
    132 #                    index = index + 1
    133 #            packages[package]['index'] = index
    134 #
     132    status, output = commands.getstatusoutput ("paw<exec.kumac")   
     133#--------- EoF --------#
  • tbroadcast/HEAD/scripts/tbroadcast

    r245 r248  
    1919    print '#   <command>: command to execute'
    2020    print '# global options :'
    21     print '#   -check                : Check execution (deadlocks)'
    2221    print '#   -f=<file>             : Input file'
    2322    print '#   -help                 : Print help'
    24     print '#   -local                : '
    25     print '#   -ignore_cycles        : '
    26     print '#   -nb=<num_worker>      : Total number of threads'
     23    print '#   -local                : Reach packages only within the current project'
     24    print '#   -global               : Reach packages in all CMTPATH/CMTPROJECTPATH items'   
     25    print '#   -ignore_cycles        : Suppress automatically the cycles'
     26    print '#   -nb=<num_worker>      : Change the total number of threads[default is 20]'
    2727    print '#   -output=<location>    : Output directory to store output files with the form <package>_output.log'
    2828    print '#   -error=<location>     : Output directory to store error output with the form <package>_error.log'
    29     print '#   -print                : Print dependency graph'
     29    print '#   -perf=<file>          : Store for each package the time for executing the command in the <file> file'
     30    print '#   -print                : Print dependencies for each package'
     31    print '#   -silent               : Disable print'     
    3032    print '#   -test                 : Simulate execution'
    3133
     
    5254                file = string.split(arg,'=')[1]
    5355             if option == '-perf':
    54                 perf = True
     56                perf = string.split(arg,'=')[1]
    5557             if option == '-output':
    5658                output = string.split(arg,'=')[1]
Note: See TracChangeset for help on using the changeset viewer.