From 187717751d9d7c7d822d627e28349070f0a423cb Mon Sep 17 00:00:00 2001 From: "joaquin.f.fernandez" Date: Thu, 29 Aug 2024 14:11:24 -0300 Subject: [PATCH] Added kahip partitioner to mmoc. --- src/mmoc/ir/annotation.cpp | 33 ++++----------------------------- src/mmoc/ir/annotation.h | 7 +------ 2 files changed, 5 insertions(+), 35 deletions(-) diff --git a/src/mmoc/ir/annotation.cpp b/src/mmoc/ir/annotation.cpp index d53227b1..bfcc9346 100644 --- a/src/mmoc/ir/annotation.cpp +++ b/src/mmoc/ir/annotation.cpp @@ -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), @@ -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")) { @@ -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")) { @@ -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()); @@ -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; } @@ -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"); diff --git a/src/mmoc/ir/annotation.h b/src/mmoc/ir/annotation.h index a4bc5295..550c9642 100644 --- a/src/mmoc/ir/annotation.h +++ b/src/mmoc/ir/annotation.h @@ -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 { @@ -115,7 +113,6 @@ class ModelAnnotation { list output(); string storeData(); string partitionMethodString(); - PartitionMethod partitionMethod(); bool parallel(); int polyCoeffs(); string dtSynchString(); @@ -195,7 +192,6 @@ class ModelAnnotation { void processList(AST_Expression x, list *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); @@ -219,8 +215,7 @@ class ModelAnnotation { list _output; double _initialTime; double _finalTime; - PartitionMethod _partitionMethod; - string _partitionMethodString; + string _partition_method_string; bool _parallel; double _dt; int _polyCoeffs;