Ignore:
Timestamp:
Aug 30, 2006, 12:31:45 PM (18 years ago)
Author:
garonne
Message:

enhance severals things

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tbroadcast/v2/scripts/tbroadcast

    r241 r242  
    11#!/usr/bin/env python
    22#----------------------------------#
    3 # -- Author: V.Garonne
     3# -- Author: V. Garonne
     4# -- Mail: garonne@lal.in2p3.fr
    45# -- Date: 08/25/2006
    56# -- Name: tbroadcast
     
    1819    print '#   <command>: command to execute'
    1920    print '# global options :'
    20     print '#   -nb=<num_worker>]                  : Total number of threads'
    21     print '#   -help]                             : Print help'
     21    print '#   -nb=<num_worker>]     : Total number of threads'
     22    print '#   -test                 : Simulate execution'
     23    print '#   -check                : Check execution (deadlocks)'
     24    print '#   -print                : Print dependency graph'   
     25    print '#   -help]                : Print help'
    2226
    2327if __name__ == '__main__':
    2428    # Default options
    25     num_worker = 20
    26     command    = ''   
     29    num_worker  = 20
     30    command     = ''
     31    test        = False
     32    check       = False
     33    print_graph = False
    2734    for arg in sys.argv[1:len(sys.argv)]:           
    2835         if arg[0]=='-':
     
    3037             if option == '-nb':
    3138                num_worker = int (string.split(arg,'=')[1])         
     39             elif option == '-test':
     40                 test = True   
     41             elif option == '-check':
     42                 check = True   
     43             elif option == '-print':
     44                 print_graph = True   
    3245             else:
    3346                usage()
    34                 sys.exit(-1)   
    35                
     47                sys.exit(-1)     
    3648         else:
    3749              command = arg
    3850
    39     master = Scheduler (num_workers=num_worker)
    40     master.execute_all (command)
    41 
     51    master = Scheduler (num_workers=num_worker)   
     52    if test:
     53        master.simulate_execution()
     54    elif check:
     55        master.check_execution (package=master.get_current_package())   
     56    elif print_graph:
     57        master.print_dependencies ()
     58    else:
     59        master.execute_all (command)
    4260    sys.exit(-1);
    43 #--------- EoF --------#   
     61#--------- EoF --------#
Note: See TracChangeset for help on using the changeset viewer.