diff --git a/GeneratorInterface/Core/plugins/ExternalGeneratorFilter.cc b/GeneratorInterface/Core/plugins/ExternalGeneratorFilter.cc index 5202d043085cc..e3e49c7ff33a5 100644 --- a/GeneratorInterface/Core/plugins/ExternalGeneratorFilter.cc +++ b/GeneratorInterface/Core/plugins/ExternalGeneratorFilter.cc @@ -46,15 +46,21 @@ 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();