Skip to content

Commit 929168d

Browse files
committed
Hopefully valgrind now OK on test-1966
1 parent 6961aef commit 929168d

File tree

2 files changed

+35
-16
lines changed

2 files changed

+35
-16
lines changed

highs/interfaces/highs_c_api.h

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,21 +117,32 @@ static const char* const kHighsCallbackDataOutPdlpIterationCountName =
117117
"pdlp_iteration_count";
118118
static const char* const kHighsCallbackDataOutObjectiveFunctionValueName =
119119
"objective_function_value";
120-
static const char* const kHighsCallbackDataOutMipNodeCountName = "mip_node_count";
120+
static const char* const kHighsCallbackDataOutMipNodeCountName =
121+
"mip_node_count";
121122
static const char* const kHighsCallbackDataOutMipTotalLpIterationsName =
122123
"mip_total_lp_iterations";
123-
static const char* const kHighsCallbackDataOutMipPrimalBoundName = "mip_primal_bound";
124-
static const char* const kHighsCallbackDataOutMipDualBoundName = "mip_dual_bound";
124+
static const char* const kHighsCallbackDataOutMipPrimalBoundName =
125+
"mip_primal_bound";
126+
static const char* const kHighsCallbackDataOutMipDualBoundName =
127+
"mip_dual_bound";
125128
static const char* const kHighsCallbackDataOutMipGapName = "mip_gap";
126129
static const char* const kHighsCallbackDataOutMipSolutionName = "mip_solution";
127-
static const char* const kHighsCallbackDataOutCutpoolNumColName = "cutpool_num_col";
128-
static const char* const kHighsCallbackDataOutCutpoolNumCutName = "cutpool_num_cut";
129-
static const char* const kHighsCallbackDataOutCutpoolNumNzName = "cutpool_num_nz";
130-
static const char* const kHighsCallbackDataOutCutpoolStartName = "cutpool_start";
131-
static const char* const kHighsCallbackDataOutCutpoolIndexName = "cutpool_index";
132-
static const char* const kHighsCallbackDataOutCutpoolValueName = "cutpool_value";
133-
static const char* const kHighsCallbackDataOutCutpoolLowerName = "cutpool_lower";
134-
static const char* const kHighsCallbackDataOutCutpoolUpperName = "cutpool_upper";
130+
static const char* const kHighsCallbackDataOutCutpoolNumColName =
131+
"cutpool_num_col";
132+
static const char* const kHighsCallbackDataOutCutpoolNumCutName =
133+
"cutpool_num_cut";
134+
static const char* const kHighsCallbackDataOutCutpoolNumNzName =
135+
"cutpool_num_nz";
136+
static const char* const kHighsCallbackDataOutCutpoolStartName =
137+
"cutpool_start";
138+
static const char* const kHighsCallbackDataOutCutpoolIndexName =
139+
"cutpool_index";
140+
static const char* const kHighsCallbackDataOutCutpoolValueName =
141+
"cutpool_value";
142+
static const char* const kHighsCallbackDataOutCutpoolLowerName =
143+
"cutpool_lower";
144+
static const char* const kHighsCallbackDataOutCutpoolUpperName =
145+
"cutpool_upper";
135146

136147
const HighsInt kHighsIisStrategyLight = 0;
137148
const HighsInt kHighsIisStrategyFromLpRowPriority = 1; // WIP

highs/pdlp/CupdlpWrapper.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,19 @@ HighsStatus solveLpCupdlp(const HighsOptions& options, HighsTimer& timer,
205205
&pdlp_num_iter);
206206
highs_info.pdlp_iteration_count = pdlp_num_iter;
207207

208-
// Print final solution using debugPdlpFinalSolutionLog
209-
debugPdlpFinalSolutionLog(w->debug_pdlp_log_file_,
210-
highs_solution.col_value.data(), lp.num_col_,
211-
highs_solution.row_dual.data(), lp.num_row_);
212-
if (w->debug_pdlp_log_file_) fclose(w->debug_pdlp_log_file_);
208+
if (PDLP_DEBUG_LOG) {
209+
// Strange, even though w->debug_pdlp_log_file_ is set NULL in
210+
// cupdlp_solver.c when !PDLP_DEBUG_LOG, vagrind still considers
211+
// it to be an Invalid read of size 8 here, so use PDLP_DEBUG_LOG
212+
// to determine call
213+
//
214+
// Print final solution using debugPdlpFinalSolutionLog
215+
debugPdlpFinalSolutionLog(w->debug_pdlp_log_file_,
216+
highs_solution.col_value.data(), lp.num_col_,
217+
highs_solution.row_dual.data(), lp.num_row_);
218+
assert(w->debug_pdlp_log_file_);
219+
if (w->debug_pdlp_log_file_) fclose(w->debug_pdlp_log_file_);
220+
}
213221
model_status = HighsModelStatus::kUnknown;
214222
highs_solution.value_valid = value_valid;
215223
highs_solution.dual_valid = dual_valid;

0 commit comments

Comments
 (0)