fixed argument parsing & always redirect MPI output

This commit is contained in:
Thorsten Liebig 2011-04-13 13:03:41 +02:00
parent 906800c057
commit 01e8a8011a
3 changed files with 5 additions and 12 deletions

View File

@ -35,7 +35,7 @@
#include "tools/useful.h"
#include "tinyxml.h"
openEMS_FDTD_MPI::openEMS_FDTD_MPI() : openEMS()
openEMS_FDTD_MPI::openEMS_FDTD_MPI(bool m_MPI_Debug) : openEMS()
{
m_MyID = MPI::COMM_WORLD.Get_rank();
m_NumProc = MPI::COMM_WORLD.Get_size();
@ -63,7 +63,7 @@ openEMS_FDTD_MPI::openEMS_FDTD_MPI() : openEMS()
m_Original_Grid = NULL;
//redirect output to file for all ranks > 0
if ((m_MyID>0) && (g_settings.GetVerboseLevel()==0))
if ((m_MyID>0) && (m_MPI_Debug==false))
{
stringstream out_name;
out_name << "ID" << m_MyID << "_" << "output.txt";

View File

@ -27,7 +27,7 @@ class CSRectGrid;
class openEMS_FDTD_MPI : public openEMS
{
public:
openEMS_FDTD_MPI();
openEMS_FDTD_MPI(bool m_MPI_Debug=false);
virtual ~openEMS_FDTD_MPI();
virtual void RunFDTD();

View File

@ -38,17 +38,10 @@ using namespace std;
int main(int argc, char *argv[])
{
//read global command line arguments first
for (int n=2; n<argc; ++n)
{
if (g_settings.parseCommandLineArgument(argv[n]))
continue;
}
#ifdef MPI_SUPPORT
//init MPI
MPI::Init(argc,argv);
openEMS_FDTD_MPI FDTD;
openEMS_FDTD_MPI FDTD(false);
#else
openEMS FDTD;
#endif
@ -102,7 +95,7 @@ int main(int argc, char *argv[])
{
for (int n=2; n<argc; ++n)
{
if (!FDTD.parseCommandLineArgument(argv[n]))
if ( (!FDTD.parseCommandLineArgument(argv[n])) && (!g_settings.parseCommandLineArgument(argv[n])))
cout << "openEMS - unknown argument: " << argv[n] << endl;
}
}