Skip to content

Commit

Permalink
[iss-264]
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 9c93bdb
Author: joaquin.f.fernandez <joaquin.f.fernandez@gmail.com>
Date:   Thu Aug 29 14:11:42 2024 -0300

    Added kahip paritioner to engine.

commit 1877177
Author: joaquin.f.fernandez <joaquin.f.fernandez@gmail.com>
Date:   Thu Aug 29 14:11:24 2024 -0300

    Added kahip partitioner to mmoc.

commit 8c182ce
Author: joaquin.f.fernandez <joaquin.f.fernandez@gmail.com>
Date:   Thu Aug 29 14:11:06 2024 -0300

    Added kahip partitioner to gui.
  • Loading branch information
joaquinffernandez committed Aug 30, 2024
1 parent 29a4fad commit e6149be
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 39 deletions.
2 changes: 1 addition & 1 deletion src/engine/common/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ typedef enum {
SD_DBG_Dt = 1 << 8
} SD_Debug;

typedef enum { SD_Metis, SD_HMetis, SD_Scotch, SD_Patoh, SD_Manual } SD_PartitionMethod;
typedef enum { SD_Metis, SD_HMetis, SD_Scotch, SD_Patoh, SD_Manual, SD_KaHIP } SD_PartitionMethod;

typedef enum { SD_DT_Fixed, SD_DT_Adaptive, SD_DT_AdaptiveDiscrete } SD_DtSynch;

Expand Down
4 changes: 3 additions & 1 deletion src/engine/common/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ SD_PartitionMethod _getPartitionMethod(const char *sol)
return SD_Patoh;
} else if (!strcmp(sol, "Manual")) {
return SD_Manual;
} else if (!strcmp(sol, "KaHIP")) {
return SD_KaHIP;
}
return SD_Metis;
return SD_Scotch;
}

SD_DtSynch _getDtSynch(const char *sol)
Expand Down
1 change: 1 addition & 0 deletions src/gui/mmohighlight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ MmoHighlighter::MmoHighlighter(QTextDocument *parent, h_type file) : QSyntaxHigh
<< "\\bSparse\\b"
<< "\\bScotch\\b"
<< "\\bPatoh\\b"
<< "\\bKaHIP\\b"
<< "\\bManual\\b"
<< "\\bMTPL\\b"
<< "\\bMTPL_IT\\b"
Expand Down
7 changes: 5 additions & 2 deletions src/gui/runform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ int RunDlg::getPartitionMethodIdx(QString str)
if (str.trimmed() == "HMetis") return 1;
if (str.trimmed() == "Scotch") return 2;
if (str.trimmed() == "Patoh") return 3;
if (str.trimmed() == "Manual") return 4;
if (str.trimmed() == "KaHIP") return 4;
if (str.trimmed() == "Manual") return 5;
return 0;
}

Expand All @@ -265,9 +266,11 @@ QString RunDlg::getPartitionMethodString(int idx)
case 3:
return "Patoh";
case 4:
return "KaHIP";
case 5:
return "Manual";
}
return "Metis";
return "Scotch";
}

int RunDlg::getJacobianIdx(QString str)
Expand Down
5 changes: 5 additions & 0 deletions src/gui/ui/run.ui
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,11 @@
<string>PATOH</string>
</property>
</item>
<item>
<property name="text">
<string>KAHIP</string>
</property>
</item>
<item>
<property name="text">
<string>MANUAL</string>
Expand Down
33 changes: 4 additions & 29 deletions src/mmoc/ir/annotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ ModelAnnotation::ModelAnnotation()
_output(),
_initialTime(0),
_finalTime(0),
_partitionMethod(PartitionMethod::Scotch),
_partitionMethodString("Scotch"),
_partition_method_string("Scotch"),
_parallel(false),
_dt(0),
_polyCoeffs(1),
Expand Down Expand Up @@ -367,8 +366,6 @@ void ModelAnnotation::processExpressionList(AST_Expression x, AST_ExpressionList
}
}

