source: tbroadcast/v2/scripts/tbroadcast @ 237

Last change on this file since 237 was 237, checked in by garonne, 18 years ago

corrige initialisation

  • Property svn:executable set to *
File size: 919 bytes
Line 
1#!/usr/bin/env python2
2#----------------------------------#
3# -- Author: V.Garonne
4# -- Date: 08/25/2006
5# -- Name: tbroadcast
6# -- Description: main program
7#----------------------------------#
8
9import os
10import sys
11import string
12
13from tbroadcast import Scheduler
14
15if __name__ == '__main__':
16
17    if len(sys.argv) ==1 :
18        print 'Usage : > tbroadcast [-nb=<num_worker>] <command>'
19        sys.exit(-1)   
20    num_worker = 20   
21    for arg in sys.argv:           
22         if arg[0]=='-':
23             if string.split(arg,'=')[0] == '-nb':
24                num_worker = int (string.split(arg,'=')[1])         
25         else:
26              command = arg
27                     
28    # we create a pool of num_worker worker threads
29    #print 'num_worker', num_worker , command
30    master = Scheduler (num_workers=num_worker)       
31    master.execute_all (command)
32
33    sys.exit(-1);
34#--------- EoF --------#   
Note: See TracBrowser for help on using the repository browser.