Commit 89226ecc authored by hrchilds's avatar hrchilds
Browse files

Update from August 5, 2004

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@295 18c085ea-50e0-402c-830e-de6fd14e8384
parent dd274a4a
#include <RemoteProxyBase.h>
#include <RemoteProcess.h>
#include <ExistingRemoteProcess.h>
#include <HostProfile.h>
#include <snprintf.h>
// ****************************************************************************
// Method: RemoteProxyBase::RemoteProxyBase
......@@ -243,6 +245,149 @@ RemoteProxyBase::AddArgument(const std::string &arg)
argv.push_back(arg);
}
// ****************************************************************************
// Method: RemoteProxyBase::AddProfileArguments
//
// Purpose:
// Adds the appropriate arguments to a remote proxy.
//
// Arguments:
// profile : the host profile used to set the arguments.
// addParallelArgs : true if this process is going to launch itself
// in parallel, and false if the vcl has already
// created a parallel job and we just need to
// choose the parallel engine when needed
//
// Programmer: Jeremy Meredith
// Creation: June 26, 2003
//
// Modifications:
// Brad Whitlock, Wed Aug 4 17:40:57 PST 2004
// Moved this method from ViewerRemoteProcessChooser and changed the code
// a little.
//
// ****************************************************************************
void
RemoteProxyBase::AddProfileArguments(const HostProfile &profile,
bool addParallelArgs)
{
int i;
//
// Set the user's login name.
//
SetRemoteUserName(profile.GetUserName());
//
// Add the parallel arguments.
//
if (profile.GetParallel())
{
char temp[10];
if (!addParallelArgs)
{
AddArgument("-par");
}
if (addParallelArgs)
{
SNPRINTF(temp, 10, "%d", profile.GetNumProcessors());
AddArgument("-np");
AddArgument(temp);
}
SetNumProcessors(profile.GetNumProcessors());
if (profile.GetNumNodesSet() &&
profile.GetNumNodes() > 0)
{
if (addParallelArgs)
{
SNPRINTF(temp, 10, "%d", profile.GetNumNodes());
AddArgument("-nn");
AddArgument(temp);
}
SetNumNodes(profile.GetNumNodes());
}
if (addParallelArgs)
{
if (profile.GetPartitionSet() &&
profile.GetPartition().length() > 0)
{
AddArgument("-p");
AddArgument(profile.GetPartition());
}
if (profile.GetBankSet() &&
profile.GetBank().length() > 0)
{
AddArgument("-b");
AddArgument(profile.GetBank());
}
if (profile.GetTimeLimitSet() &&
profile.GetTimeLimit().length() > 0)
{
AddArgument("-t");
AddArgument(profile.GetTimeLimit());
}
if (profile.GetLaunchMethodSet() &&
profile.GetLaunchMethod().length() > 0)
{
AddArgument("-l");
AddArgument(profile.GetLaunchMethod());
}
if (profile.GetLaunchArgsSet() &&
profile.GetLaunchArgs().length() > 0)
{
AddArgument("-la");
AddArgument(profile.GetLaunchArgs());
}
}
#if 0 // disabling dynamic load balancing for now
if (profile.GetForceStatic())
{
if (addParallelArgs)
{
AddArgument("-forcestatic");
}
SetLoadBalancing(0);
}
if (profile.GetForceDynamic())
{
if (addParallelArgs)
{
AddArgument("-forcedynamic");
}
SetLoadBalancing(1);
}
#else
// force all static until speed issues are resolved
if (addParallelArgs)
{
AddArgument("-forcestatic");
}
SetLoadBalancing(0);
#endif
}
// Add the timeout argument
char temp[10];
SNPRINTF(temp, 10, "%d", profile.GetTimeout());
AddArgument("-timeout");
AddArgument(temp);
//
// Add any additional arguments specified in the profile
//
for (i = 0; i < profile.GetArguments().size(); ++i)
AddArgument(profile.GetArguments()[i]);
}
// ****************************************************************************
// Method: RemoteProxyBase::Parallel
//
......
......@@ -9,6 +9,7 @@
#include <string>
// Forward declaration.
class HostProfile;
class RemoteProcess;
// ****************************************************************************
......@@ -36,6 +37,9 @@ class RemoteProcess;
// I added KeepAliveRPC so we don't lose connections to remote components
// whose connections have been idle for a long time.
//
// Brad Whitlock, Thu Aug 5 09:59:11 PDT 2004
// Added AddProfileArguments from another class.
//
// ****************************************************************************
class PROXYBASE_API RemoteProxyBase
......@@ -47,6 +51,7 @@ public:
void SetRemoteUserName(const std::string &rName);
void SetProgressCallback(bool (*cb)(void *, int), void *data);
void AddArgument(const std::string &arg);
void AddProfileArguments(const HostProfile &profile, bool addParallelArgs);
void Create(const std::string &hostName,
HostProfile::ClientHostDetermination chd,
......
......@@ -12,7 +12,7 @@ import java.lang.Integer;
// Notes: Autogenerated by xml2java.
//
// Programmer: xml2java
// Creation: Mon Apr 5 09:09:42 PDT 2004
// Creation: Thu Aug 5 10:40:13 PDT 2004
//
// Modifications:
//
......@@ -20,7 +20,7 @@ import java.lang.Integer;
public class ViewerRPC extends AttributeSubject
{
// Constants
// Enum values
public final static int VIEWERRPCTYPE_CLOSERPC = 0;
public final static int VIEWERRPCTYPE_ADDWINDOWRPC = 1;
public final static int VIEWERRPCTYPE_DELETEWINDOWRPC = 2;
......@@ -164,7 +164,8 @@ public class ViewerRPC extends AttributeSubject
public final static int VIEWERRPCTYPE_SETQUERYOVERTIMEATTRIBUTESRPC = 140;
public final static int VIEWERRPCTYPE_SETDEFAULTQUERYOVERTIMEATTRIBUTESRPC = 141;
public final static int VIEWERRPCTYPE_RESETQUERYOVERTIMEATTRIBUTESRPC = 142;
public final static int VIEWERRPCTYPE_MAXRPC = 143;
public final static int VIEWERRPCTYPE_RESETLINEOUTCOLORRPC = 143;
public final static int VIEWERRPCTYPE_MAXRPC = 144;
public ViewerRPC()
......
This diff is collapsed.
......@@ -177,11 +177,20 @@ class WindowAttributes;
// Mark C. Miller, Tue Jul 27 15:11:11 PDT 2004
// Added arg for frame and state to SetWinAnnotAtts
//
// Brad Whitlock, Wed Aug 4 17:12:28 PST 2004
// I changed the definition of EngineMap so it contains EngineInformation
// objects, which contain a HostProfile.
//
// ****************************************************************************
class VIEWER_API ViewerEngineManager : public ViewerServerManager,
public SimpleObserver
{
struct EngineInformation
{
EngineProxy *proxy;
HostProfile profile;
};
public:
virtual ~ViewerEngineManager();
virtual void Update(Subject *TheChangedSubject);
......@@ -274,7 +283,7 @@ class VIEWER_API ViewerEngineManager : public ViewerServerManager,
void EndEngineRender();
private:
typedef std::map<EngineKey,EngineProxy*> EngineMap;
typedef std::map<EngineKey, EngineInformation> EngineMap;
static ViewerEngineManager *instance;
static EngineList *clientEngineAtts;
......
......@@ -3864,3 +3864,24 @@ ViewerQueryManager::FinishLineQuery()
}
viewerSubject->BlockSocketSignals(false);
}
// ****************************************************************************
// Method: ViewerQueryManager::ResetLineoutColor
//
// Purpose:
// Resets colorIndex to the default state.
//
// Programmer: Kathleen Bonnell
// Creation: August 5, 2004
//
// Modifications:
//
// ****************************************************************************
void
ViewerQueryManager::ResetLineoutColor()
{
colorIndex = 0;
}
......@@ -152,6 +152,9 @@ typedef struct {
// 'FinishLineQuery'. Added lineoutCache to store the lineout options
// between calling Start and Finish.
//
// Kathleen Bonnell, Thu Aug 5 08:34:15 PDT 2004
// Added ResetLineoutColor.
//
// ****************************************************************************
class VIEWER_API ViewerQueryManager
......@@ -207,6 +210,8 @@ class VIEWER_API ViewerQueryManager
void ResetPickLetter(void);
void ResetDesignator(void);
void ResetLineoutColor(void);
void UpdateQueryOverTimeAtts();
void SetQueryOverTimeAttsFromClient();
void SetQueryOverTimeAttsFromDefault();
......
#include "ViewerRemoteProcessChooser.h"
#include <HostProfile.h>
#include <HostProfileList.h>
#include <ViewerHostProfileSelectorNoWin.h>
#include <ViewerHostProfileSelectorWithWin.h>
......@@ -71,169 +71,23 @@ ViewerRemoteProcessChooser::~ViewerRemoteProcessChooser()
// Creation: June 26, 2003
//
// Modifications:
// Brad Whitlock, Thu Aug 5 09:25:20 PDT 2004
// I made it return the profile.
//
// ****************************************************************************
bool
ViewerRemoteProcessChooser::SelectProfile(HostProfileList *hostProfileList,
const string &hostName,
bool skipChooser)
const string &hostName, bool skipChooser, HostProfile &profile)
{
// sets profile
return selector->SelectProfile(hostProfileList, hostName, skipChooser);
}
bool retval = selector->SelectProfile(hostProfileList, hostName, skipChooser);
// ****************************************************************************
// Method: ViewerRemoteProcessChooserNoWin::AddProfileArguments
//
// Purpose:
// Adds the appropriate arguments to a remote proxy.
//
// Arguments:
// proxy : the remote process proxy
// addParallelArgs : true if this process is going to launch itself
// in parallel, and false if the vcl has already
// created a parallel job and we just need to
// choose the parallel engine when needed
//
// Programmer: Jeremy Meredith
// Creation: June 26, 2003
//
// Modifications:
// ****************************************************************************
// If a profile was selected, return it here.
if(retval)
profile = selector->GetHostProfile();
void
ViewerRemoteProcessChooser::AddProfileArguments(RemoteProxyBase *proxy,
bool addParallelArgs)
{
int i;
const HostProfile profile = selector->GetHostProfile();
//
// Set the user's login name.
//
proxy->SetRemoteUserName(profile.GetUserName());
//
// Add the parallel arguments.
//
if (profile.GetParallel())
{
char temp[10];
if (!addParallelArgs)
{
proxy->AddArgument("-par");
}
SNPRINTF(temp, 10, "%d", profile.GetNumProcessors());
if (addParallelArgs)
{
proxy->AddArgument("-np");
proxy->AddArgument(temp);
}
proxy->SetNumProcessors(profile.GetNumProcessors());
if (profile.GetNumNodesSet() &&
profile.GetNumNodes() > 0)
{
SNPRINTF(temp, 10, "%d", profile.GetNumNodes());
if (addParallelArgs)
{
proxy->AddArgument("-nn");
proxy->AddArgument(temp);
}
proxy->SetNumNodes(profile.GetNumNodes());
}
if (profile.GetPartitionSet() &&
profile.GetPartition().length() > 0)
{
if (addParallelArgs)
{
proxy->AddArgument("-p");
proxy->AddArgument(profile.GetPartition());
}
}
if (profile.GetBankSet() &&
profile.GetBank().length() > 0)
{
if (addParallelArgs)
{
proxy->AddArgument("-b");
proxy->AddArgument(profile.GetBank());
}
}
if (profile.GetTimeLimitSet() &&
profile.GetTimeLimit().length() > 0)
{
if (addParallelArgs)
{
proxy->AddArgument("-t");
proxy->AddArgument(profile.GetTimeLimit());
}
}
if (profile.GetLaunchMethodSet() &&
profile.GetLaunchMethod().length() > 0)
{
if (addParallelArgs)
{
proxy->AddArgument("-l");
proxy->AddArgument(profile.GetLaunchMethod());
}
}
if (profile.GetLaunchArgsSet() &&
profile.GetLaunchArgs().length() > 0)
{
if (addParallelArgs)
{
proxy->AddArgument("-la");
proxy->AddArgument(profile.GetLaunchArgs());
}
}
#if 0 // disabling dynamic load balancing for now
if (profile.GetForceStatic())
{
if (addParallelArgs)
{
proxy->AddArgument("-forcestatic");
}
proxy->SetLoadBalancing(0);
}
if (profile.GetForceDynamic())
{
if (addParallelArgs)
{
proxy->AddArgument("-forcedynamic");
}
proxy->SetLoadBalancing(1);
}
#else
// force all static until speed issues are resolved
if (addParallelArgs)
{
proxy->AddArgument("-forcestatic");
}
proxy->SetLoadBalancing(0);
#endif
}
// Add the timeout argument
char temp[10];
SNPRINTF(temp, 10, "%d", profile.GetTimeout());
proxy->AddArgument("-timeout");
proxy->AddArgument(temp);
//
// Add any additional arguments specified in the profile
//
for (i = 0; i < profile.GetArguments().size(); ++i)
proxy->AddArgument(profile.GetArguments()[i]);
return retval;
}
......@@ -264,7 +118,6 @@ ViewerRemoteProcessChooser::ClearCache(const std::string &hostName)
selector->ClearCache(hostName);
}
// ****************************************************************************
// Method: ViewerRemoteProcessChooser::AddRestartArgsToCachedProfile
//
......
......@@ -5,6 +5,7 @@
#include <string>
#include <vector>
class HostProfile;
class HostProfileList;
class RemoteProxyBase;
class ViewerHostProfileSelector;
......@@ -40,7 +41,12 @@ class ViewerHostProfileSelector;
// the arguments than what the ViewerEngineManager was doing for
// normal engine launches.
//
// Brad Whitlock, Wed Aug 4 17:38:16 PST 2004
// I made the selected host profile get passed out of SelectProfile. I also
// moved AddProfileArguments into RemoteProxyBase.
//
// ****************************************************************************
class VIEWER_API ViewerRemoteProcessChooser
{
public:
......@@ -48,8 +54,8 @@ class VIEWER_API ViewerRemoteProcessChooser
static ViewerRemoteProcessChooser *Instance();
static void SetNoWinMode(bool nw);
bool SelectProfile(HostProfileList*, const std::string&, bool skip);
void AddProfileArguments(RemoteProxyBase*, bool addParallelArgs);
bool SelectProfile(HostProfileList*, const std::string&, bool skip,
HostProfile &profile);
void AddRestartArgsToCachedProfile(const std::string&,
const std::vector<std::string>&);
void ClearCache(const std::string&);
......
......@@ -224,9 +224,12 @@ ViewerServerManager::RealHostName(const char *hostName) const
// Creation: Tue May 6 14:00:21 PST 2003
//
// Modifications:
// Eric Brugger, Wed Dec 3 08:27:47 PST 2003
// I removed the default timeout passed to the mdserver.
//
// Eric Brugger, Wed Dec 3 08:27:47 PST 2003
// I removed the default timeout passed to the mdserver.
//
// Brad Whitlock, Thu Aug 5 10:28:33 PDT 2004
// I made it call RemoteProxyBase::AddProfileArguments.
//
// ****************************************************************************
void
......@@ -240,26 +243,7 @@ ViewerServerManager::AddProfileArguments(RemoteProxyBase *component,
const HostProfile *profile =
clientAtts->FindMatchingProfileForHost(host.c_str());
if(profile != 0)
{
//
// Set the user's login name.
//
component->SetRemoteUserName(profile->GetUserName().c_str());
//
// Add the timeout argument
//
char temp[10];
SNPRINTF(temp, 10, "%d", profile->GetTimeout());
component->AddArgument("-timeout");
component->AddArgument(temp);
//
// Add any additional arguments.
//
for(int i = 0; i < profile->GetArguments().size(); ++i)
component->AddArgument(profile->GetArguments()[i].c_str());
}
component->AddProfileArguments(*profile, false);
}
// ****************************************************************************
......@@ -573,10 +557,13 @@ ViewerServerManager::SendKeepAlivesToLaunchers()
// for itself, the mdserver, and the engine if they are told
// to share one batch job in the host profile.
//
// Jeremy Meredith, Thu Oct 9 14:03:11 PDT 2003
// Added ability to manually specify a client host name or to have it
// parsed from the SSH_CLIENT (or related) environment variables. Added
// ability to specify an SSH port.
// Jeremy Meredith, Thu Oct 9 14:03:11 PDT 2003
// Added ability to manually specify a client host name or to have it
// parsed from the SSH_CLIENT (or related) environment variables. Added
// ability to specify an SSH port.
//
// Brad Whitlock, Thu Aug 5 10:52:40 PDT 2004
// I made it get its profile from the chooser if possible.
//
// ****************************************************************************
......@@ -586,14 +573,23 @@ ViewerServerManager::StartLauncher(const std::string &host,
{
if(launchers.find(host) == launchers.end())
{
if (ShouldShareBatchJob(host))
HostProfile profile;
const HostProfile *hptr = clientAtts->FindMatchingProfileForHost(host);
bool shouldShareBatchJob = false;
if(hptr!= 0)
{
shouldShareBatchJob = hptr->GetShareOneBatchJob();
profile = *hptr;
}
if (shouldShareBatchJob)
{
ViewerRemoteProcessChooser *chooser =
ViewerRemoteProcessChooser::Instance();
chooser->ClearCache(host);
if (! chooser->SelectProfile(clientAtts,host,false))
if (! chooser->SelectProfile(clientAtts, host, false, profile))
return;
}
......@@ -606,18 +602,7 @@ ViewerServerManager::StartLauncher(const std::string &host,
args.push_back(visitPath);
}
AddArguments(newLauncher, args);
if (ShouldShareBatchJob(host))
{
ViewerRemoteProcessChooser *chooser =
ViewerRemoteProcessChooser::Instance();
chooser->AddProfileArguments(newLauncher, true);
}
else
{
AddProfileArguments(newLauncher, host);
}
newLauncher->AddProfileArguments(profile, shouldShareBatchJob);
TRY