From a9d810d447727d1d5266694d5b7060ef00978761 Mon Sep 17 00:00:00 2001 From: Peter Sadrozinski Date: Sun, 1 Jul 2012 04:33:52 -0400 Subject: [PATCH] remove hard coded work directory in multicore api --- src/Airports/GenAirports850/scheduler.cxx | 7 ++++--- src/Airports/GenAirports850/scheduler.hxx | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Airports/GenAirports850/scheduler.cxx b/src/Airports/GenAirports850/scheduler.cxx index cdd4fb12..de76abf2 100644 --- a/src/Airports/GenAirports850/scheduler.cxx +++ b/src/Airports/GenAirports850/scheduler.cxx @@ -194,14 +194,15 @@ ProcessList::ProcessList( int n, string& summaryfile, Scheduler* pScheduler ) : // When a slot is available, the main thread calls launch to instantiate a // new pareser process -void ProcessList::Launch( string command, string file, AirportInfo* pai, bool last ) +void ProcessList::Launch( string command, string work_dir, string file, AirportInfo* pai, bool last ) { Process::Args args; char arg[64]; Pipe outPipe; // generate correct command line arguments - args.push_back("--work=work"); + sprintf( arg, "--work=%s", work_dir.c_str() ); + args.push_back(arg); sprintf( arg, "--input=%s", file.c_str() ); args.push_back(arg); @@ -818,7 +819,7 @@ void Scheduler::Schedule( int num_threads, string& summaryfile ) } // Launch a new parser - procList->Launch( command, filename, &originalList[i], last ); + procList->Launch( command, work_dir, filename, &originalList[i], last ); } // Sync up before relaunching diff --git a/src/Airports/GenAirports850/scheduler.hxx b/src/Airports/GenAirports850/scheduler.hxx index c727ca39..27f3f8fc 100644 --- a/src/Airports/GenAirports850/scheduler.hxx +++ b/src/Airports/GenAirports850/scheduler.hxx @@ -140,7 +140,7 @@ public: // When a slot is available, the main thread calls launch to instantiate a // new pareser process - void Launch( string command, string file, AirportInfo* pai, bool last ); + void Launch( string command, string work_dir, string file, AirportInfo* pai, bool last ); Timespan GetNextTimeout(); void HandleReceivedMessages( Net::Socket::SocketList& slr ); void HandleTimeouts();