Example #1
0
def main(argv):
    bgps = []
    FNULL = open(os.devnull, 'w')
    for i in range(0, 5):
        p = Popen(['mono', '../TestingApplication/bin/Release/TestingApplication.exe', 
            '-server' + str(11000 + i), '../TestingApplication/bin/Release/Cyclops_caida_new.txt'],
            stdout=FNULL, stderr=subprocess.STDOUT)
        bgps.append(p)
    
    time.sleep(5)

    '''
    threads = []
    for i in range(0, 10):
        t = compThread(i, (11000+i), (100 * i, 100 * (i+1)))
        t.start()
        threads.append(t)

    for t in threads:
        t.join()
    '''

    data = []
    for i in range(0, 5):
        data.append((11000+i, 100 * i, 100 * (i+1)))
    
    p = Pool(5)
    p.map(processAlexa, data)

    for p in bgps:
        p.terminate()
Example #2
0
def main(argv):
    bgps = []
    FNULL = open(os.devnull, 'w')
    for i in range(0, 5):
        p = Popen([
            'mono', '../TestingApplication/bin/Release/TestingApplication.exe',
            '-server' + str(11000 + i),
            '../TestingApplication/bin/Release/Cyclops_caida_new.txt'
        ],
                  stdout=FNULL,
                  stderr=subprocess.STDOUT)
        bgps.append(p)

    time.sleep(5)
    '''
    threads = []
    for i in range(0, 10):
        t = compThread(i, (11000+i), (100 * i, 100 * (i+1)))
        t.start()
        threads.append(t)

    for t in threads:
        t.join()
    '''

    data = []
    for i in range(0, 5):
        data.append((11000 + i, 100 * i, 100 * (i + 1)))

    p = Pool(5)
    p.map(processAlexa, data)

    for p in bgps:
        p.terminate()
Example #3
0
File: jobs.py Project: pwaller/pwa
def submit(self, params):
    tag = get_tag()
    
    if tag != "dryrun" or params.dry_run:
        p = Popen(["./prepare_submit.sh"])
        assert not p.wait()
    
    from multiprocessing import Pool
    p = Pool(4)
    
    p.map(submit_job, [(job, tag, tag == "dryrun") for job in params.jobs])