Exemplo n.º 1
0
def executePlanNumOperators ( usePushDownJoin = False ):

    EquiJoinTranslator.usePushDownJoin = usePushDownJoin 

    datagen.generator.joinData ( "pk-4zipf-fk" )
    acc = io.dbAccess ( schema.join.joinSchema, "mmdb", "./", True )

    for r in [2]:
        for n in [ 0,3,6,9,12,15,18,21,24,27 ]:

            alg = RelationalAlgebra ( acc )
            plan = alg.join (
                ("r_build", "s_probe"),
                alg.scan ( "r_build" ),
                alg.scan ( "s_probe" )
            )
            
            name = "r_linenumber"
            for i in range(0,n):
                plan = alg.selection (
                    scal.NotExpr (
                        scal.SmallerExpr ( 
                            scal.AbsExpr ( 
                                scal.SubExpr ( 
                                    scal.AttrExpr ( name ),
                                    scal.ConstExpr ( str ( random.randint (1, 999999999) ), Type.FLOAT )
                                )
                            ),
                            scal.ConstExpr ( "0.01", Type.FLOAT )
                        )
                    ),
                    plan
                )
                newname = "l_linenumber" + str(i)
                plan = alg.map ( newname,
                    scal.MulExpr ( 
                        scal.AttrExpr ( name ),
                        scal.ConstExpr ( "0.99", Type.FLOAT )
                    ),
                    plan
                )
                name = newname
           
            cfg = {}

            plan = alg.projection ( [ name ], plan )
            
            plan = alg.resolveAlgebraPlan ( plan, cfg )
            compiler = CudaCompiler ( alg, "sm_75", CType.FP64, False )
            compilerPlan = alg.translateToCompilerPlan ( plan, compiler )
            compiler.gencode ( compilerPlan )
            compiler.compile ( "joinbenchNumOps" )
            compiler.execute ()
Exemplo n.º 2
0
Arquivo: tpch.py Projeto: ngaut/dogqc
def main():
    # access database
    if len(sys.argv) < 3:
        print("Please provide the following arguments:\n1. The path TPC-H *.tbl data.\n2. The TPC-H query number 1-22.")
        quit()
    acc = io.dbAccess ( schema.tpch.tpchSchema, "mmdb", sys.argv[1] )
    # execute all tpch 
    if sys.argv[2] == "all":
        for i in range(1,23):
            print ( "-----------------------Executing TPCH-H query " + str(i) + "-----------------------" )
            execTpch ( acc, i )
    # execute one tpch 
    else:
        execTpch ( acc, sys.argv[2] )
Exemplo n.º 3
0
def main():
    # access database
    if len(sys.argv) < 3:
        print("Please provide the following arguments:"
              "\n1. The path TPC-H *.tbl data.\n"
              "\n2. The TPC-H query number 1-22."
              "\n3. [optional] The desired profiler locations"
              "\n4. [optional] The desired lane refill buffer locations")
        quit()

    profilers = "[]"
    if len(sys.argv) >= 4:
        profilers = sys.argv[3]
    buffers = "[]"
    if len(sys.argv) >= 5:
        buffers = sys.argv[4]

    acc = io.dbAccess(schema.tpch.tpchSchema, "mmdb", sys.argv[1])
    execTpch(acc, sys.argv[2], profilers, buffers)
Exemplo n.º 4
0
def executePlanNumOperators(usePushDownJoin=False):

    EquiJoinTranslator.usePushDownJoin = usePushDownJoin

    for data in ["pk-fk", "pk-8-fk", "pk-32-fk", "pk-zipf-fk", "pk-4zipf-fk"]:
        for r in [2]:

            datagen.generator.joinData(data)
            acc = io.dbAccess(schema.join.joinSchema, "mmdb", "./", True)

            alg = RelationalAlgebra(acc)
            plan = alg.join(("r_build", "s_probe"), alg.scan("r_build"),
                            alg.scan("s_probe"))

            plan = alg.resolveAlgebraPlan(plan, {})
            compiler = CudaCompiler(alg, "sm_75", CType.FP32, False)
            compilerPlan = alg.translateToCompilerPlan(plan, compiler)
            compiler.gencode(compilerPlan)
            compiler.compile("joinbenchNumOps")
            compiler.execute()
Exemplo n.º 5
0
from dogqc.types import Type
from dogqc.cudalang import CType
import dogqc.scalarAlgebra as scal
from dogqc.kernel import KernelCall
import datagen.generator

KernelCall.defaultGridSize = 920
KernelCall.defaultBlockSize = 128

sys.setrecursionlimit(100000)

if len(sys.argv) < 2:
    print("Please provide a path to TPCH *.tbl files as argument.")
    quit()

acc = io.dbAccess(schema.tpch.tpchSchema, "mmdb", sys.argv[1])


def experimentDivergence(addLaneRefill):
    predicateValue = 45
    for r in [1, 2, 3, 4, 5]:
        for n in [0, 3, 6, 9, 12, 15, 18, 21, 24, 27]:
            alg = RelationalAlgebra(acc)
            plan = alg.selection(
                scal.LargerExpr(scal.AttrExpr("l_quantity"),
                                scal.ConstExpr(str(predicateValue), Type.INT)),
                alg.scan("lineitem"))
            name = "l_extendedprice"
            for i in range(0, n):
                plan = alg.selection(
                    scal.NotExpr(