indicate whether multi-thread is available in preferences
This commit is contained in:
@ -410,11 +410,19 @@ AcceleratorTab::AcceleratorTab(QSettings *_settings, LammpsWrapper *_lammps, QWi
|
||||
#endif
|
||||
auto *choices = new QFrame;
|
||||
auto *choiceLayout = new QVBoxLayout;
|
||||
#if defined(_OPENMP)
|
||||
auto *ntlabel = new QLabel(QString("Number of threads (max %1):").arg(maxthreads));
|
||||
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);
|
||||
ntchoice->setValidator(intval);
|
||||
ntchoice->setObjectName("nthreads");
|
||||
#if !defined(_OPENMP)
|
||||
ntchoice->setEnabled(false);
|
||||
#endif
|
||||
|
||||
choiceLayout->addWidget(ntlabel);
|
||||
choiceLayout->addWidget(ntchoice);
|
||||
|
||||
Reference in New Issue
Block a user