Ejemplo n.º 1
0
def mv_expt(outdir,
            filename,
            ccThreads,
            txns,
            records,
            lowThreads,
            highThreads,
            expt,
            distribution,
            theta,
            rec_size,
            pct,
            only_worker=False):
    outfile = os.path.join(outdir, filename)
    outdep = os.path.join(outdir, "." + filename)

    temp = os.path.join(outdir, filename[:filename.find(".txt")] + "_out.txt")

    os.system("mkdir -p outdir")
    if not os.path.exists(outdep):

        val_range = gen_range(lowThreads, highThreads, 4)

        for i in val_range:
            os.system("rm results.txt")
            cmd = fmt_multi.format(str(ccThreads), str(txns), str(records),
                                   str(i), str(expt), str(distribution),
                                   str(theta), str(rec_size), str(pct))
            os.system(cmd)
            os.system("cat results.txt >>" + outfile)
            clean.clean_fn("mv", outfile, temp, only_worker)
            saved_dir = os.getcwd()
            os.chdir(outdir)
            os.system("gnuplot plot.plt")
            os.chdir(saved_dir)
Ejemplo n.º 2
0
def hek_expt(outdir, filename, lowThreads, highThreads, txns, records, expt,
             distribution, theta, rec_size, read_pct):
    outfile = os.path.join(outdir, filename)
    temp = os.path.join(outdir, filename[:filename.find(".txt")] + "_out.txt")

    #     param_dict = {}
    #     param_dict["--cc_type"] = str(3)
    #     param_dict["--num_contended"] = str(2)
    #     param_dict["--txn_size"] = str(10)
    #     param_dict["--read_pct"] = str(0)
    #     param_dict["--read_txn_size"] = str(5)
    #
    #     param_dict["--num_txns"] = str(txns)
    #     param_dict["--num_records"] = str(records)
    #     param_dict["--experiment"] = str(expt)
    #     param_dict["--distribution"] = str(distribution)
    #     param_dict["--record_size"] = str(1000)
    #
    #     os.system("mkdir -p " + outdir)
    outdep = os.path.join(outdir, "." + filename)
    if not os.path.exists(outdep):

        val_range = gen_range(lowThreads, highThreads, 4)
        for i in val_range:
            os.system("rm hek.txt")
            cmd = fmt_hek.format(str(i), str(txns), str(records), str(expt),
                                 str(distribution), str(theta), str(rec_size),
                                 str(read_pct))
            os.system(cmd)
            os.system("cat hek.txt >>" + outfile)
            clean.clean_fn("occ", outfile, temp)
            saved_dir = os.getcwd()
            os.chdir(outdir)
            os.system("gnuplot plot.plt")
            os.chdir(saved_dir)
Ejemplo n.º 3
0
def hek_expt(outdir, filename, lowThreads, highThreads, txns, records, expt, distribution, theta, rec_size, read_pct):
    outfile = os.path.join(outdir, filename)
    temp = os.path.join(outdir, filename[:filename.find(".txt")] + "_out.txt")


#     param_dict = {}
#     param_dict["--cc_type"] = str(3)
#     param_dict["--num_contended"] = str(2)
#     param_dict["--txn_size"] = str(10)
#     param_dict["--read_pct"] = str(0)
#     param_dict["--read_txn_size"] = str(5)
# 
#     param_dict["--num_txns"] = str(txns)
#     param_dict["--num_records"] = str(records)
#     param_dict["--experiment"] = str(expt)
#     param_dict["--distribution"] = str(distribution)
#     param_dict["--record_size"] = str(1000)
#     
#     os.system("mkdir -p " + outdir)
    outdep = os.path.join(outdir, "." + filename)
    if not os.path.exists(outdep):

        val_range = gen_range(lowThreads, highThreads, 4)
        for i in val_range:
            os.system("rm hek.txt")
            cmd = fmt_hek.format(str(i), str(txns), str(records), str(expt), str(distribution), str(theta), str(rec_size), str(read_pct))
            os.system(cmd)
            os.system("cat hek.txt >>" + outfile)
            clean.clean_fn("occ", outfile, temp)
            saved_dir = os.getcwd()
            os.chdir(outdir)
            os.system("gnuplot plot.plt")
            os.chdir(saved_dir)
Ejemplo n.º 4
0
def locking_expt(outdir, filename, lowThreads, highThreads, txns, records, expt, distribution, theta, rec_size, read_pct):
    outfile = os.path.join(outdir, filename)
    
    temp = os.path.join(outdir, filename[:filename.find(".txt")] + "_out.txt")

    os.system("mkdir -p outdir")
    outdep = os.path.join(outdir, "." + filename)
    if not os.path.exists(outdep):

        val_range = gen_range(lowThreads, highThreads, 4)
        for i in val_range:
            os.system("rm locking.txt")
            cmd = fmt_locking.format(str(i), str(txns), str(records), str(expt), str(distribution), str(theta), str(rec_size), str(read_pct))
            os.system(cmd)
            os.system("cat locking.txt >>" + outfile)
            clean.clean_fn("locking", outfile, temp)
            saved_dir = os.getcwd()
            os.chdir(outdir)
            os.system("gnuplot plot.plt")
            os.chdir(saved_dir)
Ejemplo n.º 5
0
def mv_expt(outdir, filename, ccThreads, txns, records, lowThreads, highThreads, expt, distribution, theta, rec_size, pct, only_worker=False):
    outfile = os.path.join(outdir, filename)
    outdep = os.path.join(outdir, "." + filename)

    temp = os.path.join(outdir, filename[:filename.find(".txt")] + "_out.txt")

    os.system("mkdir -p outdir")
    if not os.path.exists(outdep):

        val_range = gen_range(lowThreads, highThreads, 4)

        for i in val_range:
            os.system("rm results.txt")
            cmd = fmt_multi.format(str(ccThreads), str(txns), str(records), str(i), str(expt), str(distribution), str(theta), str(rec_size), str(pct))
            os.system(cmd)
            os.system("cat results.txt >>" + outfile)
            clean.clean_fn("mv", outfile, temp, only_worker)
            saved_dir = os.getcwd()
            os.chdir(outdir)
            os.system("gnuplot plot.plt")
            os.chdir(saved_dir)
Ejemplo n.º 6
0
def occ_expt(outdir, filename, lowThreads, highThreads, txns, records, expt,
             distribution, theta, rec_size, read_pct):
    outfile = os.path.join(outdir, filename)

    temp = os.path.join(outdir, filename[:filename.find(".txt")] + "_out.txt")

    os.system("mkdir -p " + outdir)
    outdep = os.path.join(outdir, "." + filename)
    if not os.path.exists(outdep):

        val_range = gen_range(lowThreads, highThreads, 4)
        for i in val_range:
            os.system("rm occ.txt")
            cmd = fmt_occ.format(str(i), str(txns), str(records), str(expt),
                                 str(distribution), str(theta), str(rec_size),
                                 str(read_pct))
            os.system(cmd)
            os.system("cat occ.txt >>" + outfile)
            clean.clean_fn("occ", outfile, temp)
            saved_dir = os.getcwd()
            os.chdir(outdir)
            os.system("gnuplot plot.plt")
            os.chdir(saved_dir)
Ejemplo n.º 7
0
def main():
    clean.clean_fn("mv", "results.txt", "blah.txt")
Ejemplo n.º 8
0
def main():
    clean.clean_fn("mv", "results.txt", "blah.txt")