Skip to content

Commit 1e9cfc0

Browse files
committed
Sort the process histories according to the reduced id
To have the order stable, independent of the hardware of the node where the file was produced.
1 parent 1df230f commit 1e9cfc0

File tree

4 files changed

+35
-27
lines changed

4 files changed

+35
-27
lines changed

IOPool/Common/bin/EdmProvDump.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,14 @@ void ProvenanceDumper::work_() {
793793
}
794794

795795
if (!phv_.empty()) {
796+
// (Re-)Sort according to reduced history ID in order to have a
797+
// stable order with respect to hardware differences
798+
std::ranges::stable_sort(phv_, {}, [](auto const& history) {
799+
auto copy = history;
800+
copy.reduce();
801+
return copy.id();
802+
});
803+
796804
for (auto const& history : phv_) {
797805
for (auto const& process : history) {
798806
phc_.push_back(process);

IOPool/Common/test/unit_test_outputs/provdump_complex_final.log

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ History: {
1414
FINAL [1]
1515
}
1616
History: {
17-
PROD1 [2]
17+
PROD1 [3]
1818
MERGE [2]
1919
INTERMEDIATE [1]
2020
SPLIT [2]
2121
FINAL [1]
2222
}
2323
History: {
24-
PROD1 [3]
24+
PROD1 [2]
2525
MERGE [2]
2626
INTERMEDIATE [1]
2727
SPLIT [2]
@@ -30,34 +30,34 @@ History: {
3030
---------Processes---------
3131
Process: PROD1 [1]
3232
PSet id: 6c63e586d4f6517ea1ec649e9eecf4b6
33-
accelerators: test-one
33+
accelerators: test-two
3434

3535
Process: PROD1 [2]
3636
PSet id: b6a0b924ba604501a5436d5102a43418
3737
accelerators: cpu
3838

3939
Process: PROD1 [3]
4040
PSet id: 6c63e586d4f6517ea1ec649e9eecf4b6
41-
accelerators: test-two
41+
accelerators: test-one
4242

4343
Process: MERGE [1]
44-
PSet id: df290421e5db9b54108985d98d780a9f
44+
PSet id: cbaeb7a2de5d7cab57c899cc270bc5e0
4545
accelerators: cpu
4646

4747
Process: MERGE [2]
48-
PSet id: cbaeb7a2de5d7cab57c899cc270bc5e0
48+
PSet id: df290421e5db9b54108985d98d780a9f
4949
accelerators: cpu
5050

5151
Process: INTERMEDIATE [1]
5252
PSet id: 78ab4ebc3b62f905cf875c3d2f3e697b
5353
accelerators: cpu
5454

5555
Process: SPLIT [1]
56-
PSet id: 3072d8ea12f0d2269baf3e3075394fac
56+
PSet id: 948ea93d681cce4262de72dd886fdc2b
5757
accelerators: cpu
5858

5959
Process: SPLIT [2]
60-
PSet id: 948ea93d681cce4262de72dd886fdc2b
60+
PSet id: 3072d8ea12f0d2269baf3e3075394fac
6161
accelerators: cpu
6262

6363
Process: FINAL [1]
@@ -169,7 +169,7 @@ Module: TriggerResults MERGE
169169
}
170170

171171
Module: intVectorProducer MERGE
172-
Process: MERGE [1]
172+
Process: MERGE [2]
173173
PSet id:069ebcaafc2423e72b81399666f0fa6f
174174
products: {
175175
ints_intVectorProducer__MERGE. BranchID 2485751069
@@ -182,7 +182,7 @@ Module: intVectorProducer MERGE
182182
delta: int32 tracked = 0
183183
ivalue: int32 tracked = 11
184184
}
185-
Process: MERGE [2]
185+
Process: MERGE [1]
186186
PSet id:df9967266015a84cb07cb6490005dc1e
187187
products: {
188188
ints_intVectorProducer__MERGE. BranchID 2485751069
@@ -313,7 +313,7 @@ Module: TriggerResults SPLIT
313313
}
314314

315315
Module: intVectorProducer SPLIT
316-
Process: SPLIT [1]
316+
Process: SPLIT [2]
317317
PSet id:069ebcaafc2423e72b81399666f0fa6f
318318
products: {
319319
ints_intVectorProducer__SPLIT. BranchID 3967080626
@@ -326,7 +326,7 @@ Module: intVectorProducer SPLIT
326326
delta: int32 tracked = 0
327327
ivalue: int32 tracked = 11
328328
}
329-
Process: SPLIT [2]
329+
Process: SPLIT [1]
330330
PSet id:386c301f701ba1a2d59426b6bcd9df0d
331331
products: {
332332
ints_intVectorProducer__SPLIT. BranchID 3967080626

IOPool/Common/test/unit_test_outputs/provdump_complex_intermediate.log

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,26 @@ History: {
1111
}
1212
History: {
1313
PROD1 [3]
14-
MERGE [1]
14+
MERGE [2]
1515
INTERMEDIATE [1]
1616
}
1717
History: {
18-
PROD1 [1]
19-
MERGE [2]
18+
PROD1 [3]
19+
MERGE [1]
2020
INTERMEDIATE [1]
2121
}
2222
---------Processes---------
2323
Process: PROD1 [1]
24-
PSet id: b6a0b924ba604501a5436d5102a43418
25-
accelerators: cpu
24+
PSet id: 6c63e586d4f6517ea1ec649e9eecf4b6
25+
accelerators: test-two
2626

2727
Process: PROD1 [2]
2828
PSet id: 6c63e586d4f6517ea1ec649e9eecf4b6
2929
accelerators: test-one
3030

3131
Process: PROD1 [3]
32-
PSet id: 6c63e586d4f6517ea1ec649e9eecf4b6
33-
accelerators: test-two
32+
PSet id: b6a0b924ba604501a5436d5102a43418
33+
accelerators: cpu
3434

3535
Process: MERGE [1]
3636
PSet id: cbaeb7a2de5d7cab57c899cc270bc5e0
@@ -202,7 +202,7 @@ Module: intProducerU PROD1
202202
}
203203

204204
Module: intVectorProducer PROD1
205-
Process: PROD1 [1]
205+
Process: PROD1 [3]
206206
PSet id:069ebcaafc2423e72b81399666f0fa6f
207207
products: {
208208
ints_intVectorProducer__PROD1. BranchID 315054627
@@ -215,7 +215,7 @@ Module: intVectorProducer PROD1
215215
delta: int32 tracked = 0
216216
ivalue: int32 tracked = 11
217217
}
218-
Process: PROD1 [2] [3]
218+
Process: PROD1 [1] [2]
219219
PSet id:df9967266015a84cb07cb6490005dc1e
220220
products: {
221221
ints_intVectorProducer__PROD1. BranchID 315054627

IOPool/Common/test/unit_test_outputs/provdump_complex_merge.log

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ History: {
99
}
1010
---------Processes---------
1111
Process: PROD1 [1]
12-
PSet id: 6c63e586d4f6517ea1ec649e9eecf4b6
13-
accelerators: test-one
14-
15-
Process: PROD1 [2]
1612
PSet id: b6a0b924ba604501a5436d5102a43418
1713
accelerators: cpu
1814

15+
Process: PROD1 [2]
16+
PSet id: 6c63e586d4f6517ea1ec649e9eecf4b6
17+
accelerators: test-one
18+
1919
Process: MERGE [1]
2020
PSet id: df290421e5db9b54108985d98d780a9f
2121
accelerators: cpu
@@ -132,7 +132,7 @@ Module: intProducerU PROD1
132132
}
133133

134134
Module: intVectorProducer PROD1
135-
Process: PROD1 [2]
135+
Process: PROD1 [1]
136136
PSet id:069ebcaafc2423e72b81399666f0fa6f
137137
products: {
138138
ints_intVectorProducer__PROD1. BranchID 315054627
@@ -145,7 +145,7 @@ Module: intVectorProducer PROD1
145145
delta: int32 tracked = 0
146146
ivalue: int32 tracked = 11
147147
}
148-
Process: PROD1 [1]
148+
Process: PROD1 [2]
149149
PSet id:df9967266015a84cb07cb6490005dc1e
150150
products: {
151151
ints_intVectorProducer__PROD1. BranchID 315054627

0 commit comments

Comments
 (0)