Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e90590b908 |
+1
-1
@@ -6,7 +6,7 @@ if (CMAKE_VERSION GREATER_EQUAL "3.3")
|
|||||||
cmake_policy(SET CMP0167 NEW)
|
cmake_policy(SET CMP0167 NEW)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
project(musrfit VERSION 1.11.0 LANGUAGES C CXX)
|
project(musrfit VERSION 1.11.1 LANGUAGES C CXX)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|||||||
@@ -12,6 +12,12 @@ or
|
|||||||
|
|
||||||
https://bitbucket.org/muonspin/musrfit
|
https://bitbucket.org/muonspin/musrfit
|
||||||
|
|
||||||
|
Release of V1.11.1, 2026/06/07
|
||||||
|
==============================
|
||||||
|
|
||||||
|
allow from musredit (via preferences) to select the number of threads to be used
|
||||||
|
for fitting.
|
||||||
|
|
||||||
Release of V1.11.0, 2026/05/28
|
Release of V1.11.0, 2026/05/28
|
||||||
==============================
|
==============================
|
||||||
|
|
||||||
|
|||||||
@@ -168,6 +168,8 @@ bool PAdminXMLParser::startElement()
|
|||||||
fKeyWord = eEstimateN0;
|
fKeyWord = eEstimateN0;
|
||||||
} else if (qName == "yaml_out") {
|
} else if (qName == "yaml_out") {
|
||||||
fKeyWord = eYamlOut;
|
fKeyWord = eYamlOut;
|
||||||
|
} else if (qName == "use_no_of_threads") {
|
||||||
|
fKeyWord = eNoOfTreadsToBeUsed;
|
||||||
} else if (qName == "chisq_per_run_block") {
|
} else if (qName == "chisq_per_run_block") {
|
||||||
fKeyWord = eChisqPreRunBlock;
|
fKeyWord = eChisqPreRunBlock;
|
||||||
} else if (qName == "path_file_name") {
|
} else if (qName == "path_file_name") {
|
||||||
@@ -420,6 +422,11 @@ bool PAdminXMLParser::characters()
|
|||||||
fAdmin->fMsr2DataParam.perRunBlockChisq = flag;
|
fAdmin->fMsr2DataParam.perRunBlockChisq = flag;
|
||||||
fAdmin->setChisqPerRunBlockFlag(flag);
|
fAdmin->setChisqPerRunBlockFlag(flag);
|
||||||
break;
|
break;
|
||||||
|
case eNoOfTreadsToBeUsed:
|
||||||
|
ival = QString(str.toLatin1()).trimmed().toInt(&ok);
|
||||||
|
if (ok)
|
||||||
|
fAdmin->setNoOfThreadsToBeUsed(ival);
|
||||||
|
break;
|
||||||
case eRecentFile:
|
case eRecentFile:
|
||||||
fAdmin->addRecentFile(QString(str.toLatin1()).trimmed());
|
fAdmin->addRecentFile(QString(str.toLatin1()).trimmed());
|
||||||
break;
|
break;
|
||||||
@@ -988,6 +995,9 @@ int PAdmin::savePrefs(QString pref_fln)
|
|||||||
else
|
else
|
||||||
data[i] = " <yaml_out>n</yaml_out>";
|
data[i] = " <yaml_out>n</yaml_out>";
|
||||||
}
|
}
|
||||||
|
if (data[i].contains("<use_no_of_threads>") && data[i].contains("</use_no_of_threads>")) {
|
||||||
|
data[i] = " <use_no_of_threads>" + QString("%1").arg(fNoOfThreadsToBeUsed) + "</use_no_of_threads>";
|
||||||
|
}
|
||||||
if (data[i].contains("<musrview_show_fourier>") && data[i].contains("</musrview_show_fourier>")) {
|
if (data[i].contains("<musrview_show_fourier>") && data[i].contains("</musrview_show_fourier>")) {
|
||||||
if (fMusrviewShowFourier)
|
if (fMusrviewShowFourier)
|
||||||
data[i] = " <musrview_show_fourier>y</musrview_show_fourier>";
|
data[i] = " <musrview_show_fourier>y</musrview_show_fourier>";
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class PAdminXMLParser
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
enum EAdminKeyWords {eEmpty, eTimeout, eKeepMinuit2Output, eDumpAscii, eDumpRoot,
|
enum EAdminKeyWords {eEmpty, eTimeout, eKeepMinuit2Output, eDumpAscii, eDumpRoot,
|
||||||
eTitleFromDataFile, eChisqPreRunBlock, eEstimateN0, eYamlOut,
|
eTitleFromDataFile, eChisqPreRunBlock, eEstimateN0, eYamlOut, eNoOfTreadsToBeUsed,
|
||||||
eMusrviewShowFourier, eMusrviewShowAvg, eMusrviewShowOneToOne, eEnableMusrT0,
|
eMusrviewShowFourier, eMusrviewShowAvg, eMusrviewShowOneToOne, eEnableMusrT0,
|
||||||
eDarkThemeIconsMenu, eDarkThemeIconsToolbar, eIgnoreThemeAutoDetection, eEditW, eEditH,
|
eDarkThemeIconsMenu, eDarkThemeIconsToolbar, eIgnoreThemeAutoDetection, eEditW, eEditH,
|
||||||
eFontName, eFontSize, eExecPath, eDefaultSavePath,
|
eFontName, eFontSize, eExecPath, eDefaultSavePath,
|
||||||
@@ -128,6 +128,7 @@ class PAdmin : public QObject
|
|||||||
bool getDumpRootFlag() { return fDumpRoot; }
|
bool getDumpRootFlag() { return fDumpRoot; }
|
||||||
bool getEstimateN0Flag() { return fEstimateN0; }
|
bool getEstimateN0Flag() { return fEstimateN0; }
|
||||||
bool getYamlOutFlag() { return fYamlOut; }
|
bool getYamlOutFlag() { return fYamlOut; }
|
||||||
|
int getNoOfThreadsToBeUsed() { return fNoOfThreadsToBeUsed; }
|
||||||
bool getChisqPerRunBlockFlag() { return fChisqPreRunBlock; }
|
bool getChisqPerRunBlockFlag() { return fChisqPreRunBlock; }
|
||||||
bool getIgnoreThemeAutoDetection() { return fIgnoreThemeAutoDetection; }
|
bool getIgnoreThemeAutoDetection() { return fIgnoreThemeAutoDetection; }
|
||||||
bool getDarkThemeIconsMenuFlag() { return fDarkThemeIconsMenu; }
|
bool getDarkThemeIconsMenuFlag() { return fDarkThemeIconsMenu; }
|
||||||
@@ -158,6 +159,7 @@ class PAdmin : public QObject
|
|||||||
void setDumpRootFlag(const bool flag) { fDumpRoot = flag; }
|
void setDumpRootFlag(const bool flag) { fDumpRoot = flag; }
|
||||||
void setEstimateN0Flag(const bool flag) { fEstimateN0 = flag; }
|
void setEstimateN0Flag(const bool flag) { fEstimateN0 = flag; }
|
||||||
void setYamlOutFlag(const bool flag) { fYamlOut = flag; }
|
void setYamlOutFlag(const bool flag) { fYamlOut = flag; }
|
||||||
|
void setNoOfThreadsToBeUsed(const int num) { fNoOfThreadsToBeUsed = num; }
|
||||||
void setChisqPerRunBlockFlag(const bool flag) { fChisqPreRunBlock = flag; }
|
void setChisqPerRunBlockFlag(const bool flag) { fChisqPreRunBlock = flag; }
|
||||||
void setIgnoreThemeAutoDetection(const bool flag) { fIgnoreThemeAutoDetection = flag; }
|
void setIgnoreThemeAutoDetection(const bool flag) { fIgnoreThemeAutoDetection = flag; }
|
||||||
void setDarkThemeIconsMenuFlag(const bool flag) { fDarkThemeIconsMenu = flag; }
|
void setDarkThemeIconsMenuFlag(const bool flag) { fDarkThemeIconsMenu = flag; }
|
||||||
@@ -209,6 +211,7 @@ class PAdmin : public QObject
|
|||||||
bool fChisqPreRunBlock{false}; ///< flag indicating if musrfit shall write 'per run block' chisq to the msr-file (default: no).
|
bool fChisqPreRunBlock{false}; ///< flag indicating if musrfit shall write 'per run block' chisq to the msr-file (default: no).
|
||||||
bool fEstimateN0{true}; ///< flag indicating if musrfit shall estimate N0 for single histogram fits (default: yes).
|
bool fEstimateN0{true}; ///< flag indicating if musrfit shall estimate N0 for single histogram fits (default: yes).
|
||||||
bool fYamlOut{false}; ///< flag indicating if the MINUIT2.OUTPUT file should also be written as <msr-file>.yaml output. (default: no).
|
bool fYamlOut{false}; ///< flag indicating if the MINUIT2.OUTPUT file should also be written as <msr-file>.yaml output. (default: no).
|
||||||
|
int fNoOfThreadsToBeUsed{1}; ///< number of threads to be used
|
||||||
bool fEnableMusrT0{true}; ///< flag indicating if musrT0 shall be enabled at startup from within musredit (default: yes).
|
bool fEnableMusrT0{true}; ///< flag indicating if musrT0 shall be enabled at startup from within musredit (default: yes).
|
||||||
bool fIgnoreThemeAutoDetection{false}; ///< flag indicating that the theme autodetection shall be ignored. (default: no)
|
bool fIgnoreThemeAutoDetection{false}; ///< flag indicating that the theme autodetection shall be ignored. (default: no)
|
||||||
bool fDarkThemeIconsMenu{false}; ///< flag indicating if dark theme icons shall be used in the menu (default: no)
|
bool fDarkThemeIconsMenu{false}; ///< flag indicating if dark theme icons shall be used in the menu (default: no)
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <unistd.h> // for # of threads
|
||||||
|
|
||||||
#include "PChangeDefaultPathsDialog.h"
|
#include "PChangeDefaultPathsDialog.h"
|
||||||
#include "PPrefsDialog.h"
|
#include "PPrefsDialog.h"
|
||||||
@@ -90,6 +91,15 @@ PPrefsDialog::PPrefsDialog(PAdmin *admin) : fAdmin(admin)
|
|||||||
fTimeout_lineEdit->setText(QString("%1").arg(fAdmin->getTimeout()));
|
fTimeout_lineEdit->setText(QString("%1").arg(fAdmin->getTimeout()));
|
||||||
fTimeout_lineEdit->setValidator(new QIntValidator(fTimeout_lineEdit));
|
fTimeout_lineEdit->setValidator(new QIntValidator(fTimeout_lineEdit));
|
||||||
|
|
||||||
|
// get number of threads info from the systems
|
||||||
|
long nprocs = sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
|
if (fAdmin->getNoOfThreadsToBeUsed() > nprocs)
|
||||||
|
fAdmin->setNoOfThreadsToBeUsed(nprocs);
|
||||||
|
for (auto i=0; i<nprocs; i++)
|
||||||
|
fNumberOfThreads_comboBox->addItem(QString("%1").arg(i+1));
|
||||||
|
fNumberOfThreads_comboBox->setCurrentIndex(fAdmin->getNoOfThreadsToBeUsed()-1);
|
||||||
|
QObject::connect(fNumberOfThreads_comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(numberOfThreadsChanged(int)));
|
||||||
|
|
||||||
QObject::connect(fDefaultPath_pushButton, SIGNAL(clicked()), this, SLOT(handleDefaultPaths()));
|
QObject::connect(fDefaultPath_pushButton, SIGNAL(clicked()), this, SLOT(handleDefaultPaths()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,6 +155,17 @@ void PPrefsDialog::handleDefaultPaths()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief Slot: keeps the number of threads to be used for fitting.
|
||||||
|
*
|
||||||
|
* @param idx index of the comboBox
|
||||||
|
*/
|
||||||
|
void PPrefsDialog::numberOfThreadsChanged(int idx)
|
||||||
|
{
|
||||||
|
fAdmin->setNoOfThreadsToBeUsed(idx+1);
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
// END
|
// END
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ class PPrefsDialog : public QDialog, private Ui::PPrefsDialog
|
|||||||
void dumpAscii();
|
void dumpAscii();
|
||||||
void dumpRoot();
|
void dumpRoot();
|
||||||
void handleDefaultPaths();
|
void handleDefaultPaths();
|
||||||
|
void numberOfThreadsChanged(int idx);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PAdmin *fAdmin;
|
PAdmin *fAdmin;
|
||||||
|
|||||||
@@ -2162,6 +2162,11 @@ void PTextEdit::musrFit()
|
|||||||
cmd.append("--yaml");
|
cmd.append("--yaml");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check how many threads to be used
|
||||||
|
cmd.append("--use-no-of-threads");
|
||||||
|
QString noThreads = QString("%1").arg(fAdmin->getNoOfThreadsToBeUsed());
|
||||||
|
cmd.append(noThreads);
|
||||||
|
|
||||||
// check per-run-block-chisq flag
|
// check per-run-block-chisq flag
|
||||||
if (fAdmin->getChisqPerRunBlockFlag()) {
|
if (fAdmin->getChisqPerRunBlockFlag()) {
|
||||||
cmd.append("--per-run-block-chisq");
|
cmd.append("--per-run-block-chisq");
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
<chisq_per_run_block>n</chisq_per_run_block>
|
<chisq_per_run_block>n</chisq_per_run_block>
|
||||||
<estimate_n0>y</estimate_n0>
|
<estimate_n0>y</estimate_n0>
|
||||||
<yaml_out>n</yaml_out>
|
<yaml_out>n</yaml_out>
|
||||||
|
<use_no_of_threads>1024</use_no_of_threads>
|
||||||
<musrview_show_fourier>n</musrview_show_fourier>
|
<musrview_show_fourier>n</musrview_show_fourier>
|
||||||
<musrview_show_avg>n</musrview_show_avg>
|
<musrview_show_avg>n</musrview_show_avg>
|
||||||
<musrview_show_one_to_one>n</musrview_show_one_to_one>
|
<musrview_show_one_to_one>n</musrview_show_one_to_one>
|
||||||
|
|||||||
@@ -212,6 +212,8 @@ bool PAdminXMLParser::startElement()
|
|||||||
fKeyWord = eEstimateN0;
|
fKeyWord = eEstimateN0;
|
||||||
} else if (qName == "yaml_out") {
|
} else if (qName == "yaml_out") {
|
||||||
fKeyWord = eYamlOut;
|
fKeyWord = eYamlOut;
|
||||||
|
} else if (qName == "use_no_of_threads") {
|
||||||
|
fKeyWord = eNoOfTreadsToBeUsed;
|
||||||
} else if (qName == "chisq_per_run_block") {
|
} else if (qName == "chisq_per_run_block") {
|
||||||
fKeyWord = eChisqPreRunBlock;
|
fKeyWord = eChisqPreRunBlock;
|
||||||
} else if (qName == "path_file_name") {
|
} else if (qName == "path_file_name") {
|
||||||
@@ -469,6 +471,11 @@ bool PAdminXMLParser::characters()
|
|||||||
fAdmin->fMsr2DataParam.yamlOut = flag;
|
fAdmin->fMsr2DataParam.yamlOut = flag;
|
||||||
fAdmin->setYamlOutFlag(flag);
|
fAdmin->setYamlOutFlag(flag);
|
||||||
break;
|
break;
|
||||||
|
case eNoOfTreadsToBeUsed:
|
||||||
|
ival = QString(str.toLatin1()).trimmed().toInt(&ok);
|
||||||
|
if (ok)
|
||||||
|
fAdmin->setNoOfThreadsToBeUsed(ival);
|
||||||
|
break;
|
||||||
case eChisqPreRunBlock:
|
case eChisqPreRunBlock:
|
||||||
if (str == "y")
|
if (str == "y")
|
||||||
flag = true;
|
flag = true;
|
||||||
@@ -1134,6 +1141,9 @@ int PAdmin::savePrefs(QString pref_fln)
|
|||||||
else
|
else
|
||||||
data[i] = " <yaml_out>n</yaml_out>";
|
data[i] = " <yaml_out>n</yaml_out>";
|
||||||
}
|
}
|
||||||
|
if (data[i].contains("<use_no_of_threads>") && data[i].contains("</use_no_of_threads>")) {
|
||||||
|
data[i] = " <use_no_of_threads>" + QString("%1").arg(fNoOfThreadsToBeUsed) + "</use_no_of_threads>";
|
||||||
|
}
|
||||||
if (data[i].contains("<musrview_show_fourier>") && data[i].contains("</musrview_show_fourier>")) {
|
if (data[i].contains("<musrview_show_fourier>") && data[i].contains("</musrview_show_fourier>")) {
|
||||||
if (fMusrviewShowFourier)
|
if (fMusrviewShowFourier)
|
||||||
data[i] = " <musrview_show_fourier>y</musrview_show_fourier>";
|
data[i] = " <musrview_show_fourier>y</musrview_show_fourier>";
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ class PAdminXMLParser
|
|||||||
* The parser uses these to determine how to process element content.
|
* The parser uses these to determine how to process element content.
|
||||||
*/
|
*/
|
||||||
enum EAdminKeyWords {eEmpty, eTimeout, eKeepMinuit2Output, eDumpAscii, eDumpRoot,
|
enum EAdminKeyWords {eEmpty, eTimeout, eKeepMinuit2Output, eDumpAscii, eDumpRoot,
|
||||||
eTitleFromDataFile, eChisqPreRunBlock, eEstimateN0, eYamlOut,
|
eTitleFromDataFile, eChisqPreRunBlock, eEstimateN0, eYamlOut, eNoOfTreadsToBeUsed,
|
||||||
eMusrviewShowFourier, eMusrviewShowAvg, eMusrviewShowOneToOne, eEnableMusrT0,
|
eMusrviewShowFourier, eMusrviewShowAvg, eMusrviewShowOneToOne, eEnableMusrT0,
|
||||||
eIgnoreThemeAutoDetection, eDarkThemeIconsMenu, eDarkThemeIconsToolbar, eEditW, eEditH,
|
eIgnoreThemeAutoDetection, eDarkThemeIconsMenu, eDarkThemeIconsToolbar, eEditW, eEditH,
|
||||||
eFontName, eFontSize, eExecPath, eDefaultSavePath,
|
eFontName, eFontSize, eExecPath, eDefaultSavePath,
|
||||||
@@ -225,6 +225,7 @@ class PAdmin : public QObject
|
|||||||
bool getMusrviewShowOneToOneFlag() { return fMusrviewShowOneToOne; } ///< Check if one-to-one theory display is enabled.
|
bool getMusrviewShowOneToOneFlag() { return fMusrviewShowOneToOne; } ///< Check if one-to-one theory display is enabled.
|
||||||
bool getEnableMusrT0Flag() { return fEnableMusrT0; } ///< Check if musrT0 is enabled.
|
bool getEnableMusrT0Flag() { return fEnableMusrT0; } ///< Check if musrT0 is enabled.
|
||||||
bool getYamlOutFlag() { return fYamlOut; } ///< Check if YAML output is enabled.
|
bool getYamlOutFlag() { return fYamlOut; } ///< Check if YAML output is enabled.
|
||||||
|
int getNoOfThreadsToBeUsed() { return fNoOfThreadsToBeUsed; } ///< Get number of threads to be used
|
||||||
bool getKeepMinuit2OutputFlag() { return fKeepMinuit2Output; } ///< Check if MINUIT2 output files are preserved.
|
bool getKeepMinuit2OutputFlag() { return fKeepMinuit2Output; } ///< Check if MINUIT2 output files are preserved.
|
||||||
bool getDumpAsciiFlag() { return fDumpAscii; } ///< Check if ASCII dump is enabled.
|
bool getDumpAsciiFlag() { return fDumpAscii; } ///< Check if ASCII dump is enabled.
|
||||||
bool getDumpRootFlag() { return fDumpRoot; } ///< Check if ROOT dump is enabled.
|
bool getDumpRootFlag() { return fDumpRoot; } ///< Check if ROOT dump is enabled.
|
||||||
@@ -264,6 +265,7 @@ class PAdmin : public QObject
|
|||||||
void setDumpRootFlag(const bool flag) { fDumpRoot = flag; } ///< Enable/disable ROOT dump.
|
void setDumpRootFlag(const bool flag) { fDumpRoot = flag; } ///< Enable/disable ROOT dump.
|
||||||
void setEstimateN0Flag(const bool flag) { fEstimateN0 = flag; } ///< Enable/disable N0 estimation.
|
void setEstimateN0Flag(const bool flag) { fEstimateN0 = flag; } ///< Enable/disable N0 estimation.
|
||||||
void setYamlOutFlag(const bool flag) { fYamlOut = flag; } ///< Enable/disable YAML output.
|
void setYamlOutFlag(const bool flag) { fYamlOut = flag; } ///< Enable/disable YAML output.
|
||||||
|
void setNoOfThreadsToBeUsed(const int num) { fNoOfThreadsToBeUsed = num; } ///< set number of threads to be used
|
||||||
void setChisqPerRunBlockFlag(const bool flag) { fChisqPreRunBlock = flag; } ///< Enable/disable per-run-block chi-square.
|
void setChisqPerRunBlockFlag(const bool flag) { fChisqPreRunBlock = flag; } ///< Enable/disable per-run-block chi-square.
|
||||||
void setIgnoreThemeAutoDetection(const bool flag) { fIgnoreThemeAutoDetection = flag; } ///< Enable/disable theme auto-detection.
|
void setIgnoreThemeAutoDetection(const bool flag) { fIgnoreThemeAutoDetection = flag; } ///< Enable/disable theme auto-detection.
|
||||||
void setDarkThemeIconsMenuFlag(const bool flag) { fDarkThemeIconsMenu = flag; } ///< Enable/disable dark theme menu icons.
|
void setDarkThemeIconsMenuFlag(const bool flag) { fDarkThemeIconsMenu = flag; } ///< Enable/disable dark theme menu icons.
|
||||||
@@ -356,6 +358,7 @@ class PAdmin : public QObject
|
|||||||
bool fChisqPreRunBlock{false}; ///< If true, write per-run-block chi-square values to msr-file.
|
bool fChisqPreRunBlock{false}; ///< If true, write per-run-block chi-square values to msr-file.
|
||||||
bool fEstimateN0{true}; ///< If true, estimate N0 parameter for single histogram fits.
|
bool fEstimateN0{true}; ///< If true, estimate N0 parameter for single histogram fits.
|
||||||
bool fYamlOut{false}; ///< If true, write MINUIT2 output additionally as \<msr-file\>.yaml.
|
bool fYamlOut{false}; ///< If true, write MINUIT2 output additionally as \<msr-file\>.yaml.
|
||||||
|
int fNoOfThreadsToBeUsed{1}; ///< number of threads to be used
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/** @name MSR File Defaults
|
/** @name MSR File Defaults
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <unistd.h> // for # of threads
|
||||||
|
|
||||||
#include "PChangeDefaultPathsDialog.h"
|
#include "PChangeDefaultPathsDialog.h"
|
||||||
#include "PPrefsDialog.h"
|
#include "PPrefsDialog.h"
|
||||||
@@ -164,6 +165,15 @@ PPrefsDialog::PPrefsDialog(PAdmin *admin) : fAdmin(admin)
|
|||||||
fTimeout_lineEdit->setText(QString("%1").arg(fAdmin->getTimeout()));
|
fTimeout_lineEdit->setText(QString("%1").arg(fAdmin->getTimeout()));
|
||||||
fTimeout_lineEdit->setValidator(new QIntValidator(fTimeout_lineEdit));
|
fTimeout_lineEdit->setValidator(new QIntValidator(fTimeout_lineEdit));
|
||||||
|
|
||||||
|
// get number of threads info from the systems
|
||||||
|
long nprocs = sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
|
if (fAdmin->getNoOfThreadsToBeUsed() > nprocs)
|
||||||
|
fAdmin->setNoOfThreadsToBeUsed(nprocs);
|
||||||
|
for (auto i=0; i<nprocs; i++)
|
||||||
|
fNumberOfThreads_comboBox->addItem(QString("%1").arg(i+1));
|
||||||
|
fNumberOfThreads_comboBox->setCurrentIndex(fAdmin->getNoOfThreadsToBeUsed()-1);
|
||||||
|
QObject::connect(fNumberOfThreads_comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(numberOfThreadsChanged(int)));
|
||||||
|
|
||||||
QObject::connect(fDefaultPath_pushButton, SIGNAL(clicked()), this, SLOT(handleDefaultPaths()));
|
QObject::connect(fDefaultPath_pushButton, SIGNAL(clicked()), this, SLOT(handleDefaultPaths()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,6 +350,17 @@ void PPrefsDialog::handleDefaultPaths()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief Slot: keeps the number of threads to be used for fitting.
|
||||||
|
*
|
||||||
|
* @param idx index of the comboBox
|
||||||
|
*/
|
||||||
|
void PPrefsDialog::numberOfThreadsChanged(int idx)
|
||||||
|
{
|
||||||
|
fAdmin->setNoOfThreadsToBeUsed(idx+1);
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
// END
|
// END
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -318,6 +318,13 @@ class PPrefsDialog : public QDialog, private Ui::PPrefsDialog
|
|||||||
*/
|
*/
|
||||||
void handleDefaultPaths();
|
void handleDefaultPaths();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Slot: called when the current index of the number of threads to be used has changed
|
||||||
|
*
|
||||||
|
* @param idx index of the comboBox
|
||||||
|
*/
|
||||||
|
void numberOfThreadsChanged(int idx);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PAdmin *fAdmin; ///< Pointer to global administration object storing all preferences.
|
PAdmin *fAdmin; ///< Pointer to global administration object storing all preferences.
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2273,6 +2273,11 @@ void PTextEdit::musrFit()
|
|||||||
cmd.append("--yaml");
|
cmd.append("--yaml");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check how many threads to be used
|
||||||
|
cmd.append("--use-no-of-threads");
|
||||||
|
QString noThreads = QString("%1").arg(fAdmin->getNoOfThreadsToBeUsed());
|
||||||
|
cmd.append(noThreads);
|
||||||
|
|
||||||
// check per-run-block-chisq flag
|
// check per-run-block-chisq flag
|
||||||
if (fAdmin->getChisqPerRunBlockFlag()) {
|
if (fAdmin->getChisqPerRunBlockFlag()) {
|
||||||
cmd.append("--per-run-block-chisq");
|
cmd.append("--per-run-block-chisq");
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<class>PPrefsDialog</class>
|
<class>PPrefsDialog</class>
|
||||||
<widget class="QDialog" name="PPrefsDialog">
|
<widget class="QDialog" name="PPrefsDialog">
|
||||||
<property name="windowModality">
|
<property name="windowModality">
|
||||||
<enum>Qt::WindowModal</enum>
|
<enum>Qt::WindowModality::WindowModal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
@@ -26,13 +26,13 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="fTabWidget">
|
<widget class="QTabWidget" name="fTabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="fGeneral_tab">
|
<widget class="QWidget" name="fGeneral_tab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>general</string>
|
<string>general</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<widget class="QWidget" name="">
|
<widget class="QWidget" name="layoutWidget">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>11</x>
|
<x>11</x>
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer_2">
|
<spacer name="horizontalSpacer_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Orientation::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
@@ -117,7 +117,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer_2">
|
<spacer name="verticalSpacer_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Orientation::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
@@ -225,6 +225,28 @@
|
|||||||
<string>yaml out</string>
|
<string>yaml out</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QWidget" name="">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>90</y>
|
||||||
|
<width>291</width>
|
||||||
|
<height>34</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="fNumberOfThreads_comboBox"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="fNumberOfThreads_label">
|
||||||
|
<property name="text">
|
||||||
|
<string># threads to be used</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="fMusrview_tab">
|
<widget class="QWidget" name="fMusrview_tab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@@ -302,7 +324,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<spacer name="horizontalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
<chisq_per_run_block>n</chisq_per_run_block>
|
<chisq_per_run_block>n</chisq_per_run_block>
|
||||||
<estimate_n0>y</estimate_n0>
|
<estimate_n0>y</estimate_n0>
|
||||||
<yaml_out>n</yaml_out>
|
<yaml_out>n</yaml_out>
|
||||||
|
<use_no_of_threads>1024</use_no_of_threads>
|
||||||
<musrview_show_fourier>n</musrview_show_fourier>
|
<musrview_show_fourier>n</musrview_show_fourier>
|
||||||
<musrview_show_avg>n</musrview_show_avg>
|
<musrview_show_avg>n</musrview_show_avg>
|
||||||
<musrview_show_one_to_one>n</musrview_show_one_to_one>
|
<musrview_show_one_to_one>n</musrview_show_one_to_one>
|
||||||
|
|||||||
Reference in New Issue
Block a user