From f630abf813d2125731388167cbcaf451b765c0e8 Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Tue, 8 Mar 2011 14:43:48 +0100 Subject: [PATCH] MPI: external libs info reflects MPI usage --- FDTD/openems_fdtd_mpi.cpp | 20 ++++++++++++++++++++ FDTD/openems_fdtd_mpi.h | 2 ++ main.cpp | 12 +++++++++--- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/FDTD/openems_fdtd_mpi.cpp b/FDTD/openems_fdtd_mpi.cpp index 3b1d570..83a20ce 100644 --- a/FDTD/openems_fdtd_mpi.cpp +++ b/FDTD/openems_fdtd_mpi.cpp @@ -87,6 +87,26 @@ openEMS_FDTD_MPI::~openEMS_FDTD_MPI() m_Output=NULL; } +string openEMS_FDTD_MPI::GetExtLibsInfo() +{ + stringstream str; + + str << openEMS::GetExtLibsInfo(); + + // MPI + str << "\t\t" << "MPI version: " << MPI_VERSION << "." << MPI_SUBVERSION << " -- compiled against: "; +#ifdef MPICH2_VERSION + str << "MPICH2 " MPICH2_VERSION << endl; +#endif + +#ifdef OMPI_MAJOR_VERSION + str << "openMPI: " OMPI_MAJOR_VERSION << "." << OMPI_MINOR_VERSION << "." << OMPI_RELEASE_VERSION << endl; +#endif + + return str.str(); +} + + bool openEMS_FDTD_MPI::parseCommandLineArgument( const char *argv ) { if (!argv) diff --git a/FDTD/openems_fdtd_mpi.h b/FDTD/openems_fdtd_mpi.h index efa84fe..a281914 100644 --- a/FDTD/openems_fdtd_mpi.h +++ b/FDTD/openems_fdtd_mpi.h @@ -34,6 +34,8 @@ public: virtual bool parseCommandLineArgument( const char *argv ); + static string GetExtLibsInfo(); + protected: Operator_MPI* m_MPI_Op; CSRectGrid* m_Original_Grid; diff --git a/main.cpp b/main.cpp index ea3101d..9ecc1f5 100644 --- a/main.cpp +++ b/main.cpp @@ -63,7 +63,11 @@ int main(int argc, char *argv[]) cout << " | openEMS " << bits << " -- version " GIT_VERSION << endl; cout << " | (C) 2010 Thorsten Liebig GPL license" << endl; cout << " -------------------------------------------------------------------- " << endl; +#ifdef MPI_SUPPORT + cout << openEMS_FDTD_MPI::GetExtLibsInfo() << endl; +#else cout << openEMS::GetExtLibsInfo() << endl; +#endif if (argc<=1) { @@ -75,12 +79,14 @@ int main(int argc, char *argv[]) cout << "\t--debug-boxes\t\tDump e.g. probe boxes to vtk file for debugging" << endl; cout << "\t--debug-CSX\t\tWrite CSX geometry file to debugCSX.xml" << endl; cout << "\t--engine=\t\tChoose engine type" << endl; - cout << "\t\t--engine=fastest\t\tfastest available engine" << endl; + cout << "\t\t--engine=fastest\t\tfastest available engine (default)" << 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; #ifdef MPI_SUPPORT - cout << "\t\t--engine=MPI\t\tengine using compressed operator + sse vector extensions + MPI parallel processing" << endl; + cout << "\t\t--engine=MPI\t\t\tengine using compressed operator + sse vector extensions + MPI parallel processing" << endl; + cout << "\t\t--engine=multithreaded\t\tengine using compressed operator + sse vector extensions + MPI + multithreading" << endl; +#else + cout << "\t\t--engine=multithreaded\t\tengine using compressed operator + sse vector extensions + multithreading" << endl; #endif cout << "\t--numThreads=\tForce use n threads for multithreaded engine (needs: --engine=multithreaded)" << endl; cout << "\t--no-simulation\tonly run preprocessing; do not simulate" << endl;