diff --git a/tools/lammps-gui/preferences.cpp b/tools/lammps-gui/preferences.cpp index 1e8e23ad62..624f59009c 100644 --- a/tools/lammps-gui/preferences.cpp +++ b/tools/lammps-gui/preferences.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #if defined(_OPENMP) #include @@ -400,11 +401,11 @@ AcceleratorTab::AcceleratorTab(QSettings *_settings, LammpsWrapper *_lammps, QWi int maxthreads = 1; #if defined(_OPENMP) - maxthreads = omp_get_max_threads(); + maxthreads = QThread::idealThreadCount(); #endif auto *choices = new QFrame; auto *choiceLayout = new QVBoxLayout; - auto *ntlabel = new QLabel("Number of threads:"); + auto *ntlabel = new QLabel(QString("Number of threads (max %1):").arg(maxthreads)); auto *ntchoice = new QLineEdit(settings->value("nthreads", maxthreads).toString()); auto *intval = new QIntValidator(1, maxthreads, this); ntchoice->setValidator(intval);