예제 #1
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()
예제 #2
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 ()
예제 #3
0
def experimentDivergence(doBuffer):
    for predicateValue in [5, 10, 15, 20, 25, 30, 35, 40, 45, 50]:
        alg = RelationalAlgebra(acc)
        plan = alg.join(
            ("l_partkey", "p_partkey"), alg.scan("part"),
            alg.selection(
                scal.SmallerExpr(scal.AttrExpr("l_quantity"),
                                 scal.ConstExpr(str(predicateValue),
                                                Type.INT)),
                alg.scan("lineitem")))
        plan = alg.aggregation(
            ["l_quantity"],
            [(Reduction.SUM, "l_extendedprice", "total_price")], plan)
        cfg = {}
        cfg[5] = {}
        cfg[5]["numgroups"] = 100000
        plan = alg.resolveAlgebraPlan(plan, cfg)
        compiler = CudaCompiler(alg, "sm_75", CType.FP64, False)
        if doBuffer:
            compiler.setBuffers([3])
        compilerPlan = alg.translateToCompilerPlan(plan, compiler)
        compiler.gencode(compilerPlan)
        compiler.compile("filterbenchTPCH")
        compiler.execute()
예제 #4
0
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(
                        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_extprice" + str(i)
                plan = alg.map(
                    newname,
                    scal.MulExpr(scal.AttrExpr(name),
                                 scal.ConstExpr("0.99", Type.FLOAT)), plan)
                name = newname

            plan = alg.projection([name], plan)
            cfg = {}
            plan = alg.resolveAlgebraPlan(plan, cfg)
            compiler = CudaCompiler(alg, "sm_75", CType.FP64, False)
            if addLaneRefill:
                compiler.setBuffers([2])
            compilerPlan = alg.translateToCompilerPlan(plan, compiler)
            compiler.gencode(compilerPlan)
            compiler.compile("filterbenchNumOps")
            compiler.execute()