Skip to content

Commit

Permalink
Fixed some perfprof stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
dparo committed Jan 7, 2022
1 parent 73edb11 commit 3557ec2
Showing 1 changed file with 16 additions and 33 deletions.
49 changes: 16 additions & 33 deletions src/tools/perfprof/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
#include <sha256.h>
#include <cJSON.h>

#define INFEASIBLE_SOLUTION_DEFAULT_COST_VAL ((double)1.0)
#define CRASHED_SOLVER_DEFAULT_COST_VAL ((double)2.0)

#define HASH_CSTR_LEN 65
typedef struct {
char cstr[HASH_CSTR_LEN];
Expand Down Expand Up @@ -197,7 +200,7 @@ STATIC_ASSERT(ARRAY_LEN(RANDOM_SEEDS) < UINT8_MAX,
static inline PerfStats make_invalidated_perf(PerfProfBatch *batch) {
PerfStats perf = {0};
perf.solution.feasible = true;
perf.solution.cost = INFINITY;
perf.solution.cost = CRASHED_SOLVER_DEFAULT_COST_VAL;
perf.time = 2 * batch->timelimit;
return perf;
}
Expand Down Expand Up @@ -300,7 +303,7 @@ void extract_perf_data_from_cptp_json_file(PerfProfRun *run, cJSON *root) {

bool valid = false;
bool feasible = false;
double cost = 1e99;
double cost = CRASHED_SOLVER_DEFAULT_COST_VAL;

if (itm_feasible && cJSON_IsBool(itm_feasible)) {
feasible = cJSON_IsTrue(itm_feasible);
Expand All @@ -315,9 +318,9 @@ void extract_perf_data_from_cptp_json_file(PerfProfRun *run, cJSON *root) {
cost = cJSON_GetNumberValue(itm_cost);
}
} else if (valid && !feasible) {
cost = 0.0;
cost = INFEASIBLE_SOLUTION_DEFAULT_COST_VAL;
} else {
cost = 1e99;
cost = CRASHED_SOLVER_DEFAULT_COST_VAL;
}

run->perf.solution.feasible = feasible;
Expand Down Expand Up @@ -817,46 +820,26 @@ static void generate_perfs_imgs(PerfProfBatch *batch);
static void main_loop(void) {
PerfProfBatch batches[] = {
{1,
"E-family-last-10",
120.0,
3,
{"data/BAP_Instances/E-last-10"},
DEFAULT_FILTER,
{
{"My CPTP MIP pricer", {}},
BAPCOD_SOLVER,
}},
{1,
"F-n72-k4",
120.0,
3,
{"data/BAP_Instances/F-n72-k4"},
"F-last10",
240.0,
1,
{"data/BAP_Instances_New/F"},
DEFAULT_FILTER,
{
{"My CPTP MIP pricer", {}},
BAPCOD_SOLVER,
}},
{1,
"F-family-last-10",
120.0,
3,
{"data/BAP_Instances/F-last-10"},
"E-last10",
240.0,
1,
{"data/BAP_Instances_New/E"},
DEFAULT_FILTER,
{
{"My CPTP MIP pricer", {}},
BAPCOD_SOLVER,
}},

{1,
"E-F-family-last-10",
120.0,
3,
{"data/BAP_Instances/E-last-10", "data/BAP_Instances/F-last-10"},
DEFAULT_FILTER,
{
{"My CPTP MIP pricer", {}},
BAPCOD_SOLVER,
}}};
};

for (int32_t i = 0; i < (int32_t)ARRAY_LEN(batches); i++) {
for (int32_t j = 0; j < (int32_t)ARRAY_LEN(batches); j++) {
Expand Down

0 comments on commit 3557ec2

Please sign in to comment.