Beispiel #1
0
def benchmark_pre (test_cfg, bench_cfg, session) :

    if  not 'job_service_url' in test_cfg :
        sumisc.benchmark_eval ('no job service URL configured')

    if  not 'load'        in bench_cfg : 
        sumisc.benchmark_eval ('no benchmark load configured')

    HOST = test_cfg['job_service_url']
    N_J  = int(bench_cfg['iterations'])  
    LOAD = int(bench_cfg['load'])       

    js = saga.job.Service ("%s" % HOST, session=session) 
    jd = saga.job.Description()

    jd.executable = '/bin/sleep'
    jd.arguments  = [LOAD]

    return {'js' : js, 'jd' : jd}
import os
import sys
import saga

import saga.utils.misc as sumisc

try:

    # get test backend and benchmark configurations
    (test_cfg, bench_cfg, session) = sumisc.benchmark_init ()

    if  not 'job_service_url' in test_cfg :
        sumisc.benchmark_eval ('no job service URL configured')

    if  not 'n_js' in bench_cfg :
        sumisc.benchmark_eval ('no job service count configured')

    if  not 'n_j' in bench_cfg :
        sumisc.benchmark_eval ('no job count configured')

    if  not 'n_j' in bench_cfg :
        TIME = 10
    else :
        TIME = int(bench_cfg['sleep'])

    N_JS = int(bench_cfg['n_js'])
    N_J  = int(bench_cfg['n_j'])
    HOST = test_cfg['job_service_url']