indicate whether multi-thread is available in preferences

This commit is contained in:
Axel Kohlmeyer
2023-10-13 06:59:06 -04:00
parent 50d2ebc27d
commit 2f67826363

View File

@ -410,11 +410,19 @@ AcceleratorTab::AcceleratorTab(QSettings *_settings, LammpsWrapper *_lammps, QWi
#endif #endif
auto *choices = new QFrame; auto *choices = new QFrame;
auto *choiceLayout = new QVBoxLayout; auto *choiceLayout = new QVBoxLayout;
#if defined(_OPENMP)
auto *ntlabel = new QLabel(QString("Number of threads (max %1):").arg(maxthreads)); auto *ntlabel = new QLabel(QString("Number of threads (max %1):").arg(maxthreads));
auto *ntchoice = new QLineEdit(settings->value("nthreads", maxthreads).toString()); auto *ntchoice = new QLineEdit(settings->value("nthreads", maxthreads).toString());
#else
auto *ntlabel = new QLabel(QString("Number of threads (OpenMP not available):"));
auto *ntchoice = new QLineEdit("1");
#endif
auto *intval = new QIntValidator(1, maxthreads, this); auto *intval = new QIntValidator(1, maxthreads, this);
ntchoice->setValidator(intval); ntchoice->setValidator(intval);
ntchoice->setObjectName("nthreads"); ntchoice->setObjectName("nthreads");
#if !defined(_OPENMP)
ntchoice->setEnabled(false);
#endif
choiceLayout->addWidget(ntlabel); choiceLayout->addWidget(ntlabel);
choiceLayout->addWidget(ntchoice); choiceLayout->addWidget(ntchoice);