resource_descr.batch = resource_definition->batch.in();
resource_descr.mpiImpl = resource_definition->mpiImpl.in();
resource_descr.iprotocol = resource_definition->iprotocol.in();
+ resource_descr.is_cluster_head = resource_definition->is_cluster_head;
+ resource_descr.working_directory = resource_definition->working_directory.in();
delete resource_definition;
}
resource_definition->batch = CORBA::string_dup(new_resource.batch.c_str());
resource_definition->mpiImpl = CORBA::string_dup(new_resource.mpiImpl.c_str());
resource_definition->iprotocol = CORBA::string_dup(new_resource.iprotocol.c_str());
+ resource_definition->is_cluster_head = new_resource.is_cluster_head;
+ resource_definition->working_directory = CORBA::string_dup(new_resource.working_directory.c_str());
try
{
std::string batch;
std::string mpiImpl;
std::string iprotocol;
+
+ bool is_cluster_head;
+ std::string working_directory;
};
class BL_Engine_EXPORT SALOMEServices :
connect(_remove_button, SIGNAL(clicked()), this, SLOT(remove_components()));
connect(_componentList, SIGNAL(itemSelectionChanged()), this, SLOT(itemSelectionChanged()));
+ QLabel * working_directory_label = new QLabel("Working Directory:");
+ _working_directory = new QLineEdit(this);
+ QLabel * is_cluster_head_label = new QLabel("Is Cluster Head:");
+ _is_cluster_head = new QPushButton(this);
+ _is_cluster_head->setCheckable(true);
+ connect(_is_cluster_head, SIGNAL(toggled(bool)), this, SLOT(toggle_is_cluster_head(bool)));
+ toggle_is_cluster_head(false); // Default is false
+
QGridLayout * m_layout = new QGridLayout;
m_layout->addWidget(name_label, 0, 0);
m_layout->addWidget(_name_line, 0, 1);
m_layout->addWidget(_applipath_line, 4, 1);
m_layout->addWidget(componentList_label, 5, 0);
m_layout->addWidget(component_widget, 5, 1);
+ m_layout->addWidget(is_cluster_head_label, 6, 0);
+ m_layout->addWidget(_is_cluster_head, 6, 1);
+ m_layout->addWidget(working_directory_label, 7, 0);
+ m_layout->addWidget(_working_directory, 7, 1);
main_groupBox->setLayout(m_layout);
// Part 2
// Part 3
QDialogButtonBox * buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok
- | QDialogButtonBox::Cancel);
+ | QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
JM::EditSalomeResource::get_infos()
{
BL::ResourceDescr resource_descr = _salome_services->getResourceDescr(_resource_name);
-
+
_name_line->setText(QString(resource_descr.name.c_str()));
_hostname_line->setText(QString(resource_descr.hostname.c_str()));
_username_line->setText(QString(resource_descr.username.c_str()));
_applipath_line->setText(QString(resource_descr.applipath.c_str()));
_os_line->setText(QString(resource_descr.OS.c_str()));
+ _working_directory->setText(QString(resource_descr.working_directory.c_str()));
+ _is_cluster_head->setChecked(resource_descr.is_cluster_head);
std::string protocol = resource_descr.protocol.c_str();
if (protocol == "ssh")
_batch_line->setCurrentIndex(5);
else if (batch == "ll")
_batch_line->setCurrentIndex(6);
- else
+ else
_batch_line->setCurrentIndex(-1);
-
+
std::string mpiImpl = resource_descr.mpiImpl.c_str();
if (mpiImpl == "lam")
_mpiImpl_line->setCurrentIndex(0);
_username_line->setCursorPosition(0);
_applipath_line->setCursorPosition(0);
_os_line->setCursorPosition(0);
+ _working_directory->setCursorPosition(0);
}
resource.username = _username_line->text().toStdString();
resource.applipath = _applipath_line->text().toStdString();
resource.OS = _os_line->text().toStdString();
+ resource.working_directory = _working_directory->text().toStdString();
+ if (_is_cluster_head->isChecked())
+ resource.is_cluster_head = true;
+ else
+ resource.is_cluster_head = false;
// Components
int count = _componentList->count();
QMessageBox::warning(NULL, "Values missing", "name, hostname and protocol are mandatory! Cancel or add values!");
}
}
+
+void
+JM::EditSalomeResource::toggle_is_cluster_head(bool checked)
+{
+ if (checked)
+ _is_cluster_head->setText("true");
+ else
+ _is_cluster_head->setText("false");
+}
Q_OBJECT
public:
- EditSalomeResource(QWidget *parent,
- BL::SALOMEServices * salome_services,
- const std::string & resource_name = "");
+ EditSalomeResource(QWidget *parent,
+ BL::SALOMEServices * salome_services,
+ const std::string & resource_name = "");
virtual ~EditSalomeResource();
void get_infos();
void add_component();
void remove_components();
void itemSelectionChanged();
+ void toggle_is_cluster_head(bool checked);
protected:
QWidget* _parent;
QSpinBox * _nb_node_line;
QSpinBox * _nb_proc_per_node_line;
+ QLineEdit * _working_directory;
+ QPushButton * _is_cluster_head;
+
QPushButton * _add_button;
QPushButton * _remove_button;
};
QLabel * componentList_label = new QLabel("Component List:");
_componentList = new QListWidget(this);
_componentList->setViewMode(QListView::ListMode);
+ QLabel * working_directory_label = new QLabel("Working Directory:");
+ _working_directory = new QLineEdit(this);
+ QLabel * is_cluster_head_label = new QLabel("Is Cluster Head:");
+ _is_cluster_head = new QPushButton(this);
+ toggle_is_cluster_head(false); // Default is false
QGridLayout * m_layout = new QGridLayout;
m_layout->addWidget(name_label, 0, 0);
m_layout->addWidget(_name_line, 0, 1);
m_layout->addWidget(_applipath_line, 4, 1);
m_layout->addWidget(componentList_label, 5, 0);
m_layout->addWidget(_componentList, 5, 1);
+ m_layout->addWidget(is_cluster_head_label, 6, 0);
+ m_layout->addWidget(_is_cluster_head, 6, 1);
+ m_layout->addWidget(working_directory_label, 7, 0);
+ m_layout->addWidget(_working_directory, 7, 1);
main_groupBox->setLayout(m_layout);
_batch_line->setCursorPosition(0);
_mpiImpl_line->setCursorPosition(0);
_iprotocol_line->setCursorPosition(0);
+ _working_directory->setCursorPosition(0);
_name_line->setReadOnly(true);
_hostname_line->setReadOnly(true);
_batch_line->setReadOnly(true);
_mpiImpl_line->setReadOnly(true);
_iprotocol_line->setReadOnly(true);
+ _working_directory->setReadOnly(true);
}
JM::SalomeResource::~SalomeResource()
_batch_line->setText(QString(resource_descr.batch.c_str()));
_mpiImpl_line->setText(QString(resource_descr.mpiImpl.c_str()));
_iprotocol_line->setText(QString(resource_descr.iprotocol.c_str()));
+ _working_directory->setText(QString(resource_descr.working_directory.c_str()));
+ toggle_is_cluster_head(resource_descr.is_cluster_head);
QString value;
_mem_mb_line->setText(value.setNum(resource_descr.mem_mb));
for(; it != resource_descr.componentList.end(); it++)
_componentList->addItem(QString((*it).c_str()));
}
+
+void
+JM::SalomeResource::toggle_is_cluster_head(bool checked)
+{
+ if (checked)
+ _is_cluster_head->setText("true");
+ else
+ _is_cluster_head->setText("false");
+}
void get_infos();
+ void toggle_is_cluster_head(bool checked);
+
protected:
QWidget* _parent;
BL::SALOMEServices * _salome_services;
QLineEdit * _username_line;
QLineEdit * _applipath_line;
QListWidget * _componentList;
+ QPushButton * _is_cluster_head;
+ QLineEdit * _working_directory;
QLineEdit * _os_line;
QLineEdit * _mem_mb_line;
QLineEdit * _cpu_clock_line;