An update will be applied December 9th, between 12PM and 1:00PM EST (UTC -5:00). The site may be slow during that time.

Commit 61dc42a8 authored by whitlocb's avatar whitlocb
Browse files

improved state object logging, added visit -protocol.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@2609 18c085ea-50e0-402c-830e-de6fd14e8384
parent 599e6876
......@@ -62,6 +62,9 @@ $0 = shift @ARGV;
# Brad Whitlock, Tue Sep 19 17:48:12 PST 2006
# Added -mpeg2encode, -composite, -transition.
#
# Brad Whitlock, Mon Dec 10 14:01:54 PST 2007
# Added -protocol.
#
###############################################################################
......@@ -171,6 +174,10 @@ while (scalar(@ARGV) > 0) {
{
$progname = "visit_transition";
}
elsif ($arg eq "-protocol")
{
$progname = "visitprotocol";
}
else
{
push @visitargs, $arg;
......
......@@ -243,6 +243,9 @@ $0 = shift @ARGV;
# Hank Childs, Fri Dec 7 09:14:57 PST 2007
# Added -info-dump to -fullhelp message.
#
# Brad Whitlock, Mon Dec 10 14:05:43 PST 2007
# Added -protocol to the -fullhelp message.
#
###############################################################################
use POSIX qw(ceil);
......@@ -602,6 +605,9 @@ $fullusage = "$usage
-numrestarts <#> Number of attempts to restart a failed engine.
-quiet Don't print the Running message.
-protocol Print the definitions of the state objects that
comprise the VisIt protocol so they can be compared
against the values on other computers.
";
# Get our location
......
......@@ -315,6 +315,9 @@
# Hank Childs, Wed Oct 17 08:39:39 PDT 2007
# Improve existence test. Also cut down on error messages from strip.
#
# Brad Whitlock, Mon Dec 10 14:19:45 PST 2007
# Added visitprotocol.
#
#------------------------------------------------------------------------------
set DataFiles = "TRUE"
......@@ -868,6 +871,8 @@ cp $VisItDir/bin/movietemplates/*.py $bindir/movietemplates
cp $VisItDir/bin/movietemplates/*.{bmp,jpg,gif,tif} $bindir/movietemplates
# Copy the visitdiff script
cp $VisItDir/bin/visitdiff.py $bindir
# Copy the visitprotocol program.
cp $VisItDir/exe/visitprotocol $bindir
#
# Make symlinks for the programs
......
......@@ -57,6 +57,9 @@
// Brad Whitlock, Thu Mar 11 12:47:34 PDT 2004
// Added KeepAliveRPC.
//
// Brad Whitlock, Fri Dec 7 16:50:02 PST 2007
// Added rpcSetup flag.
//
// ****************************************************************************
RemoteProxyBase::RemoteProxyBase(const std::string &compName) :
......@@ -67,6 +70,7 @@ RemoteProxyBase::RemoteProxyBase(const std::string &compName) :
nWrite = nRead = 1;
progressCallback = 0;
progressCallbackData = 0;
rpcSetup = false;
}
// ****************************************************************************
......@@ -115,6 +119,9 @@ RemoteProxyBase::~RemoteProxyBase()
// Jeremy Meredith, Thu May 24 10:20:57 EDT 2007
// Added SSH tunneling argument; pass it along to RemoteProcess::Open.
//
// Brad Whitlock, Fri Dec 7 16:50:17 PST 2007
// Moved RPC creation into the SetupAllRPCs method.
//
// ****************************************************************************
void
......@@ -162,13 +169,11 @@ RemoteProxyBase::Create(const std::string &hostName,
//
xfer.SetOutputConnection(component->GetReadConnection());
xfer.SetInputConnection(component->GetWriteConnection());
xfer.Add(&quitRPC);
xfer.Add(&keepAliveRPC);
//
// Set up the RPC's for the remote component.
// Set up the RPCs
//
SetupComponentRPCs();
SetupAllRPCs();
//
// List the objects that were hooked up.
......@@ -176,6 +181,61 @@ RemoteProxyBase::Create(const std::string &hostName,
xfer.ListObjects();
}
// ****************************************************************************
// Method: RemoteProxyBase::SetupAllRPCs
//
// Purpose:
// Sets up all of the RPCs.
//
// Programmer: Brad Whitlock
// Creation: Fri Dec 7 16:50:46 PST 2007
//
// Modifications:
//
// ****************************************************************************
void
RemoteProxyBase::SetupAllRPCs()
{
if(!rpcSetup)
{
xfer.Add(&quitRPC);
xfer.Add(&keepAliveRPC);
//
// Set up the RPC's for the remote component.
//
SetupComponentRPCs();
rpcSetup = true;
}
}
// ****************************************************************************
// Method: RemoteProxyBase::GetXfer
//
// Purpose:
// Return a reference to Xfer
//
// Arguments:
//
// Returns: A reference to Xfer.
//
// Note: This method has the side-effect of setting up the RPCs.
//
// Programmer: Brad Whitlock
// Creation: Fri Dec 7 16:57:38 PST 2007
//
// Modifications:
//
// ****************************************************************************
const Xfer &
RemoteProxyBase::GetXfer()
{
SetupAllRPCs();
return xfer;
}
// ****************************************************************************
// Method: RemoteProxyBase::Close
//
......
......@@ -83,6 +83,9 @@ class RemoteProcess;
// Brad Whitlock, Wed Nov 21 11:41:52 PST 2007
// Added methods to access the RemoteProcess's connections.
//
// Brad Whitlock, Fri Dec 7 16:58:33 PST 2007
// Added SetupAllRPCs and GetXfer.
//
// ****************************************************************************
class PROXYBASE_API RemoteProxyBase
......@@ -116,7 +119,11 @@ public:
Connection *GetReadConnection(int i=0) const;
Connection *GetWriteConnection(int i=0) const;
// This method should rarely need to be used.
const Xfer &GetXfer();
protected:
void SetupAllRPCs();
virtual void SetupComponentRPCs() = 0;
std::string GetVisItString() const;
virtual void AddExtraArguments();
......@@ -124,6 +131,7 @@ protected:
std::string componentName;
RemoteProcess *component;
Xfer xfer;
bool rpcSetup;
QuitRPC quitRPC;
KeepAliveRPC keepAliveRPC;
......
......@@ -2413,10 +2413,86 @@ AttributeGroup::GetFieldType(int index) const
return FieldType_unknown;
}
// ****************************************************************************
// Method: AttributeGroup::GetFieldTypeName
//
// Purpose:
// Returns the field type name based on information available in the type map.
//
// Arguments:
// index : The index of the field type name to retrieve.
//
// Returns: The name of the type.
//
// Note: This base implementation does not account for types such as
// line width, scale mode, etc that are built on top of
// regular AttributeGroup field types. We provide this method
// for objects that did not provide a GetFieldTypeName method.
//
// Programmer: Brad Whitlock
// Creation: Fri Dec 7 15:58:47 PST 2007
//
// Modifications:
//
// ****************************************************************************
std::string
AttributeGroup::GetFieldTypeName(int index) const
{
return "<UNKNOWN type>";
static const char *fieldTypeNames[] = {
"none", "char", "unsigned char", "int", "long", "float", "double", "string", "att", "bool",
"char[%d]", "unsigned char[%d]", "int[%d]", "long[%d]", "float[%d]", "double[%d]", "string[%d]", "att", "bool[%d]",
"charVector", "unsignedCharVector", "intVector", "longVector", "floatVector", "doubleVector", "stringVector", "attVector", "boolVector"
};
std::string retval("<UNKNOWN type>");
if(index >= 0 && index < typeMap.size())
{
// Get around calling some non-const methods for now.
AttributeGroup *THIS = const_cast<AttributeGroup *>(this);
if(typeMap[index].typeCode == msgTypeAttributeGroup)
{
THIS->SelectAll();
retval = std::string(fieldTypeNames[typeMap[index].typeCode]);
AttributeGroup *s = (AttributeGroup *)typeMap[index].address;
if(s != 0)
{
retval += ",";
retval += s->TypeName();
}
}
else if(typeMap[index].typeCode == msgTypeListAttributeGroup ||
typeMap[index].typeCode == msgTypeVectorAttributeGroup)
{
retval = std::string(fieldTypeNames[typeMap[index].typeCode]);
AttributeGroup *s = THIS->CreateSubAttributeGroup(index);
if(s != 0)
{
retval += ",";
retval += s->TypeName();
delete s;
}
if(typeMap[index].typeCode == msgTypeListAttributeGroup)
{
char arr[100];
THIS->SelectAll();
sprintf(arr, "[%d]", typeMap[index].length);
retval += arr;
}
}
else if(typeMap[index].typeCode >= msgTypeListChar &&
typeMap[index].typeCode <= msgTypeListBool)
{
char tname[100];
THIS->SelectAll();
sprintf(tname, fieldTypeNames[typeMap[index].typeCode], typeMap[index].length);
retval = std::string(tname);
}
else
retval = std::string(fieldTypeNames[typeMap[index].typeCode]);
}
return retval;
}
bool
......
......@@ -167,3 +167,22 @@ KeepAliveRPC::GetValue() const
{
return value;
}
// ****************************************************************************
// Method: KeepAliveRPC::TypeName
//
// Purpose:
// Returns the RPC name.
//
// Programmer: Brad Whitlock
// Creation: Fri Dec 7 11:09:23 PST 2007
//
// Modifications:
//
// ****************************************************************************
const std::string
KeepAliveRPC::TypeName() const
{
return "KeepAliveRPC";
}
......@@ -53,6 +53,8 @@
// Creation: Thu Mar 11 12:32:22 PDT 2004
//
// Modifications:
// Brad Whitlock, Fri Dec 7 11:55:07 PST 2007
// Added TypeName override.
//
// ****************************************************************************
......@@ -74,6 +76,7 @@ public:
// Property getting methods
int GetValue() const;
virtual const std::string TypeName() const;
private:
int value;
};
......
......@@ -163,3 +163,22 @@ QuitRPC::GetQuit() const
{
return quit;
}
// ****************************************************************************
// Method: QuitRPC::TypeName
//
// Purpose:
// Returns the RPC name.
//
// Programmer: Brad Whitlock
// Creation: Fri Dec 7 11:09:23 PST 2007
//
// Modifications:
//
// ****************************************************************************
const std::string
QuitRPC::TypeName() const
{
return "QuitRPC";
}
......@@ -55,6 +55,9 @@
// Brad Whitlock, Thu Apr 24 10:23:39 PDT 2003
// I made it be nonblocking.
//
// Brad Whitlock, Fri Dec 7 11:52:21 PST 2007
// Added TypeName override.
//
// ****************************************************************************
class STATE_API QuitRPC : public NonBlockingRPC
......@@ -75,6 +78,7 @@ public:
// Property getting methods
bool GetQuit() const;
virtual const std::string TypeName() const;
private:
bool quit;
};
......
......@@ -47,7 +47,8 @@ VisItRPC::RPCReply::RPCReply(int s, AttributeSubject *d)
status(s),
message(""),
type(""),
data(d)
data(d),
rpcName("")
{
}
......@@ -118,6 +119,19 @@ VisItRPC::RPCReply::GetData()
return data;
}
void
VisItRPC::RPCReply::SetRPCName(const std::string &name)
{
rpcName = name;
}
const std::string
VisItRPC::RPCReply::TypeName() const
{
std::string ret(data ? data->TypeName() :
std::string("VisItRPC::RPCReply"));
return ret + std::string(" (from ") + rpcName + std::string(")");
}
//-----------------------------------------------------------------------------
......@@ -154,6 +168,8 @@ VisItRPC::GetExceptionType() const
VisItRPC::RPCReply *
VisItRPC::GetReply()
{
reply.SetRPCName(TypeName());
return &reply;
}
......
......@@ -48,6 +48,9 @@
// Hank Childs, Thu Feb 8 10:22:45 PST 2007
// Make sure that MaxStageNum is never less than CurStageNum.
//
// Brad Whitlock, Fri Dec 7 11:57:01 PST 2007
// Added TypeName overrides.
//
// ****************************************************************************
class Xfer;
......@@ -89,11 +92,18 @@ public:
void SetData(AttributeSubject *d);
AttributeSubject *GetData();
void SetRPCName(const std::string &);
virtual const std::string TypeName() const;
private:
int status;
std::string message;
std::string type ;
std::string type;
AttributeSubject *data;
// non-transmissible
std::string rpcName;
};
public:
......@@ -112,6 +122,11 @@ public:
void SendError(const std::string &msg);
void SendError(const std::string &msg, const std::string &etype);
void SendWarning(const std::string &msg);
virtual const std::string TypeName() const
{
return "VisItRPC";
}
protected:
virtual void Execute() = 0;
void SendReply(int s, AttributeSubject *d);
......@@ -170,6 +185,11 @@ public:
Select(4,&curStageName);
Select(5,replyData);
};
virtual const std::string TypeName() const
{
return "NonBlockingRPC::CompletionData";
}
};
public:
NonBlockingRPC(const char *fmt, AttributeSubject *d = NULL);
......@@ -191,6 +211,11 @@ public:
void SetCurStageNum(int n) { completion.SetCurStageNumWithoutSending(n); };
void RecvReply();
virtual const std::string TypeName() const
{
return "NonBlockingRPC";
}
protected:
virtual void Execute();
private:
......@@ -206,6 +231,11 @@ public:
BlockingRPC(const char *fmt, AttributeSubject *d=NULL);
virtual ~BlockingRPC();
void SendReply(AttributeSubject *d=NULL);
virtual const std::string TypeName() const
{
return "BlockingRPC";
}
protected:
virtual void Execute();
};
......
......@@ -730,3 +730,54 @@ Xfer::SetupSpecialOpcodeHandler(void (*cb)(int, void *), void *data)
specialOpcodeCallback = cb;
specialOpcodeCallbackData = data;
}
// ****************************************************************************
// Method: Xfer::GetSubject
//
// Purpose:
// Return the i'th subject in the Xfer.
//
// Arguments:
// index : The index of the object to return.
//
// Returns: The pointer to the i'th subject or 0.
//
// Note: This method should almost never need to be used.
//
// Programmer: Brad Whitlock
// Creation: Fri Dec 7 17:03:55 PST 2007
//
// Modifications:
//
// ****************************************************************************
const AttributeSubject *
Xfer::GetSubject(int index) const
{
return (index >= 0 && index < subjectList.size()) ? subjectList[index] : 0;
}
// ****************************************************************************
// Method: Xfer::GetNumSubjects
//
// Purpose:
// Return the number of subjects in the Xfer.
//
// Arguments:
//
// Returns: The number of subjects.
//
// Note: This method should almost never need to be used.
//
// Programmer: Brad Whitlock
// Creation: Fri Dec 7 17:03:55 PST 2007
//
// Modifications:
//
// ****************************************************************************
int
Xfer::GetNumSubjects() const
{
return subjectList.size();
}
......@@ -75,6 +75,9 @@ class VisItRPC;
// Added a method to give access to the buffered input so we can store
// objects directly in it.
//
// Brad Whitlock, Fri Dec 7 17:01:29 PST 2007
// Added methods to get the i'th state object in the Xfer.
//
// ****************************************************************************
class STATE_API Xfer : public SimpleObserver
......@@ -102,6 +105,10 @@ public:
void SetupSpecialOpcodeHandler(void (*cb)(int, void *), void *data);
void ListObjects();
// These should rarely need to be used.
const AttributeSubject *GetSubject(int) const;
int GetNumSubjects() const;
protected:
bool ReadHeader();
int GetNextGuido();
......
......@@ -4066,6 +4066,9 @@ avtDatabaseMetaData::ReplaceForbiddenCharacters(std::vector<char> &badChars,
// Jeremy Meredith, Tue Aug 2 10:45:01 PDT 2005
// Changed the new m.m.d. for point meshes to avoid using a temporary.
//
// Brad Whitlock, Tue Nov 27 15:51:36 PST 2007
// Turn topdim==0 unstructured meshes into point meshes.
//
// ****************************************************************************
void
......@@ -4084,6 +4087,11 @@ avtDatabaseMetaData::Add(avtMeshMetaData *mmd)
tmpmmd->topologicalDimension = 0;
meshes.push_back(tmpmmd);
}
else if (mmd->meshType == AVT_UNSTRUCTURED_MESH && mmd->topologicalDimension == 0)
{
mmd->meshType = AVT_POINT_MESH;
meshes.push_back(mmd);
}
else
{
meshes.push_back(mmd);
......
......@@ -669,6 +669,9 @@ Definition:
// Jeremy Meredith, Tue Aug 2 10:45:01 PDT 2005
// Changed the new m.m.d. for point meshes to avoid using a temporary.
//
// Brad Whitlock, Tue Nov 27 15:51:36 PST 2007
// Turn topdim==0 unstructured meshes into point meshes.
//
// ****************************************************************************
void
......@@ -687,6 +690,11 @@ avtDatabaseMetaData::Add(avtMeshMetaData *mmd)
tmpmmd->topologicalDimension = 0;
meshes.push_back(tmpmmd);
}
else if (mmd->meshType == AVT_UNSTRUCTURED_MESH && mmd->topologicalDimension == 0)
{
mmd->meshType = AVT_POINT_MESH;
meshes.push_back(mmd);
}
else
{
meshes.push_back(mmd);
......
......@@ -18042,6 +18042,7 @@ TOOLS_FILES="tools/Makefile
tools/mpeg2encode/Makefile
tools/mpeg_encode/Makefile
tools/prep/Makefile
tools/protocol/Makefile
tools/silex/Makefile
tools/surfcomp/Makefile
tools/windowmaker/Makefile
......
......@@ -3648,6 +3648,7 @@ TOOLS_FILES="tools/Makefile
tools/mpeg2encode/Makefile
tools/mpeg_encode/Makefile
tools/prep/Makefile
tools/protocol/Makefile
tools/silex/Makefile
tools/surfcomp/Makefile
tools/windowmaker/Makefile
......
......@@ -62,7 +62,7 @@ public:
ClearCacheRPC();
virtual ~ClearCacheRPC();
const std::string TypeName() const { return "ClearCacheRPC";};
virtual const std::string TypeName() const { return "ClearCacheRPC";}
// Invokation methods.
......
......@@ -60,7 +60,7 @@ public:
CloneNetworkRPC();