diff --git a/GeneratorInterface/Core/bin/externalGenerator.cc b/GeneratorInterface/Core/bin/externalGenerator.cc index fb8722415842d..08ed2d0eb8374 100644 --- a/GeneratorInterface/Core/bin/externalGenerator.cc +++ b/GeneratorInterface/Core/bin/externalGenerator.cc @@ -6,6 +6,7 @@ #include #include #include +#include #include "FWCore/TestProcessor/interface/TestProcessor.h" @@ -137,6 +138,13 @@ int main(int argc, char* argv[]) { return 1; } + using namespace std::string_literals; + using namespace std::filesystem; + + auto newDir = path("thread"s + vm[kUniqueIDOpt].as()); + create_directory(newDir); + current_path(newDir); + WorkerMonitorThread monitorThread; monitorThread.startThread(); diff --git a/GeneratorInterface/Core/plugins/ExternalGeneratorFilter.cc b/GeneratorInterface/Core/plugins/ExternalGeneratorFilter.cc index 2436ef977b565..9a8960f10fdb7 100644 --- a/GeneratorInterface/Core/plugins/ExternalGeneratorFilter.cc +++ b/GeneratorInterface/Core/plugins/ExternalGeneratorFilter.cc @@ -46,22 +46,15 @@ namespace externalgen { channel_.setupWorker([&]() { using namespace std::string_literals; - using namespace std::filesystem; edm::LogSystem("ExternalProcess") << id_ << " starting external process \n"; std::string verboseCommand; if (verbose) { verboseCommand = "--verbose "; } - auto curDir = current_path(); - auto newDir = path("thread"s + std::to_string(id_)); - create_directory(newDir); - current_path(newDir); pipe_ = popen(("cmsExternalGenerator "s + verboseCommand + channel_.sharedMemoryName() + " " + channel_.uniqueID()) .c_str(), "w"); - current_path(curDir); - if (nullptr == pipe_) { abort(); }