79 lines
3.5 KiB
Diff
79 lines
3.5 KiB
Diff
From 589ac491519446191b7d480a476ab831dc09b5f9 Mon Sep 17 00:00:00 2001
|
|
From: Mattias Ellert <mattias.ellert@physics.uu.se>
|
|
Date: Wed, 30 Mar 2022 15:51:07 +0200
|
|
Subject: [PATCH] Limit the number of threads in TMVA CNN/DNN test to save
|
|
memory
|
|
|
|
Processing /builddir/build/BUILD/root-6.26.00/tutorials/tmva/TMVA_CNN_Classification.C...
|
|
Running with nthreads = 224
|
|
|
|
[ ... ]
|
|
|
|
OpenBLAS warning: precompiled NUM_THREADS exceeded, adding auxiliary array for thread metadata.
|
|
OpenBLAS warning: precompiled NUM_THREADS exceeded, adding auxiliary array for thread metadata.
|
|
OpenBLAS warning: precompiled NUM_THREADS exceeded, adding auxiliary array for thread metadata.
|
|
OpenBLAS warning: precompiled NUM_THREADS exceeded, adding auxiliary array for thread metadata.
|
|
OpenBLAS warning: precompiled NUM_THREADS exceeded, adding auxiliary array for thread metadata.
|
|
OpenBLAS warning: precompiled NUM_THREADS exceeded, adding auxiliary array for thread metadata.
|
|
OpenBLAS warning: precompiled NUM_THREADS exceeded, adding auxiliary array for thread metadata.
|
|
OpenBLAS warning: precompiled NUM_THREADS exceeded, adding auxiliary array for thread metadata.
|
|
OpenBLAS warning: precompiled NUM_THREADS exceeded, adding auxiliary array for thread metadata.
|
|
OpenBLAS warning: precompiled NUM_THREADS exceeded, adding auxiliary array for thread metadata.
|
|
OpenBLAS warning: precompiled NUM_THREADS exceeded, adding auxiliary array for thread metadata.
|
|
*** Break *** segmentation violation
|
|
*** Break *** segmentation violation
|
|
*** Break *** segmentation violation
|
|
*** Break *** segmentation violation
|
|
*** Break *** segmentation violation
|
|
*** Break *** segmentation violation
|
|
---
|
|
tutorials/tmva/TMVA_CNN_Classification.C | 6 ++++--
|
|
tutorials/tmva/TMVA_RNN_Classification.C | 6 ++++--
|
|
2 files changed, 8 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/tutorials/tmva/TMVA_CNN_Classification.C b/tutorials/tmva/TMVA_CNN_Classification.C
|
|
index 3e590c5958..b748fcee6c 100644
|
|
--- a/tutorials/tmva/TMVA_CNN_Classification.C
|
|
+++ b/tutorials/tmva/TMVA_CNN_Classification.C
|
|
@@ -125,14 +125,16 @@ void TMVA_CNN_Classification(std::vector<bool> opt = {1, 1, 1, 1, 1})
|
|
|
|
bool writeOutputFile = true;
|
|
|
|
- int num_threads = 0; // use default threads
|
|
+ int num_threads = 32;
|
|
|
|
TMVA::Tools::Instance();
|
|
|
|
// do enable MT running
|
|
if (num_threads >= 0) {
|
|
ROOT::EnableImplicitMT(num_threads);
|
|
- if (num_threads > 0) gSystem->Setenv("OMP_NUM_THREADS", TString::Format("%d",num_threads));
|
|
+ if (ROOT::GetThreadPoolSize() > 0)
|
|
+ gSystem->Setenv("OMP_NUM_THREADS",
|
|
+ TString::Format("%u", ROOT::GetThreadPoolSize()));
|
|
}
|
|
else
|
|
gSystem->Setenv("OMP_NUM_THREADS", "1");
|
|
diff --git a/tutorials/tmva/TMVA_RNN_Classification.C b/tutorials/tmva/TMVA_RNN_Classification.C
|
|
index 5be80824f9..f902025875 100644
|
|
--- a/tutorials/tmva/TMVA_RNN_Classification.C
|
|
+++ b/tutorials/tmva/TMVA_RNN_Classification.C
|
|
@@ -190,11 +190,13 @@ void TMVA_RNN_Classification(int use_type = 1)
|
|
useKeras = false;
|
|
#endif
|
|
|
|
- int num_threads = 0; // use by default all threads
|
|
+ int num_threads = 32;
|
|
// do enable MT running
|
|
if (num_threads >= 0) {
|
|
ROOT::EnableImplicitMT(num_threads);
|
|
- if (num_threads > 0) gSystem->Setenv("OMP_NUM_THREADS", TString::Format("%d",num_threads));
|
|
+ if (ROOT::GetThreadPoolSize() > 0)
|
|
+ gSystem->Setenv("OMP_NUM_THREADS",
|
|
+ TString::Format("%u", ROOT::GetThreadPoolSize()));
|
|
}
|
|
else
|
|
gSystem->Setenv("OMP_NUM_THREADS", "1");
|
|
--
|
|
2.35.1
|
|
|