Exemplo n.º 1
0
def execTpch(acc, num, showPlan=False):

    qPath = "../query/plans/tpch" + str(num) + ".py"
    cfgPath = "../query/plans/tpch" + str(num) + "cfg.py"

    # read query plan
    alg = RelationalAlgebra(acc)
    plan = eval(loadScript(qPath))

    # read plan configuration ( if exists )
    cfg = {}
    if os.path.isfile(cfgPath):
        cfg = eval(loadScript(cfgPath))

    # show basic plan
    if showPlan:
        alg.showGraph(plan)

    plan = alg.resolveAlgebraPlan(plan, cfg)

    # show refined plan
    if showPlan:
        alg.showGraph(plan)

    experimentBuffer(alg, plan, cfg, num)
Exemplo n.º 2
0
Arquivo: tpch.py Projeto: ngaut/dogqc
def execTpch ( acc, num, showPlan=False ):
    
    qPath = "../query/plans/tpch" + str(num) + ".py"
    cfgPath = "../query/plans/tpch" + str(num) + "cfg.py"

    # read query plan
    alg = RelationalAlgebra ( acc )
    plan = eval ( loadScript ( qPath ) )
    
    # read plan configuration ( if exists )
    cfg = {}
    if os.path.isfile ( cfgPath ):
        cfg = eval ( loadScript ( cfgPath ) )

    # show basic plan
    if showPlan:
        alg.showGraph ( plan )
        
    plan = alg.resolveAlgebraPlan ( plan, cfg )
        
    # show refined plan 
    if showPlan:
        alg.showGraph ( plan )

    compiler = CudaCompiler ( algebraContext = alg, smArchitecture = "sm_75", decimalRepr = CType.FP32, debug = False )

    compilerPlan = alg.translateToCompilerPlan ( plan, compiler )
    compiler.gencode ( compilerPlan )
    compiler.compile ( "tpch" + str(num) )
    compiler.execute ()