Skip to content

Commit f61b836

Browse files
committed
Resolves naming conflicts in partial files in hadd
Appends the same unique identifier to the name of the partial files within the same hadd execution.
1 parent 7cd817a commit f61b836

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

main/src/hadd.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
#include "Riostream.h"
8080
#include "TClass.h"
8181
#include "TSystem.h"
82+
#include "TUUID.h"
8283
#include "ROOT/StringConv.hxx"
8384
#include <stdlib.h>
8485
#include <climits>
@@ -405,9 +406,11 @@ int main( int argc, char **argv )
405406
std::vector<std::string> partialFiles;
406407

407408
if (multiproc) {
409+
auto uuid = TUUID();
410+
auto partialTail = uuid.AsString();
408411
for (auto i = 0; (i * step) < filesToProcess; i++) {
409412
std::stringstream buffer;
410-
buffer << "partial" << i << ".root";
413+
buffer << "partial" << i <<"_"<< partialTail << ".root";
411414
partialFiles.emplace_back(buffer.str());
412415
}
413416
}
@@ -497,7 +500,7 @@ int main( int argc, char **argv )
497500
} else {
498501
status = sequentialMerge(fileMerger, ffirst, filesToProcess);
499502
}
500-
503+
501504
if (status) {
502505
if (verbosity == 1) {
503506
std::cout << "hadd merged " << fileMerger.GetMergeList()->GetEntries() << " input files in " << targetname

0 commit comments

Comments
 (0)