Exemplo n.º 1
0
# ------------------------------------------------------------------------------
#
def benchmark_core (args={}) :

    js = args['js']
    jd = args['jd']

    j  = js.create_job (jd)
    j.run()


# ------------------------------------------------------------------------------
#
def benchmark_post (args={}) :

    pass


# ------------------------------------------------------------------------------
#
try:

    sumisc.benchmark_init ('job.run', benchmark_pre, benchmark_core, benchmark_post)

except saga.SagaException, ex:
    print "An exception occured: (%s) %s " % (ex.type, (str(ex)))
    print " \n*** Backtrace:\n %s" % ex.traceback


def benchmark_pre (test_cfg, bench_cfg, session) :

    pass


# ------------------------------------------------------------------------------
#
def benchmark_core (args={}) :

    pass


# ------------------------------------------------------------------------------
#
def benchmark_post (args={}) :

    pass


# ------------------------------------------------------------------------------
#
try:

    sumisc.benchmark_init ('benchmark.selftest', benchmark_pre, benchmark_core, benchmark_post)

except Exception as e :

    print "Exception: %s" % e


Exemplo n.º 3
0
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']