Skip to content

Commit 25a92dd

Browse files
committed
get ROC numa node from /sys/bus/pci/devices because ROC library reports wrong value
1 parent ee78b66 commit 25a92dd

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/ReadoutEquipmentRORC.cxx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,26 @@ void ReadoutEquipmentRORC::finalCounters()
519519
int getPreferredROCNumaNode(ConfigFile& cfg, std::string name) {
520520
try {
521521
std::string cardId = cfg.getValue<std::string>(name + ".cardId");
522+
523+
// try to get numa node directly (bug in ROC function to retrieve it)
524+
int numaNode = -1;
525+
std::string numapath = "/sys/bus/pci/devices/0000:"+ AliceO2::roc::findCard(cardId).pciAddress.toString() + "/numa_node";
526+
FILE *fp = fopen(numapath.c_str(), "r");
527+
if (fp!=nullptr) {
528+
char buffer[16] = "";
529+
if (fgets(buffer, sizeof(buffer), fp) != nullptr) {
530+
if (sscanf(buffer, "%d", &numaNode) != 1) {
531+
numaNode = -1;
532+
} else {
533+
//printf("*** Card %s : %s = %d\n", name.c_str(), numapath.c_str(), numaNode);
534+
}
535+
}
536+
fclose(fp);
537+
}
538+
if (numaNode>=0) {
539+
return numaNode;
540+
}
541+
522542
return AliceO2::roc::findCard(cardId).numaNode;
523543
}
524544
catch (...) {

0 commit comments

Comments
 (0)