Skip to content

Commit 4c6bd33

Browse files
committed
Remove option no2hop and fix it to true
1 parent ae2896a commit 4c6bd33

File tree

9 files changed

+7
-48
lines changed

9 files changed

+7
-48
lines changed

docs/src/options/definitions.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -445,11 +445,6 @@
445445
- Range: {0, 2147483647}
446446
- Default: 128
447447

448-
## [hipo\_metis\_no2hop](@id option-hipo-metis-no2hop)
449-
- Set option no2hop in Metis when using HiPO
450-
- Type: boolean
451-
- Default: false
452-
453448
## pdlp\_scaling
454449
- Scaling option for PDLP solver: Default = true
455450
- Type: boolean

highs/ipm/IpxWrapper.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,6 @@ HighsStatus solveLpHipo(const HighsOptions& options, HighsTimer& timer,
567567
// block size option
568568
hipo_options.block_size = options.hipo_block_size;
569569

570-
// metis options
571-
hipo_options.metis_no2hop = options.hipo_metis_no2hop;
572-
573570
hipo.setOptions(hipo_options);
574571
hipo.setTimer(timer);
575572
hipo.setCallback(callback);

highs/ipm/hipo/factorhighs/Analyse.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
#include <random>
77
#include <stack>
88

9-
#include "amd/amd.h"
109
#include "DataCollector.h"
1110
#include "FactorHiGHSSettings.h"
12-
#include "metis/metis.h"
1311
#include "ReturnValues.h"
12+
#include "amd/amd.h"
1413
#include "ipm/hipo/auxiliary/Auxiliary.h"
1514
#include "ipm/hipo/auxiliary/Log.h"
15+
#include "metis/metis.h"
1616
#include "rcm/rcm.h"
1717

1818
namespace hipo {
@@ -61,7 +61,7 @@ Analyse::Analyse(const std::vector<Int>& rows, const std::vector<Int>& ptr,
6161
ready_ = true;
6262
}
6363

64-
Int Analyse::getPermutation(bool metis_no2hop) {
64+
Int Analyse::getPermutation() {
6565
// Compute fill-reducing reodering using metis, amd or rcm.
6666

6767
perm_.resize(n_);
@@ -130,8 +130,8 @@ Int Analyse::getPermutation(bool metis_no2hop) {
130130
if (log_->debug(2))
131131
options[METIS_OPTION_DBGLVL] = METIS_DBG_INFO | METIS_DBG_COARSEN;
132132

133-
// set no2hop=1 if the user requested it
134-
if (metis_no2hop) options[METIS_OPTION_NO2HOP] = 1;
133+
// no2hop improves the quality of ordering in general
134+
options[METIS_OPTION_NO2HOP] = 1;
135135

136136
if (log_) log_->printDevInfo("Running Metis\n");
137137

@@ -1302,7 +1302,7 @@ Int Analyse::run(Symbolic& S) {
13021302
#if HIPO_TIMING_LEVEL >= 2
13031303
Clock clock_items;
13041304
#endif
1305-
if (getPermutation(S.metisNo2hop())) return kRetOrderingError;
1305+
if (getPermutation()) return kRetOrderingError;
13061306
#if HIPO_TIMING_LEVEL >= 2
13071307
data_.sumTime(kTimeAnalyseOrdering, clock_items.stop());
13081308
#endif

highs/ipm/hipo/factorhighs/Analyse.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class Analyse {
8888
const std::string& ordering_;
8989

9090
// Functions to perform analyse phase
91-
Int getPermutation(bool metis_no2hop);
91+
Int getPermutation();
9292
void permute(const std::vector<Int>& iperm);
9393
void eTree();
9494
void postorder();

highs/ipm/hipo/factorhighs/Symbolic.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ void Symbolic::setParallel(bool par_tree, bool par_node) {
1414
parallel_node_ = par_node;
1515
}
1616

17-
void Symbolic::setMetisNo2hop(bool metis_no2hop) {
18-
metis_no2hop_ = metis_no2hop;
19-
}
20-
2117
Int64 Symbolic::nz() const { return nz_; }
2218
double Symbolic::flops() const { return flops_; }
2319
double Symbolic::spops() const { return spops_; }
@@ -44,7 +40,6 @@ Int64 Symbolic::cliqueSize(Int sn) const {
4440
Int64 Symbolic::maxStackSize() const { return max_stack_size_; }
4541
bool Symbolic::parTree() const { return parallel_tree_; }
4642
bool Symbolic::parNode() const { return parallel_node_; }
47-
bool Symbolic::metisNo2hop() const { return metis_no2hop_; }
4843
double Symbolic::storage() const { return serial_storage_; }
4944

5045
const std::vector<Int64>& Symbolic::ptr() const { return ptr_; }

highs/ipm/hipo/factorhighs/Symbolic.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ class Symbolic {
1414
bool parallel_tree_ = false;
1515
bool parallel_node_ = false;
1616

17-
// metis options
18-
bool metis_no2hop_ = false;
19-
2017
// Size of blocks for dense factorisation
2118
Int block_size_;
2219

@@ -107,7 +104,6 @@ class Symbolic {
107104
public:
108105
Symbolic();
109106
void setParallel(bool par_tree, bool par_node);
110-
void setMetisNo2hop(bool metis_no2hop);
111107

112108
// provide const access to symbolic factorisation
113109
Int64 nz() const;
@@ -130,7 +126,6 @@ class Symbolic {
130126
Int64 maxStackSize() const;
131127
bool parTree() const;
132128
bool parNode() const;
133-
bool metisNo2hop() const;
134129
double storage() const;
135130
const std::vector<Int64>& ptr() const;
136131
const std::vector<Int>& iperm() const;

highs/ipm/hipo/ipm/FactorHiGHSSolver.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,6 @@ Int FactorHiGHSSolver::setup() {
7171

7272
S_.print(log_, log_.debug(1));
7373

74-
// Warn about large fill-in
75-
if (S_.fillin() > kLargeFillin && options_.ordering == "metis" &&
76-
!options_.metis_no2hop) {
77-
log_.printw(
78-
"Large fill-in in factorisation. Consider setting the "
79-
"hipo_metis_no2hop option to true\n");
80-
}
81-
8274
// Warn about large memory consumption
8375
if (S_.storage() > kLargeStorageGB * 1024 * 1024 * 1024) {
8476
log_.printw("Large amount of memory required\n");
@@ -539,9 +531,6 @@ Int FactorHiGHSSolver::chooseNla() {
539531
bool overflow_NE = false;
540532
bool overflow_AS = false;
541533

542-
symb_NE.setMetisNo2hop(options_.metis_no2hop);
543-
symb_AS.setMetisNo2hop(options_.metis_no2hop);
544-
545534
Clock clock;
546535

547536
// Perform analyse phase of augmented system
@@ -633,8 +622,6 @@ Int FactorHiGHSSolver::chooseNla() {
633622
Int FactorHiGHSSolver::setNla() {
634623
std::stringstream log_stream;
635624

636-
S_.setMetisNo2hop(options_.metis_no2hop);
637-
638625
switch (options_.nla) {
639626
case kOptionNlaAugmented: {
640627
if (analyseAS(S_)) {

highs/ipm/hipo/ipm/Options.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ struct Options {
4242
OptionParallel parallel = kOptionParallelDefault;
4343
std::string ordering = kHighsChooseString;
4444

45-
// Metis options
46-
bool metis_no2hop = false;
47-
4845
// Ipm parameters
4946
Int max_iter = kMaxIterDefault;
5047
double feasibility_tol = kIpmTolDefault;

highs/lp_data/HighsOptions.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@ struct HighsOptionsStruct {
379379
std::string hipo_parallel_type;
380380
std::string hipo_ordering;
381381
HighsInt hipo_block_size;
382-
bool hipo_metis_no2hop;
383382

384383
// Options for PDLP solver
385384
bool pdlp_scaling;
@@ -552,7 +551,6 @@ struct HighsOptionsStruct {
552551
hipo_parallel_type(""),
553552
hipo_ordering(""),
554553
hipo_block_size(0),
555-
hipo_metis_no2hop(false),
556554
pdlp_scaling(false),
557555
pdlp_iteration_limit(0),
558556
pdlp_e_restart_method(0),
@@ -1282,11 +1280,6 @@ class HighsOptions : public HighsOptionsStruct {
12821280
advanced, &hipo_block_size, 0, 128, kHighsIInf);
12831281
records.push_back(record_int);
12841282

1285-
record_bool =
1286-
new OptionRecordBool("hipo_metis_no2hop", "Use option no2hop in Metis",
1287-
advanced, &hipo_metis_no2hop, false);
1288-
records.push_back(record_bool);
1289-
12901283
record_bool = new OptionRecordBool(
12911284
"pdlp_scaling", "Scaling option for PDLP solver: Default = true",
12921285
advanced, &pdlp_scaling, true);

0 commit comments

Comments
 (0)