Skip to content

Commit

Permalink
solver_greedy -> solver_conformity
Browse files Browse the repository at this point in the history
  • Loading branch information
sinanmohd committed Jul 25, 2024
1 parent b8f8d12 commit 2800f12
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
3 changes: 3 additions & 0 deletions include/solver_conformity.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "jobs.h"

int solver_conformity(struct job **job, struct job_clist *q, int32_t resources);
3 changes: 0 additions & 3 deletions include/solver_greedy.h

This file was deleted.

30 changes: 15 additions & 15 deletions src/evanix.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@
#include "build.h"
#include "evanix.h"
#include "queue.h"
#include "solver_greedy.h"
#include "solver_conformity.h"
#include "solver_highs.h"
#include "util.h"

static const char usage[] =
"Usage: evanix [options] expr\n"
"\n"
" -h, --help Show help message and quit.\n"
" -f, --flake Build a flake.\n"
" -d, --dry-run Show what derivations would be "
" -h, --help Show help message and quit.\n"
" -f, --flake Build a flake.\n"
" -d, --dry-run Show what derivations would be "
"built.\n"
" -s, --system System to build for.\n"
" -m, --max-build Max number of builds.\n"
" -b, --break-evanix Enable experimental features.\n"
" -r, --solver-report Print solver report.\n"
" -p, --pipelined <bool> Use evanix build pipeline.\n"
" -l, --check_cache-status <bool> Perform cache locality check.\n"
" -c, --close-unused-fd <bool> Close stderr on exec.\n"
" -k, --solver highs|greedy Solver to use.\n"
" -s, --system System to build for.\n"
" -m, --max-build Max number of builds.\n"
" -b, --break-evanix Enable experimental features.\n"
" -r, --solver-report Print solver report.\n"
" -p, --pipelined <bool> Use evanix build pipeline.\n"
" -l, --check_cache-status <bool> Perform cache locality check.\n"
" -c, --close-unused-fd <bool> Close stderr on exec.\n"
" -k, --solver conformity|highs Solver to use.\n"
"\n";

struct evanix_opts_t evanix_opts = {
Expand All @@ -36,7 +36,7 @@ struct evanix_opts_t evanix_opts = {
.system = NULL,
.solver_report = false,
.check_cache_status = true,
.solver = solver_greedy,
.solver = solver_conformity,
.break_evanix = false,
};

Expand Down Expand Up @@ -170,8 +170,8 @@ int opts_read(struct evanix_opts_t *opts, char **expr, int argc, char *argv[])
opts->solver_report = true;
break;
case 'k':
if (!strcmp(optarg, "greedy")) {
opts->solver = solver_greedy;
if (!strcmp(optarg, "conformity")) {
opts->solver = solver_conformity;
} else if (!strcmp(optarg, "highs")) {
opts->solver = solver_highs;
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ e = executable(
'queue.c',
'build.c',
'jobid.c',
'solver_greedy.c',
'solver_conformity.c',
'solver_highs.c',
],

include_directories: evanix_inc,
dependencies: [ cjson_dep, highs_dep ],
install: true,
c_args: [f'-DNIX_EVAL_JOBS_PATH=@NIX_EVAL_JOBS_PATH@'],
c_args: [f'-DNIX_EVAL_JOBS_PATH=@NIX_EVAL_JOBS_PATH@'],
)

test('evanix', e)
2 changes: 1 addition & 1 deletion src/queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "evanix.h"
#include "queue.h"
#include "solver_greedy.h"
#include "solver_conformity.h"
#include "util.h"

#define MAX_NIX_PKG_COUNT 200000
Expand Down
4 changes: 2 additions & 2 deletions src/solver_greedy.c → src/solver_conformity.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "evanix.h"
#include "jobs.h"
#include "queue.h"
#include "solver_greedy.h"
#include "solver_conformity.h"
#include "util.h"

static float conformity(struct job *job);
Expand Down Expand Up @@ -35,7 +35,7 @@ static float conformity(struct job *job)
return conformity;
}

int solver_greedy(struct job **job, struct job_clist *q, int32_t resources)
int solver_conformity(struct job **job, struct job_clist *q, int32_t resources)
{
struct job *j;
float conformity_cur;
Expand Down

0 comments on commit 2800f12

Please sign in to comment.