Commit b4873d55 authored by hrchilds's avatar hrchilds

Merge RC to trunk, picking up change for host nicknames in host

profiles.
Note: code had to change in this merge, because of Qt3 -> Qt4.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@7253 18c085ea-50e0-402c-830e-de6fd14e8384
parent fd477474
......@@ -79,7 +79,7 @@ HostProfile::ClientHostDetermination_FromString(const std::string &s, HostProfil
}
// Type map format string
const char *HostProfile::TypeMapFormatString = "sssiibibsbsbsbsbbbs*bbsbsbsbssbbiisbsbbbsbsb";
const char *HostProfile::TypeMapFormatString = "sssiibibsbsbsbsbbbs*bbsbsbsbsssbbiisbsbbbsbsb";
// ****************************************************************************
// Method: HostProfile::HostProfile
......@@ -177,6 +177,7 @@ HostProfile::HostProfile(const HostProfile &obj) :
sublaunchPostCmdSet = obj.sublaunchPostCmdSet;
sublaunchPostCmd = obj.sublaunchPostCmd;
hostAliases = obj.hostAliases;
hostNickname = obj.hostNickname;
shareOneBatchJob = obj.shareOneBatchJob;
sshPortSpecified = obj.sshPortSpecified;
sshPort = obj.sshPort;
......@@ -263,6 +264,7 @@ HostProfile::operator = (const HostProfile &obj)
sublaunchPostCmdSet = obj.sublaunchPostCmdSet;
sublaunchPostCmd = obj.sublaunchPostCmd;
hostAliases = obj.hostAliases;
hostNickname = obj.hostNickname;
shareOneBatchJob = obj.shareOneBatchJob;
sshPortSpecified = obj.sshPortSpecified;
sshPort = obj.sshPort;
......@@ -330,6 +332,7 @@ HostProfile::operator == (const HostProfile &obj) const
(sublaunchPostCmdSet == obj.sublaunchPostCmdSet) &&
(sublaunchPostCmd == obj.sublaunchPostCmd) &&
(hostAliases == obj.hostAliases) &&
(hostNickname == obj.hostNickname) &&
(shareOneBatchJob == obj.shareOneBatchJob) &&
(sshPortSpecified == obj.sshPortSpecified) &&
(sshPort == obj.sshPort) &&
......@@ -516,6 +519,7 @@ HostProfile::SelectAll()
Select(ID_sublaunchPostCmdSet, (void *)&sublaunchPostCmdSet);
Select(ID_sublaunchPostCmd, (void *)&sublaunchPostCmd);
Select(ID_hostAliases, (void *)&hostAliases);
Select(ID_hostNickname, (void *)&hostNickname);
Select(ID_shareOneBatchJob, (void *)&shareOneBatchJob);
Select(ID_sshPortSpecified, (void *)&sshPortSpecified);
Select(ID_sshPort, (void *)&sshPort);
......@@ -736,6 +740,12 @@ HostProfile::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
node->AddNode(new DataNode("hostAliases", hostAliases));
}
if(completeSave || !FieldsEqual(ID_hostNickname, &defaultObject))
{
addToParent = true;
node->AddNode(new DataNode("hostNickname", hostNickname));
}
if(completeSave || !FieldsEqual(ID_shareOneBatchJob, &defaultObject))
{
addToParent = true;
......@@ -914,6 +924,8 @@ HostProfile::SetFromNode(DataNode *parentNode)
SetSublaunchPostCmd(node->AsString());
if((node = searchNode->GetNode("hostAliases")) != 0)
SetHostAliases(node->AsString());
if((node = searchNode->GetNode("hostNickname")) != 0)
SetHostNickname(node->AsString());
if((node = searchNode->GetNode("shareOneBatchJob")) != 0)
SetShareOneBatchJob(node->AsBool());
if((node = searchNode->GetNode("sshPortSpecified")) != 0)
......@@ -1165,6 +1177,13 @@ HostProfile::SetHostAliases(const std::string &hostAliases_)
Select(ID_hostAliases, (void *)&hostAliases);
}
void
HostProfile::SetHostNickname(const std::string &hostNickname_)
{
hostNickname = hostNickname_;
Select(ID_hostNickname, (void *)&hostNickname);
}
void
HostProfile::SetShareOneBatchJob(bool shareOneBatchJob_)
{
......@@ -1519,6 +1538,18 @@ HostProfile::GetHostAliases()
return hostAliases;
}
const std::string &
HostProfile::GetHostNickname() const
{
return hostNickname;
}
std::string &
HostProfile::GetHostNickname()
{
return hostNickname;
}
bool
HostProfile::GetShareOneBatchJob() const
{
......@@ -1709,6 +1740,12 @@ HostProfile::SelectHostAliases()
Select(ID_hostAliases, (void *)&hostAliases);
}
void
HostProfile::SelectHostNickname()
{
Select(ID_hostNickname, (void *)&hostNickname);
}
void
HostProfile::SelectManualClientHostName()
{
......@@ -1786,6 +1823,7 @@ HostProfile::GetFieldName(int index) const
case ID_sublaunchPostCmdSet: return "sublaunchPostCmdSet";
case ID_sublaunchPostCmd: return "sublaunchPostCmd";
case ID_hostAliases: return "hostAliases";
case ID_hostNickname: return "hostNickname";
case ID_shareOneBatchJob: return "shareOneBatchJob";
case ID_sshPortSpecified: return "sshPortSpecified";
case ID_sshPort: return "sshPort";
......@@ -1853,6 +1891,7 @@ HostProfile::GetFieldType(int index) const
case ID_sublaunchPostCmdSet: return FieldType_bool;
case ID_sublaunchPostCmd: return FieldType_string;
case ID_hostAliases: return FieldType_string;
case ID_hostNickname: return FieldType_string;
case ID_shareOneBatchJob: return FieldType_bool;
case ID_sshPortSpecified: return FieldType_bool;
case ID_sshPort: return FieldType_int;
......@@ -1920,6 +1959,7 @@ HostProfile::GetFieldTypeName(int index) const
case ID_sublaunchPostCmdSet: return "bool";
case ID_sublaunchPostCmd: return "string";
case ID_hostAliases: return "string";
case ID_hostNickname: return "string";
case ID_shareOneBatchJob: return "bool";
case ID_sshPortSpecified: return "bool";
case ID_sshPort: return "int";
......@@ -2105,6 +2145,11 @@ HostProfile::FieldsEqual(int index_, const AttributeGroup *rhs) const
retval = (hostAliases == obj.hostAliases);
}
break;
case ID_hostNickname:
{ // new scope
retval = (hostNickname == obj.hostNickname);
}
break;
case ID_shareOneBatchJob:
{ // new scope
retval = (shareOneBatchJob == obj.shareOneBatchJob);
......
......@@ -95,6 +95,7 @@ public:
void SelectSublaunchPreCmd();
void SelectSublaunchPostCmd();
void SelectHostAliases();
void SelectHostNickname();
void SelectManualClientHostName();
void SelectMachinefile();
void SelectHwAccelPreCommand();
......@@ -130,6 +131,7 @@ public:
void SetSublaunchPostCmdSet(bool sublaunchPostCmdSet_);
void SetSublaunchPostCmd(const std::string &sublaunchPostCmd_);
void SetHostAliases(const std::string &hostAliases_);
void SetHostNickname(const std::string &hostNickname_);
void SetShareOneBatchJob(bool shareOneBatchJob_);
void SetSshPortSpecified(bool sshPortSpecified_);
void SetSshPort(int sshPort_);
......@@ -188,6 +190,8 @@ public:
std::string &GetSublaunchPostCmd();
const std::string &GetHostAliases() const;
std::string &GetHostAliases();
const std::string &GetHostNickname() const;
std::string &GetHostNickname();
bool GetShareOneBatchJob() const;
bool GetSshPortSpecified() const;
int GetSshPort() const;
......@@ -264,6 +268,7 @@ public:
ID_sublaunchPostCmdSet,
ID_sublaunchPostCmd,
ID_hostAliases,
ID_hostNickname,
ID_shareOneBatchJob,
ID_sshPortSpecified,
ID_sshPort,
......@@ -310,6 +315,7 @@ private:
bool sublaunchPostCmdSet;
std::string sublaunchPostCmd;
std::string hostAliases;
std::string hostNickname;
bool shareOneBatchJob;
bool sshPortSpecified;
int sshPort;
......
......@@ -82,6 +82,8 @@
</Field>
<Field name="hostAliases" label="hostAliases" type="string">
</Field>
<Field name="hostNickname" label="hostNickname" type="string">
</Field>
<Field name="shareOneBatchJob" label="shareOneBatchJob" type="bool">
false
</Field>
......
......@@ -641,6 +641,9 @@ QvisFileWindowBase::UpdateWindowFromFiles(bool doAll)
//
// Modifications:
//
// Hank Childs, Thu May 7 19:59:13 PDT 2009
// Add support for nicknames.
//
// ****************************************************************************
void
......@@ -658,7 +661,12 @@ QvisFileWindowBase::UpdateHostComboBox()
// Create a constant reference to the i'th profile.
const HostProfile &p = profiles->operator[](i);
stringVector hostNames(p.SplitHostPattern(p.GetHost()));
stringVector hostNames;
if (p.GetHostNickname() != "")
hostNames.push_back(p.GetHostNickname());
else
hostNames = p.SplitHostPattern(p.GetHost());
for (int k = 0; k < hostNames.size(); ++k)
{
if(std::find(hosts.begin(), hosts.end(), hostNames[k]) == hosts.end())
......@@ -1123,6 +1131,9 @@ QvisFileWindowBase::GetCurrentValues(bool allowPathChange)
// Cyrus Harrison, Thu Jun 26 09:54:36 PDT 2008
// Initial Qt4 Port.
//
// Hank Childs, Thu May 7 20:08:04 PDT 2009
// Added support for nicknames.
//
// ****************************************************************************
bool
......@@ -1136,6 +1147,13 @@ QvisFileWindowBase::ChangeHosts()
// Take the string from the text field and strip whitespace.
std::string host(hostComboBox->currentText().trimmed().toStdString());
std::string currentHost(fileServer->GetHost());
for(int i = 0; i < profiles->GetNumProfiles(); ++i)
{
// Create a constant reference to the i'th profile.
const HostProfile &p = profiles->operator[](i);
if (p.GetHostNickname() == host)
host = p.GetHost();
}
if(host != fileServer->GetHost())
{
......
......@@ -319,6 +319,9 @@ QvisHostProfileWindow::CreateWindowContents()
// Cyrus Harrison, Tue Jun 24 11:15:28 PDT 2008
// Initial Qt4 Port.
//
// Hank Childs, Thu May 7 19:05:36 PDT 2009
// Added support for host nicknames.
//
// ****************************************************************************
QWidget *
......@@ -329,7 +332,6 @@ QvisHostProfileWindow::CreateSelectedTab(QWidget *parent)
QVBoxLayout *innerLayout = new QVBoxLayout(activeProfileGroup);
QGridLayout *profileLayout = new QGridLayout();
innerLayout->addLayout(profileLayout);
profileLayout->setSpacing(HOST_PROFILE_SPACING);
innerLayout->addStretch(5);
......@@ -374,6 +376,14 @@ QvisHostProfileWindow::CreateSelectedTab(QWidget *parent)
profileLayout->addWidget(hostAliases, row, 1);
row++;
hostNickname = new QLineEdit(activeProfileGroup);
connect(hostNickname, SIGNAL(textChanged(const QString &)),
this, SLOT(hostNicknameChanged(const QString &)));
hostNicknameLabel = new QLabel(QString("*") + tr("Host nickname"), activeProfileGroup);
profileLayout->addWidget(hostNicknameLabel, row, 0);
profileLayout->addWidget(hostNickname, row, 1);
row++;
userName = new QLineEdit(activeProfileGroup);
connect(userName, SIGNAL(textChanged(const QString &)),
this, SLOT(userNameChanged(const QString &)));
......@@ -1201,6 +1211,9 @@ QvisHostProfileWindow::UpdateProfileList()
// Cyrus Harrison, Tue Dec 9 14:55:27 PST 2008
// Finished Qt4 Port todo.
//
// Hank Childs, Fri May 8 05:52:11 PDT 2009
// Add support for host nicknames.
//
// ****************************************************************************
void
......@@ -1236,6 +1249,7 @@ QvisHostProfileWindow::UpdateActiveProfile()
activeProfileCheckBox->blockSignals(true);
hostName->blockSignals(true);
hostAliases->blockSignals(true);
hostNickname->blockSignals(true);
userName->blockSignals(true);
loadBalancing->blockSignals(true);
engineArguments->blockSignals(true);
......@@ -1258,6 +1272,7 @@ QvisHostProfileWindow::UpdateActiveProfile()
hostName->setEditText("");
hostName->setEditText(GetViewerProxy()->GetLocalHostName().c_str());
hostAliases->setText("");
hostNickname->setText("");
userName->setText("");
userName->setText(GetViewerProxy()->GetLocalUserName().c_str());
numProcessors->setValue(1);
......@@ -1303,6 +1318,7 @@ QvisHostProfileWindow::UpdateActiveProfile()
// Replace the "localhost" machine name.
hostName->setEditText(current.GetHost().c_str());
hostAliases->setText(current.GetHostAliases().c_str());
hostNickname->setText(current.GetHostNickname().c_str());
// If there is no user name then give it a valid user name.
if(current.GetUserName() == "notset")
{
......@@ -1464,6 +1480,7 @@ QvisHostProfileWindow::UpdateActiveProfile()
activeProfileCheckBox->blockSignals(false);
hostName->blockSignals(false);
hostAliases->blockSignals(false);
hostNickname->blockSignals(false);
userName->blockSignals(false);
loadBalancing->blockSignals(false);
engineArguments->blockSignals(false);
......@@ -1591,6 +1608,8 @@ QvisHostProfileWindow::UpdateWindowSensitivity()
hostName->setEnabled(enabled);
hostAliasesLabel->setEnabled(enabled);
hostAliases->setEnabled(enabled);
hostNicknameLabel->setEnabled(enabled);
hostNickname->setEnabled(enabled);
userNameLabel->setEnabled(enabled);
userName->setEnabled(enabled);
timeout->setEnabled(enabled);
......@@ -1717,13 +1736,17 @@ QvisHostProfileWindow::UpdateWindowSensitivity()
// Dave Bremer, Wed Apr 16 17:54:14 PDT 2008
// Added fields for commands to run pre and post the mpi command.
//
// Cyrus Harrison, Wed Jun 25 11:01:46 PDT 2008
// Initial Qt4 Port.
// Cyrus Harrison, Wed Jun 25 11:01:46 PDT 2008
// Initial Qt4 Port.
//
// Cyrus Harrison, Tue Dec 9 14:55:27 PST 2008
// Finished Qt4 Port todo.
// Cyrus Harrison, Tue Dec 9 14:55:27 PST 2008
// Finished Qt4 Port todo.
//
// Hank Childs, Fri May 8 05:52:11 PDT 2009
// Add support for host nicknames.
//
// ****************************************************************************
bool
QvisHostProfileWindow::GetCurrentValues(int which_widget)
{
......@@ -1981,6 +2004,26 @@ QvisHostProfileWindow::GetCurrentValues(int which_widget)
}
widget++;
// Do the host nickname
if(which_widget == widget || doAll)
{
temp = hostNickname->text();
temp = temp.trimmed();
std::string newNickname(temp.toStdString());
if (newNickname != current.GetHostNickname())
needNotify = true;
// Change all profiles with the same hostname
for(int i = 0; i < profiles->GetNumProfiles(); ++i)
{
HostProfile &prof = profiles->operator[](i);
if (prof.GetHost() == current.GetHost())
prof.SetHostNickname(newNickname);
}
}
widget++;
// Do the manual client host name
if(which_widget == widget || doAll)
{
......@@ -3025,6 +3068,33 @@ QvisHostProfileWindow::hostAliasesChanged(const QString &aliases)
}
}
// ****************************************************************************
// Method: QvisHostProfileWindow::hostNicknameChanged
//
// Purpose:
// This is a slot function that sets the host nickname for the current
// profile.
//
// Programmer: Hank Childs
// Creation: May 7, 2009
//
// ****************************************************************************
void
QvisHostProfileWindow::hostNicknameChanged(const QString &nickname)
{
HostProfileList *profiles = (HostProfileList *)subject;
HostProfile &current = profiles->operator[](profiles->GetActiveProfile());
for(int i = 0; i < profiles->GetNumProfiles(); ++i)
{
HostProfile &prof = profiles->operator[](i);
if (prof.GetHost() == current.GetHost())
prof.SetHostNickname(nickname.toStdString());
}
}
// ****************************************************************************
// Method: QvisHostProfileWindow::processEngineArgumentsText
//
......
......@@ -145,6 +145,9 @@ class QRadioButton;
// Cyrus Harrison, Tue Jun 24 11:15:28 PDT 2008
// Initial Qt4 Port.
//
// Hank Childs, Thu May 7 19:05:36 PDT 2009
// Added field for host nickname.
//
// ****************************************************************************
class GUI_API QvisHostProfileWindow : public QvisPostableWindowObserver
......@@ -204,6 +207,7 @@ private slots:
void loadBalancingChanged(int);
void hostNameChanged(const QString &host);
void hostAliasesChanged(const QString &host);
void hostNicknameChanged(const QString &host);
void userNameChanged(const QString &username);
void toggleSSHPort(bool);
void sshPortChanged(const QString &port);
......@@ -238,6 +242,8 @@ private:
QComboBox *hostName;
QLabel *hostAliasesLabel;
QLineEdit *hostAliases;
QLabel *hostNicknameLabel;
QLineEdit *hostNickname;
QLabel *userNameLabel;
QLineEdit *userName;
QLabel *numProcLabel;
......
......@@ -25,6 +25,7 @@
<Field name="sublaunchPostCmdSet" type="bool">true</Field>
<Field name="sublaunchPostCmd" type="string">cd $PBS_O_WORKDIR; mpdallexit</Field>
<Field name="hostAliases" type="string">login## login##.cosmea login##.cosmea.mcs login##.cosmea.mcs.anl login##.cosmea.mcs.anl.gov cosmea.mcs.anl.gov cosmea.mcs.anl cosmea.mcs cosmea</Field>
<Field name="hostNickname" type="string">cosmea</Field>
</Object>
<Object name="HostProfile">
<Field name="profileName" type="string">cosmea - serial</Field>
......@@ -41,6 +42,7 @@
<Field name="sublaunchArgsSet" type="bool">true</Field>
<Field name="sublaunchArgs" type="string">-env MV2_ON_DEMAND_THRESHOLD 1024</Field>
<Field name="hostAliases" type="string">login## login##.cosmea login##.cosmea.mcs login##.cosmea.mcs.anl login##.cosmea.mcs.anl.gov cosmea.mcs.anl.gov cosmea.mcs.anl cosmea.mcs cosmea</Field>
<Field name="hostNickname" type="string">cosmea</Field>
</Object>
<Field name="activeProfile" type="int">1</Field>
<Object name="HostProfile">
......@@ -79,6 +81,7 @@
<Field name="launchArgsSet" type="bool">true</Field>
<Field name="launchArgs" type="string">-nolocal</Field>
<Field name="hostAliases" type="string">login1.eureka.alcf.anl.gov vs##-mgmt.alcf.anl.gov vs##-mgmt vs##</Field>
<Field name="hostNickname" type="string">eureka</Field>
<Field name="machinefileSet" type="bool">true</Field>
<Field name="machinefile" type="string">$COBALT_NODEFILE</Field>
<Field name="arguments" type="stringVector">"-dir" "/soft/apps/visit" </Field>
......@@ -88,6 +91,7 @@
<Field name="profileName" type="string">serial</Field>
<Field name="host" type="string">login1.eureka.alcf.anl.gov</Field>
<Field name="hostAliases" type="string">login1.eureka.alcf.anl.gov vs##-mgmt.alcf.anl.gov vs##-mgmt vs##</Field>
<Field name="hostNickname" type="string">eureka</Field>
<Field name="machinefileSet" type="bool">true</Field>
<Field name="machinefile" type="string">$COBALT_NODEFILE</Field>
<Field name="arguments" type="stringVector">"-dir" "/soft/apps/visit" </Field>
......
......@@ -25,6 +25,7 @@
<Field name="sublaunchPostCmdSet" type="bool">true</Field>
<Field name="sublaunchPostCmd" type="string">cd $PBS_O_WORKDIR; mpdallexit</Field>
<Field name="hostAliases" type="string">login## login##.cosmea login##.cosmea.mcs login##.cosmea.mcs.anl login##.cosmea.mcs.anl.gov cosmea.mcs.anl.gov cosmea.mcs.anl cosmea.mcs cosmea</Field>
<Field name="hostNickname" type="string">cosmea</Field>
</Object>
<Object name="HostProfile">
<Field name="profileName" type="string">cosmea - serial</Field>
......@@ -41,6 +42,7 @@
<Field name="sublaunchArgsSet" type="bool">true</Field>
<Field name="sublaunchArgs" type="string">-env MV2_ON_DEMAND_THRESHOLD 1024</Field>
<Field name="hostAliases" type="string">login## login##.cosmea login##.cosmea.mcs login##.cosmea.mcs.anl login##.cosmea.mcs.anl.gov cosmea.mcs.anl.gov cosmea.mcs.anl cosmea.mcs cosmea</Field>
<Field name="hostNickname" type="string">cosmea</Field>
</Object>
<Field name="activeProfile" type="int">1</Field>
<Object name="HostProfile">
......@@ -79,6 +81,7 @@
<Field name="launchArgsSet" type="bool">true</Field>
<Field name="launchArgs" type="string">-nolocal</Field>
<Field name="hostAliases" type="string">login1.eureka.alcf.anl.gov vs##-mgmt.alcf.anl.gov vs##-mgmt vs##</Field>
<Field name="hostNickname" type="string">eureka</Field>
<Field name="machinefileSet" type="bool">true</Field>
<Field name="machinefile" type="string">$COBALT_NODEFILE</Field>
<Field name="arguments" type="stringVector">"-dir" "/soft/apps/visit" </Field>
......@@ -88,6 +91,7 @@
<Field name="profileName" type="string">serial</Field>
<Field name="host" type="string">login1.eureka.alcf.anl.gov</Field>
<Field name="hostAliases" type="string">login1.eureka.alcf.anl.gov vs##-mgmt.alcf.anl.gov vs##-mgmt vs##</Field>
<Field name="hostNickname" type="string">eureka</Field>
<Field name="machinefileSet" type="bool">true</Field>
<Field name="machinefile" type="string">$COBALT_NODEFILE</Field>
<Field name="arguments" type="stringVector">"-dir" "/soft/apps/visit" </Field>
......@@ -96,11 +100,11 @@
<Object name="HostProfile">
<Field name="profileName" type="string">parallel</Field>
<Field name="host" type="string">login1.gadzooks.alcf.anl.gov</Field>
<Field name="numProcessors" type="int">80</Field>
<Field name="numProcessors" type="int">16</Field>
<Field name="bankSet" type="bool">true</Field>
<Field name="bank" type="string">$COBALT_PROJ</Field>
<Field name="numNodesSet" type="bool">true</Field>
<Field name="numNodes" type="int">10</Field>
<Field name="numNodes" type="int">2</Field>
<Field name="timeLimitSet" type="bool">true</Field>
<Field name="timeLimit" type="string">60</Field>
<Field name="launchMethodSet" type="bool">true</Field>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment