From d882899ed21635c1837d0cabd72e311374bd5074 Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Fri, 21 May 2010 08:16:24 +0200 Subject: [PATCH] new openEMS option --engine=fastest & options console output this new option should always choose the (in most cases) fastest engine available --- main.cpp | 14 +++++++++++++- openems.cpp | 6 ++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 4cc1cf9..20703c7 100644 --- a/main.cpp +++ b/main.cpp @@ -40,7 +40,19 @@ int main(int argc, char *argv[]) if (argc<=1) { - cout << " usage: openEMS FDTD_XML_FILE [--disable-dumps] [--debug-material] [--debug-operator]" << endl; + cout << " Usage: openEMS [...]" << endl << endl; + cout << " " << endl; + cout << "\t--disable-dumps\t\tDisable all field dumps for faster simulation" << endl; + cout << "\t--debug-material\tDump material distribution to a vtk file for debugging" << endl; + cout << "\t--debug-operator\tDump operator to vtk file for debugging" << endl; + cout << "\t--debug-boxes\t\tDump e.g. probe boxes to vtk file for debugging" << endl; + cout << "\t--engine=\t\tChoose engine type" << endl; + cout << "\t\t--engine=fastest\t\tfastest available engine" << endl; + cout << "\t\t--engine=sse\t\t\tengine using sse vector extensions" << endl; + cout << "\t\t--engine=sse_compressed\t\tengine using compressed operator + sse vector extensions" << endl; + cout << "\t\t--engine=multithreaded\t\tengine using compressed operator + sse vector extensions + multithreading" << endl; + cout << "\t--numThreads=\tForce use n threads for multithreaded engine (needs: --engine=multithreaded)" << endl; + cout << endl; exit(-1); } diff --git a/openems.cpp b/openems.cpp index a614a42..a66d9db 100644 --- a/openems.cpp +++ b/openems.cpp @@ -125,6 +125,12 @@ bool openEMS::parseCommandLineArgument( const char *argv ) m_engine = EngineType_SSE_Compressed; return true; } + else if (strcmp(argv,"--engine=fastest")==0) + { + cout << "openEMS - enabled multithreading engine" << endl; + m_engine = EngineType_Multithreaded; + return true; + } return false; }