Skip to content

Commit

Permalink
Added kahip partitioner to mmoc.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquinffernandez committed Aug 29, 2024
1 parent 8c182ce commit 1877177
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 35 deletions.
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 1877177

Please sign in to comment.