diff --git a/GPU/GPUTracking/Base/GPUReconstruction.cxx b/GPU/GPUTracking/Base/GPUReconstruction.cxx index ad2ee2e840d00..3ef995b9f9561 100644 --- a/GPU/GPUTracking/Base/GPUReconstruction.cxx +++ b/GPU/GPUTracking/Base/GPUReconstruction.cxx @@ -87,6 +87,7 @@ GPUReconstruction::GPUReconstruction(const GPUSettingsDeviceBackend& cfg) : mHos throw std::invalid_argument("Cannot be slave to a slave"); } mMaster = cfg.master; + mSlaveId = cfg.master->mSlaves.size(); cfg.master->mSlaves.emplace_back(this); } param().SetDefaults(mGRPSettings.get()); diff --git a/GPU/GPUTracking/Base/GPUReconstruction.h b/GPU/GPUTracking/Base/GPUReconstruction.h index f5b39cb370b9e..d5c0b8e828087 100644 --- a/GPU/GPUTracking/Base/GPUReconstruction.h +++ b/GPU/GPUTracking/Base/GPUReconstruction.h @@ -190,6 +190,7 @@ class GPUReconstruction // Helpers to fetch processors from other shared libraries virtual void GetITSTraits(std::unique_ptr* trackerTraits, std::unique_ptr* vertexerTraits, std::unique_ptr* timeFrame); bool slavesExist() { return mSlaves.size() || mMaster; } + int slaveId() { return mSlaveId; } // Getters / setters for parameters DeviceType GetDeviceType() const; @@ -339,6 +340,7 @@ class GPUReconstruction GPUReconstruction* mMaster = nullptr; // Ptr to a GPUReconstruction object serving as master, sharing GPU memory, events, etc. std::vector mSlaves; // Ptr to slave GPUReconstructions + int mSlaveId = -1; // Id of this slave (-1 for master) // Others bool mInitialized = false; diff --git a/GPU/GPUTracking/Global/GPUChainTracking.cxx b/GPU/GPUTracking/Global/GPUChainTracking.cxx index a3f9b996e070d..f8d4165477220 100644 --- a/GPU/GPUTracking/Global/GPUChainTracking.cxx +++ b/GPU/GPUTracking/Global/GPUChainTracking.cxx @@ -378,7 +378,8 @@ int32_t GPUChainTracking::Init() } if (GetProcessingSettings().debugLevel >= 6) { - mDebugFile->open(mRec->IsGPU() ? "GPU.out" : "CPU.out"); + std::string filename = std::string(mRec->IsGPU() ? "GPU" : "CPU") + (mRec->slaveId() != -1 ? (std::string("_slave") + std::to_string(mRec->slaveId())) : std::string(mRec->slavesExist() ? "_master" : "")) + ".out"; + mDebugFile->open(filename.c_str()); } return 0;