Skip to content

Commit

Permalink
force pdlp local termination for GPU for the moment
Browse files Browse the repository at this point in the history
  • Loading branch information
galabovaa committed Jan 17, 2025
1 parent 64e8a41 commit 2d29f1d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -290,4 +290,7 @@ highs-unit-tests
highs-problem-set

# debug nvidia
build-cpu
build-cpu

# Generated HiGHS options file
Options.md
9 changes: 9 additions & 0 deletions src/pdlp/CupdlpWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,8 +704,17 @@ void getUserParamsFromOptions(const HighsOptions& options,
ifChangeIntParam[E_RESTART_METHOD] = true;
intParam[E_RESTART_METHOD] = int(options.pdlp_e_restart_method);
//

// for the moment only native termination is allowed with GPU
#ifdef CUPDLP_CPU
ifChangeIntParam[I_INF_NORM_ABS_LOCAL_TERMINATION] = true;
intParam[I_INF_NORM_ABS_LOCAL_TERMINATION] = !options.pdlp_native_termination;
#else
ifChangeIntParam[I_INF_NORM_ABS_LOCAL_TERMINATION] = false;
if (!options.pdlp_native_termination) {
printf("Warning: GPU only supports pdlp_native_termination=on. Ignoring parameter.\n");
}
#endif
}

void analysePdlpSolution(const HighsOptions& options, const HighsLp& lp,
Expand Down
2 changes: 1 addition & 1 deletion src/pdlp/cupdlp/cupdlp_linalg.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ double get_fabs_value(double* vec, int index, int N) {
// get_gpu_vec_element(vec, index, &result, &success);

double * b;
b = (float *)malloc (N * sizeof (*b));
b = (double *)malloc (N * sizeof (*b));
get_gpu_vec(vec, index, b, &success);

if (!success)
Expand Down

0 comments on commit 2d29f1d

Please sign in to comment.