Skip to content

Commit a63185e

Browse files
authored
Merge c0dbad2 into 002f1f3
2 parents 002f1f3 + c0dbad2 commit a63185e

File tree

1 file changed

+33
-23
lines changed

1 file changed

+33
-23
lines changed

ydb/core/driver_lib/run/auto_config_initializer.cpp

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <ydb/core/protos/config.pb.h>
44

55
#include <ydb/library/actors/util/affinity.h>
6+
#include <ydb/library/yverify_stream/yverify_stream.h>
67
#include <util/system/info.h>
78

89
namespace {
@@ -50,27 +51,27 @@ namespace {
5051
{ {2, 4}, {4, 8}, {1, 2}, {0, 0}, {1, 3} }, // 8
5152
{ {2, 5}, {4, 9}, {2, 3}, {0, 0}, {1, 3} }, // 9
5253
{ {2, 5}, {5, 10}, {2, 3}, {0, 0}, {1, 3} }, // 10
53-
{ {2, 6}, {6, 11}, {2, 3}, {0, 0}, {2, 4} }, // 11
54-
{ {2, 6}, {7, 12}, {2, 3}, {0, 0}, {2, 5} }, // 12
55-
{ {3, 7}, {7, 13}, {2, 3}, {0, 0}, {2, 5} }, // 13
56-
{ {3, 7}, {7, 14}, {2, 3}, {0, 0}, {3, 6} }, // 14
57-
{ {3, 8}, {8, 15}, {2, 4}, {0, 0}, {3, 6} }, // 15
58-
{ {3, 8}, {9, 16}, {2, 4}, {0, 0}, {3, 6} }, // 16
59-
{ {3, 9}, {10, 17}, {2, 4}, {0, 0}, {3, 7} }, // 17
60-
{ {3, 9}, {10, 18}, {3, 5}, {0, 0}, {3, 7} }, // 18
61-
{ {4, 10}, {10, 19}, {3, 5}, {0, 0}, {4, 8} }, // 19
62-
{ {4, 10}, {10, 20}, {3, 5}, {0, 0}, {4, 8} }, // 20
63-
{ {4, 11}, {11, 21}, {3, 5}, {0, 0}, {4, 8} }, // 21
64-
{ {4, 11}, {12, 22}, {3, 5}, {0, 0}, {4, 9} }, // 22
65-
{ {4, 12}, {13, 23}, {3, 6}, {0, 0}, {4, 9} }, // 23
66-
{ {4, 12}, {13, 24}, {3, 6}, {0, 0}, {5, 10} }, // 24
67-
{ {5, 13}, {13, 25}, {3, 6}, {0, 0}, {5, 10} }, // 25
68-
{ {5, 13}, {13, 26}, {4, 7}, {0, 0}, {5, 10} }, // 26
69-
{ {5, 14}, {14, 27}, {4, 7}, {0, 0}, {5, 11} }, // 27
54+
{ {2, 6}, {5, 11}, {2, 3}, {0, 0}, {2, 4} }, // 11
55+
{ {2, 6}, {6, 12}, {2, 3}, {0, 0}, {2, 5} }, // 12
56+
{ {3, 7}, {6, 13}, {2, 3}, {0, 0}, {2, 5} }, // 13
57+
{ {3, 7}, {6, 14}, {2, 3}, {0, 0}, {3, 6} }, // 14
58+
{ {3, 8}, {7, 15}, {2, 4}, {0, 0}, {3, 6} }, // 15
59+
{ {3, 8}, {8, 16}, {2, 4}, {0, 0}, {3, 6} }, // 16
60+
{ {3, 9}, {9, 17}, {2, 4}, {0, 0}, {3, 7} }, // 17
61+
{ {3, 9}, {9, 18}, {3, 5}, {0, 0}, {3, 7} }, // 18
62+
{ {3, 10}, {9, 19}, {3, 5}, {0, 0}, {4, 8} }, // 19
63+
{ {4, 10}, {9, 20}, {3, 5}, {0, 0}, {4, 8} }, // 20
64+
{ {4, 11}, {10, 21}, {3, 5}, {0, 0}, {4, 8} }, // 21
65+
{ {4, 11}, {11, 22}, {3, 5}, {0, 0}, {4, 9} }, // 22
66+
{ {4, 12}, {12, 23}, {3, 6}, {0, 0}, {4, 9} }, // 23
67+
{ {4, 12}, {12, 24}, {3, 6}, {0, 0}, {5, 10} }, // 24
68+
{ {5, 13}, {12, 25}, {3, 6}, {0, 0}, {5, 10} }, // 25
69+
{ {5, 13}, {12, 26}, {4, 7}, {0, 0}, {5, 10} }, // 26
70+
{ {5, 14}, {13, 27}, {4, 7}, {0, 0}, {5, 11} }, // 27
7071
{ {5, 14}, {14, 28}, {4, 7}, {0, 0}, {5, 11} }, // 28
71-
{ {5, 15}, {15, 29}, {4, 8}, {0, 0}, {6, 12} }, // 29
72-
{ {5, 15}, {16, 30}, {4, 8}, {0, 0}, {6, 12} }, // 30
73-
{ {6, 18}, {16, 31}, {4, 8}, {0, 0}, {6, 12} }, // 31
72+
{ {5, 15}, {14, 29}, {4, 8}, {0, 0}, {6, 12} }, // 29
73+
{ {5, 15}, {15, 30}, {4, 8}, {0, 0}, {6, 12} }, // 30
74+
{ {6, 18}, {15, 31}, {4, 8}, {0, 0}, {6, 12} }, // 31
7475
};
7576

7677
TShortPoolCfg HybridCpuTable[MaxPreparedCpuCount + 1][5] {
@@ -158,9 +159,11 @@ namespace {
158159
TShortPoolCfg result = cpuTable[MaxPreparedCpuCount][poolIdx];
159160
result.ThreadCount *= k;
160161
result.MaxThreadCount *= k;
161-
TShortPoolCfg additional = cpuTable[mod][poolIdx];
162-
result.ThreadCount += additional.ThreadCount;
163-
result.MaxThreadCount += additional.MaxThreadCount;
162+
if (mod) {
163+
TShortPoolCfg additional = cpuTable[mod][poolIdx];
164+
result.ThreadCount += additional.ThreadCount;
165+
result.MaxThreadCount += additional.MaxThreadCount;
166+
}
164167
return result;
165168
}
166169

@@ -274,6 +277,13 @@ namespace NKikimr::NAutoConfigInitializer {
274277
config->GetNodeType() == NKikimrConfig::TActorSystemConfig::COMPUTE ? ComputeCpuTable :
275278
HybridCpuTable );
276279

280+
// check cpu table
281+
i16 cpuSum = 0;
282+
for (auto poolKind : {EPoolKind::System, EPoolKind::User, EPoolKind::Batch, EPoolKind::IC}) {
283+
TShortPoolCfg cfg = GetShortPoolChg(poolKind, cpuCount, cpuTable);
284+
cpuSum += cfg.ThreadCount;
285+
}
286+
Y_VERIFY_S(cpuSum == cpuCount, "cpuSum# " << cpuSum << " cpuCount# " << cpuCount);
277287

278288
for (ui32 poolIdx = 0; poolIdx < poolCount; ++poolIdx) {
279289
auto *executor = executors[poolIdx];

0 commit comments

Comments
 (0)