PartitionMethod ModelAnnotation::partitionMethod() { return _partitionMethod; }

DT_Synch ModelAnnotation::getDtSynch(string s)
{
if (!s.compare("SD_DT_Fixed")) {
Expand All @@ -379,26 +376,6 @@ DT_Synch ModelAnnotation::getDtSynch(string s)
return DT_Synch::DT_Fixed;
}

PartitionMethod ModelAnnotation::getPartitionMethod(string s)
{
if (!s.compare("Metis")) {
return PartitionMethod::Metis;
} else if (!s.compare("HMetis")) {
return PartitionMethod::HMetis;
} else if (!s.compare("Scotch")) {
return PartitionMethod::Scotch;
} else if (!s.compare("Patoh")) {
return PartitionMethod::Patoh;
} else if (!s.compare("MTPL")) {
return PartitionMethod::MTPL;
} else if (!s.compare("MTPL_IT")) {
return PartitionMethod::MTPL_IT;
} else if (!s.compare("Manual")) {
return PartitionMethod::Manual;
}
return PartitionMethod::Scotch;
}

Solver ModelAnnotation::getSolver(string s)
{
if (!s.compare("QSS")) {
Expand Down Expand Up @@ -547,8 +524,7 @@ void ModelAnnotation::processAnnotation(string annot, AST_Modification_Equal x)
processExpressionList(x->exp(), &_output);
break;
case type::PARTITION_METHOD:
_partitionMethod = getPartitionMethod(av.str());
_partitionMethodString = av.str();
_partition_method_string = av.str();
break;
case type::DELTAT_SYNCH:
_dtSynch = getDtSynch(av.str());
Expand Down Expand Up @@ -650,7 +626,7 @@ string ModelAnnotation::solverString() { return _solverString; }

Solver ModelAnnotation::solver() { return _solver; }

string ModelAnnotation::partitionMethodString() { return _partitionMethodString; }
string ModelAnnotation::partitionMethodString() { return _partition_method_string; }

DT_Synch ModelAnnotation::dtSynch() { return _dtSynch; }

Expand Down Expand Up @@ -778,8 +754,7 @@ EvalAnnotation::EvalAnnotation() : _tokens()
_tokens.emplace_back("HMetis");
_tokens.emplace_back("Scotch");
_tokens.emplace_back("Patoh");
_tokens.emplace_back("MTPL");
_tokens.emplace_back("MTPL_IT");
_tokens.emplace_back("KaHIP");
_tokens.emplace_back("Manual");
_tokens.emplace_back("SD_DT_Fixed");
_tokens.emplace_back("Sparse");
Expand Down
7 changes: 1 addition & 6 deletions src/mmoc/ir/annotation.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ enum class Solver {
mLIQSS2
};

enum class PartitionMethod { Metis, HMetis, Scotch, Patoh, MTPL, MTPL_IT, Manual };

enum class DT_Synch { DT_Fixed, DT_Asynchronous };

class FunctionAnnotation {
Expand Down Expand Up @@ -115,7 +113,6 @@ class ModelAnnotation {
list<AST_Expression> output();
string storeData();
string partitionMethodString();
PartitionMethod partitionMethod();
bool parallel();
int polyCoeffs();
string dtSynchString();
Expand Down Expand Up @@ -195,7 +192,6 @@ class ModelAnnotation {
void processList(AST_Expression x, list<string> *l);
void processExpressionList(AST_Expression x, AST_ExpressionList exps);
Solver getSolver(string s);
PartitionMethod getPartitionMethod(string s);
DT_Synch getDtSynch(string s);
void parseMatrix(AST_Expression exp, IR::MATRIX::UserDefMatrixExps &matrix);

Expand All @@ -219,8 +215,7 @@ class ModelAnnotation {
list<AST_Expression> _output;
double _initialTime;
double _finalTime;
PartitionMethod _partitionMethod;
string _partitionMethodString;
string _partition_method_string;
bool _parallel;
double _dt;
int _polyCoeffs;
Expand Down

0 comments on commit e6149be

Please sign in to comment.