Skip to content

Commit ebde818

Browse files
committed
Retune and move warnings
1 parent 050278f commit ebde818

File tree

4 files changed

+29
-12
lines changed

4 files changed

+29
-12
lines changed

highs/ipm/hipo/factorhighs/Symbolic.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Int64 Symbolic::maxStackSize() const { return max_stack_size_; }
4545
bool Symbolic::parTree() const { return parallel_tree_; }
4646
bool Symbolic::parNode() const { return parallel_node_; }
4747
bool Symbolic::metisNo2hop() const { return metis_no2hop_; }
48+
double Symbolic::storage() const { return serial_storage_; }
4849

4950
const std::vector<Int64>& Symbolic::ptr() const { return ptr_; }
5051
const std::vector<Int>& Symbolic::iperm() const { return iperm_; }
@@ -98,15 +99,6 @@ void Symbolic::print(const Log& log, bool verbose) const {
9899
<< '\n';
99100
}
100101
log.print(log_stream);
101-
102-
// Warn about large fill-in
103-
if (fillin_ > 50 && !metis_no2hop_) {
104-
log.printw(
105-
"Large fill-in in factorisation. Consider setting the "
106-
"hipo_metis_no2hop option to true\n");
107-
}
108-
109-
log.print("\n");
110102
}
111103

112104
} // namespace hipo

highs/ipm/hipo/factorhighs/Symbolic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ class Symbolic {
129129
bool parTree() const;
130130
bool parNode() const;
131131
bool metisNo2hop() const;
132+
double storage() const;
132133
const std::vector<Int64>& ptr() const;
133134
const std::vector<Int>& iperm() const;
134135
const std::vector<Int>& snParent() const;

highs/ipm/hipo/ipm/FactorHiGHSSolver.cpp

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,21 @@ Int FactorHiGHSSolver::setup() {
7070
setParallel();
7171

7272
S_.print(log_, log_.debug(1));
73+
74+
// Warn about large fill-in
75+
if (S_.fillin() > kLargeFillin && !options_.metis_no2hop) {
76+
log_.printw(
77+
"Large fill-in in factorisation. Consider setting the "
78+
"hipo_metis_no2hop option to true\n");
79+
}
80+
81+
// Warn about large memory consumption
82+
if (S_.storage() > kLargeStorageGB * 1024 * 1024 * 1024) {
83+
log_.printw("Large amount of memory required\n");
84+
}
85+
86+
log_.print("\n");
87+
7388
return kStatusOk;
7489
}
7590

@@ -496,7 +511,7 @@ Int FactorHiGHSSolver::chooseNla() {
496511
status = kStatusErrorAnalyse;
497512

498513
log_.printe("Both NE and AS failed analyse phase\n");
499-
if ((symb_AS.fillin() > 50 || symb_NE.fillin() > 50) &&
514+
if ((symb_AS.fillin() > kLargeFillin || symb_NE.fillin() > kLargeFillin) &&
500515
!options_.metis_no2hop)
501516
log_.print(
502517
"Large fill-in in factorisation. Consider setting the "
@@ -629,6 +644,13 @@ void FactorHiGHSSolver::setParallel() {
629644
}
630645
#endif
631646

647+
// If serial memory is too large, switch off tree parallelism to avoid
648+
// running out of memory
649+
double num_GB = S_.storage() / 1024 / 1024 / 1024;
650+
if (num_GB > kLargeStorageGB) {
651+
parallel_tree = false;
652+
}
653+
632654
if (parallel_tree && parallel_node) {
633655
options_.parallel = kOptionParallelOn;
634656
log_stream << "Full preferred\n";

highs/ipm/hipo/ipm/Parameters.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@ const double kSymbNzMult = 5.0;
2828

2929
// parameters for choice of parallelism
3030
const double kLargeFlopsThresh = 1e7;
31-
const double kLargeSpeedupThresh = 1.5;
31+
const double kLargeSpeedupThresh = 1;
3232
const double kLargeSnThresh = 20.0;
33-
const double kSmallSnThresh = 5.0;
33+
const double kSmallSnThresh = 3.0;
3434
const Int kMinNumberSn = 10;
35+
const double kLargeStorageGB = 20.0;
36+
const double kLargeFillin = 50.0;
3537

3638
// parameters for dense columns
3739
const double kDenseColThresh = 0.5;

0 commit comments

Comments
 (0)