Skip to content
Snippets Groups Projects
Commit b31cf1f0 authored by Olivier Langella's avatar Olivier Langella
Browse files

control HTCondor memory requirement in tandem window dialog

parent 99812456
No related branches found
No related tags found
No related merge requests found
......@@ -54,14 +54,18 @@ TandemCondorProcess::TandemCondorProcess(MainWindow * p_main_window, WorkMonitor
*/
QSettings settings;
QString condor_tmp_dir = QString("%1/xtpcpp").arg(settings.value("condor/tmp_dir", "/tmp").toString());
QString condor_tmp_dir = QString("%1/xtpcpp").arg(settings.value("condor/tmp_dir", "/gorgone/pappso/tmp").toString());
_p_tmp_dir = new QTemporaryDir(condor_tmp_dir);
_p_tmp_dir->setAutoRemove(settings.value("condor/tmp_dir_autoremove", true).toBool());
_condor_submit_command = settings.value("condor/submit", "/usr/bin/condor_submit").toString();
_condor_q_command = settings.value("condor/condor_q", "/usr/bin/condor_q").toString();
_condor_rm_command = settings.value("condor/condor_rm", "/usr/bin/condor_rm").toString();
_condor_request_memory = settings.value("condor/request_memory", "10000").toUInt();
_condor_request_memory = settings.value("tandem/condor_request_memory", "10000").toUInt();
settings.setValue("condor/tmp_dir_autoremove", settings.value("condor/tmp_dir_autoremove", true));
settings.setValue("condor/submit", settings.value("condor/submit", "/usr/bin/condor_submit"));
settings.setValue("condor/condor_q", settings.value("condor/condor_q", "/usr/bin/condor_q"));
settings.setValue("condor/condor_rm", settings.value("condor/condor_rm", "/usr/bin/condor_rm"));
if (!_p_tmp_dir->isValid()) {
// dir.path() returns the unique directory path
......
......@@ -10,7 +10,7 @@
<x>0</x>
<y>0</y>
<width>573</width>
<height>610</height>
<height>720</height>
</rect>
</property>
<property name="windowTitle">
......@@ -18,36 +18,96 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox_2">
<widget class="QGroupBox" name="exe_groupbox">
<property name="title">
<string>X!Tandem exe</string>
<string>edit &amp;X!Tandem execution</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="tandem_bin_label">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_4">
<property name="text">
<string>change</string>
</property>
<widget class="QWidget" name="exe_group_widget" native="true">
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="tandem_bin_label">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>528</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_4">
<property name="text">
<string>change</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="use_htcondor_groupbox">
<property name="title">
<string>&amp;run X!Tandem throught HTCondor</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>X!Tandem memory requirement (MB)</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="request_memory_edit"/>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
......@@ -286,7 +346,7 @@
<y>598</y>
</hint>
<hint type="destinationlabel">
<x>648</x>
<x>572</x>
<y>216</y>
</hint>
</hints>
......@@ -302,7 +362,7 @@
<y>310</y>
</hint>
<hint type="destinationlabel">
<x>606</x>
<x>572</x>
<y>468</y>
</hint>
</hints>
......@@ -318,7 +378,7 @@
<y>302</y>
</hint>
<hint type="destinationlabel">
<x>630</x>
<x>572</x>
<y>331</y>
</hint>
</hints>
......@@ -334,7 +394,7 @@
<y>451</y>
</hint>
<hint type="destinationlabel">
<x>613</x>
<x>572</x>
<y>450</y>
</hint>
</hints>
......@@ -350,7 +410,7 @@
<y>537</y>
</hint>
<hint type="destinationlabel">
<x>651</x>
<x>572</x>
<y>519</y>
</hint>
</hints>
......@@ -363,10 +423,10 @@
<hints>
<hint type="sourcelabel">
<x>64</x>
<y>149</y>
<y>175</y>
</hint>
<hint type="destinationlabel">
<x>603</x>
<x>572</x>
<y>172</y>
</hint>
</hints>
......@@ -379,14 +439,30 @@
<hints>
<hint type="sourcelabel">
<x>541</x>
<y>135</y>
<y>161</y>
</hint>
<hint type="destinationlabel">
<x>642</x>
<x>572</x>
<y>135</y>
</hint>
</hints>
</connection>
<connection>
<sender>exe_groupbox</sender>
<signal>clicked(bool)</signal>
<receiver>TandemRunDialog</receiver>
<slot>exeGroupBoxClicked(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>559</x>
<y>110</y>
</hint>
<hint type="destinationlabel">
<x>959</x>
<y>115</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>reject()</slot>
......@@ -397,5 +473,6 @@
<slot>selectOutputDirectory()</slot>
<slot>setPresetName(QString)</slot>
<slot>editPresets()</slot>
<slot>exeGroupBoxClicked(bool)</slot>
</slots>
</ui>
......@@ -49,6 +49,26 @@ TandemRunDialog::TandemRunDialog(QWidget * parent):
_p_mz_file_list = new QStringListModel();
ui->fasta_file_listview->setModel(_p_fasta_file_list);
ui->mz_file_listview->setModel(_p_mz_file_list);
ui->exe_group_widget->setVisible(false);
QSettings settings;
/*
QString condor_tmp_dir = QString("%1/xtpcpp").arg(settings.value("condor/tmp_dir", "/tmp").toString());
_p_tmp_dir = new QTemporaryDir(condor_tmp_dir);
_p_tmp_dir->setAutoRemove(settings.value("condor/tmp_dir_autoremove", true).toBool());
_condor_submit_command = settings.value("condor/submit", "/usr/bin/condor_submit").toString();
_condor_q_command = settings.value("condor/condor_q", "/usr/bin/condor_q").toString();
_condor_rm_command = settings.value("condor/condor_rm", "/usr/bin/condor_rm").toString();
_condor_request_memory = settings.value("condor/request_memory", "10000").toUInt();
QString default_preset_name = ;
*/
ui->use_htcondor_groupbox->setChecked(settings.value("tandem/use_HTCondor", "false").toBool());
ui->request_memory_edit->setText(settings.value("tandem/condor_request_memory", "5000").toString());
settings.value("condor/tmp_dir", "/gorgone/pappso/tmp");
#if QT_VERSION >= 0x050000
// Qt5 code
......@@ -67,6 +87,17 @@ TandemRunDialog::~TandemRunDialog()
delete _p_fasta_file_list;
delete _p_mz_file_list;
}
void TandemRunDialog::exeGroupBoxClicked(bool clicked) {
qDebug() << "TandemRunDialog::exeGroupBoxClicked begin";
ui->exe_group_widget->setVisible(false);
if (clicked) {
ui->exe_group_widget->setVisible(true);
}
qDebug() << "TandemRunDialog::exeGroupBoxClicked end";
}
void TandemRunDialog::setPresetName(QString preset_name) {
qDebug() << "TandemRunDialog::setPresetName begin";
if (!preset_name.isEmpty() && !preset_name.isNull()) {
......@@ -180,6 +211,7 @@ void TandemRunDialog::acceptPresetEdit() {
settings.setValue("path/tandemrun_preset_directory", param_file.getAbsoluteDir().absolutePath());
settings.setValue("tandem/preset_name", param_file.getMethodName());
fillPresetComboBox();
}
......@@ -265,3 +297,33 @@ TandemRunBatch TandemRunDialog::getTandemRunBatch() const {
}
void TandemRunDialog::done(int r)
{
if(QDialog::Accepted == r) // ok was pressed
{
QSettings settings;
settings.setValue("tandem/use_HTCondor", "false");
if ( ui->use_htcondor_groupbox->isChecked()) {
settings.setValue("tandem/use_HTCondor", "true");
}
//QString condor_tmp_dir = QString("%1/xtpcpp").arg(settings.value("condor/tmp_dir", "/tmp").toString());
//_p_tmp_dir = new QTemporaryDir(condor_tmp_dir);
//_p_tmp_dir->setAutoRemove(settings.value("condor/tmp_dir_autoremove", true).toBool());
//_condor_submit_command = settings.value("condor/submit", "/usr/bin/condor_submit").toString();
//_condor_q_command = settings.value("condor/condor_q", "/usr/bin/condor_q").toString();
//_condor_rm_command = settings.value("condor/condor_rm", "/usr/bin/condor_rm").toString();
settings.setValue("tandem/condor_request_memory", ui->request_memory_edit->text());
QDialog::done(r);
return;
}
else // cancel, close or exc was pressed
{
QDialog::done(r);
return;
}
}
......@@ -51,6 +51,7 @@ public:
TandemRunBatch getTandemRunBatch() const;
void reset();
public slots:
void exeGroupBoxClicked(bool clicked);
void selectFastaFiles();
void clearFastaFiles();
void selectMzFiles();
......@@ -62,6 +63,10 @@ public slots:
void rejectPresetEdit();
signals:
protected:
void done(int r) override;
private:
void fillPresetComboBox();
private:
......
......@@ -339,16 +339,16 @@ void WorkerThread::doRunningXtandem(TandemRunBatch tandem_run_batch) {
qDebug() << "WorkerThread::doRunningXtandem tandem_run_batch " << tandem_run_batch._tandem_bin_path;
QSettings settings;
QString default_location = settings.value("condor/tmp_dir", "").toString();
bool use_htcondor = settings.value("tandem/use_HTCondor", "false").toBool();
if (default_location.isEmpty()) {
TandemBatchProcess xt_process (_p_main_window ,_p_work_monitor, tandem_run_batch);
if (use_htcondor) {
TandemCondorProcess xt_process (_p_main_window ,_p_work_monitor, tandem_run_batch);
xt_process.run();
}
else {
TandemCondorProcess xt_process (_p_main_window ,_p_work_monitor, tandem_run_batch);
TandemBatchProcess xt_process (_p_main_window ,_p_work_monitor, tandem_run_batch);
xt_process.run();
}
}
emit operationFinished();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment