source: tbroadcast/v2/scripts/tbroadcast @ 232

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

add version 2 in python

  • Property svn:executable set to *
File size: 885 bytes
Line 
1#!/usr/bin/env python
2#----------------------------------#
3# -- Author: V.Garonne
4# -- Date: 08/25/2006
5# -- Name: tbroadcast
6# -- Description: main program
7#----------------------------------#
8
9import os
10import sys
11
12from tbroadcast import Scheduler
13
14if __name__ == '__main__':
15
16    if len(sys.argv) ==1 :
17        print 'Usage : > tbroadcast <command>'
18        sys.exit(-1)
19   
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_worker=num_worker)       
31    master.execute_all (command)
32
33    sys.exit(-1);
34#--------- EoF --------#   
Note: See TracBrowser for help on using the repository browser.