Beispiel #1
0
    for trace_id in exp_count_multi[key]:
        if (check_trace_ok(db_obj, trace_id)):
            good.append(trace_id)
        else:
            bad.append(trace_id)
    if good > 1 and not do_deep:
        all_suspicious_pairs += check_all_good(db_obj, good, 200)
    all_good += good
    all_bad += bad

print("""Final result:""")
print("""Good traces({1}): {0}""".format(" ".join([str(x) for x in all_good]),
                                         len(all_good)))
print("""Bad traces({1}): {0}""".format(" ".join([str(x) for x in all_bad]),
                                        len(all_bad)))
print("""Suspicios pairs({1}): {0}""".format(
    " ".join([str(x) for x in all_suspicious_pairs]),
    len(all_suspicious_pairs)))

theval = raw_input(
    "Press Enter to continue and reset those experiments that are not ok: "
    "{0}".format(" ".join([str(x) for x in all_bad])))

for bad_trace_id in all_bad:
    print("Cleaning experiment trace and results: {0}".format(bad_trace_id))
    ed = ExperimentDefinition()
    ed.load(db_obj, bad_trace_id)
    ed.del_trace(db_obj)
    ed.del_results(db_obj)
    ed.upate_state(db_obj, "fresh")
Beispiel #2
0
print("Reseting experiments in state {0}".format(state))
there_are_more = True
while (there_are_more):
    ed = ExperimentDefinition()
    if trace_id is not None:
        ed.load(central_db_obj, trace_id)
        if ed._work_state!=state:
            print("Error, unexpected state {0} for trace {1}".format(
                                                             ed._work_state,
                                                             trace_id))
            exit()
        ed.upate_state(central_db_obj, new_state)
        there_are_more=False
    else:
        there_are_more=ed.load_next_state(central_db_obj, state, new_state)
    if ed._trace_id!=None:
        print("Reset experiment({0}: {1}): {2} -> {3}".format(ed._trace_id,
                                                  ed._name,
                                                  state,
                                                  new_state))
        if new_state == "fresh":
            ed.del_trace(central_db_obj)
            ed.update_worker(central_db_obj,"")
            ed.reset_simulating_time(central_db_obj)
        if new_state in ["fresh", "simulation_complete", "simulation_done",
                         "pending"]:
            print("A resetear")
            ed.del_results(central_db_obj)
        if new_state in ["analysis_done"]:
            ed.del_results_like(central_db_obj)