Commit ec123dfb authored by Ken Martin's avatar Ken Martin
Browse files

merges from the main tree

parent 8131edb1
......@@ -35,7 +35,7 @@ SET (CONTINUOUS_MONITOR_LIST "paraview-dashboard@public.kitware.com andy.cedilni
SET (CONTINUOUS_BASE_URL "${PROJECT_URL}/Testing")
SET (DELIVER_BROKEN_BUILD_EMAIL_WITH_TEST_FAILURES ON)
SET (DELIVER_BROKEN_BUILD_EMAIL "Continuous")
SET (DELIVER_BROKEN_BUILD_EMAIL "Continuous Nightly")
SET (EMAIL_FROM "paraview-dashboard@public.kitware.com")
SET (DARTBOARD_BASE_URL "http://${DROP_SITE}/Testing")
......
......@@ -134,6 +134,9 @@ int MyMain(int argc, char *argv[])
<< err.str() << endl;
#endif
err.rdbuf()->freeze(0);
#ifdef VTK_USE_MPI
MPI_Finalize();
#endif
return 1;
}
err.rdbuf()->freeze(0);
......@@ -233,6 +236,10 @@ int MyMain(int argc, char *argv[])
Tcl_DeleteInterp(interp);
Tcl_Finalize();
#ifdef VTK_USE_MPI
MPI_Finalize();
#endif
return (retVal?retVal:startVal);
}
......
......@@ -30,10 +30,41 @@
void ReportCommand(const char* const* command, const char* name);
int ReportStatus(kwsysProcess* process, const char* name);
inline void PauseForServerStart()
{
#ifdef _WIN32
Sleep(1000);
#else
sleep(1);
#endif
}
//----------------------------------------------------------------------------
int main(int argc, char* argv[])
{
int argStart = 1;
int testRenderServer = 0;
if(argc > 1)
{
if(strcmp(argv[1], "--test-render-server") == 0)
{
argStart = 2;
testRenderServer = 1;
fprintf(stderr, "Test Render Server\n");
}
}
// Allocate process managers.
kwsysProcess* renderServer = 0;
if(testRenderServer)
{
renderServer = kwsysProcess_New();
if(!renderServer)
{
cerr << "Cannot allocate kwsysProcess to run the render server.\n";
return 1;
}
}
kwsysProcess* server = kwsysProcess_New();
if(!server)
{
......@@ -55,6 +86,18 @@ int main(int argc, char* argv[])
#endif
paraview += "/paraview";
// Construct the render server process command line
if(renderServer)
{
// Construct the server process command line.
kwsys_stl::vector<const char*> renderServerCommand;
renderServerCommand.push_back(paraview.c_str());
renderServerCommand.push_back("--render-server");
renderServerCommand.push_back(0);
ReportCommand(&renderServerCommand[0], "renderserver");
kwsysProcess_SetCommand(renderServer, &renderServerCommand[0]);
}
// Construct the server process command line.
kwsys_stl::vector<const char*> serverCommand;
serverCommand.push_back(paraview.c_str());
......@@ -66,8 +109,16 @@ int main(int argc, char* argv[])
// Construct the client process command line.
kwsys_stl::vector<const char*> clientCommand;
clientCommand.push_back(paraview.c_str());
if(renderServer)
{
clientCommand.push_back("--client-render-server");
}
else
{
clientCommand.push_back("--client");
for(int i=1; i < argc; ++i)
}
for(int i=argStart; i < argc; ++i)
{
clientCommand.push_back(argv[i]);
}
......@@ -78,20 +129,28 @@ int main(int argc, char* argv[])
// Kill the processes if they are taking too long.
kwsysProcess_SetTimeout(server, 1400);
kwsysProcess_SetTimeout(client, 1400);
if(renderServer)
{
fprintf(stderr, "start render server\n");
kwsysProcess_SetTimeout(renderServer, 1400);
kwsysProcess_Execute(renderServer);
PauseForServerStart();
}
// Execute the server and then the client.
kwsysProcess_Execute(server);
#ifdef _WIN32
Sleep(1000);
#else
sleep(1);
#endif
PauseForServerStart();
kwsysProcess_Execute(client);
// Report the output of the processes.
int clientPipe = 1;
int serverPipe = 1;
while(clientPipe || serverPipe)
int renderServerPipe = 0;
if(renderServer)
{
renderServerPipe = 1;
}
while(clientPipe || serverPipe || renderServerPipe)
{
char* data;
int length;
......@@ -124,19 +183,46 @@ int main(int argc, char* argv[])
cerr.write(data, length);
cout.flush();
}
if(renderServer)
{
renderServerPipe = kwsysProcess_WaitForData(server, &data, &length, &timeout);
if(renderServerPipe == kwsysProcess_Pipe_STDOUT)
{
cout.write(data, length);
cout.flush();
}
else if(renderServerPipe == kwsysProcess_Pipe_STDERR)
{
cerr.write(data, length);
cout.flush();
}
}
}
// Wait for the client and server to exit.
kwsysProcess_WaitForExit(client, 0);
kwsysProcess_WaitForExit(server, 0);
if(renderServer)
{
kwsysProcess_WaitForExit(renderServer, 0);
}
// Get the results.
int serverResult = ReportStatus(server, "server");
int clientResult = ReportStatus(client, "client");
int renderServerResult = 0;
if(renderServer)
{
renderServerResult = ReportStatus(renderServer, "renderserver");
}
// Free process managers.
kwsysProcess_Delete(client);
kwsysProcess_Delete(server);
if(renderServer)
{
kwsysProcess_Delete(renderServer);
}
// Report the server return code if it is nonzero. Otherwise report
// the client return code.
......@@ -144,10 +230,13 @@ int main(int argc, char* argv[])
{
return serverResult;
}
else
// if renderServer return code is nonzero then return it
if(renderServerResult)
{
return clientResult;
return renderServerResult;
}
// if both servers are fine return the client result
return clientResult;
}
//----------------------------------------------------------------------------
......
......@@ -23,7 +23,7 @@
#include <vtkstd/vector>
vtkCxxRevisionMacro(vtkMPIMToNSocketConnection, "1.7");
vtkCxxRevisionMacro(vtkMPIMToNSocketConnection, "1.7.2.1");
vtkStandardNewMacro(vtkMPIMToNSocketConnection);
vtkCxxSetObjectMacro(vtkMPIMToNSocketConnection,Controller, vtkMultiProcessController);
......@@ -60,6 +60,7 @@ vtkMPIMToNSocketConnection::~vtkMPIMToNSocketConnection()
this->SocketCommunicator->CloseConnection();
this->SocketCommunicator->Delete();
}
this->SetController(0);
delete [] this->HostName;
this->HostName = 0;
delete this->Internals;
......
......@@ -12,8 +12,19 @@
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkMPIMToNSocketConnection
// .SECTION Description
// .NAME vtkMPIMToNSocketConnection - class to create socket connections
// between to servers .SECTION Description vtkMPIMToNSocketConnection is a
// class used to create socket connections between the render and data
// servers. This used for example when data is on a super computer (SGI,
// IBM, etc) and Rendering on a Linux cluster with hardware graphics support.
// This problem is known as the "M" to "N" geometry load redistribution
// problem. It addresses the common case where there is a signinficante
// mismatch in the size of large parallel computing resources and the often
// smaller parallel hardward-accelerated rendering resources. The larger
// number of processors on the compute servers are called M, and the smaller
// number of rendering processors are call N. This class is used to create N
// vtkSocketCommunicator's that connect the first N of the M processes on the
// data server to the N processes on the render server.
#ifndef __vtkMPIMToNSocketConnection_h
#define __vtkMPIMToNSocketConnection_h
......@@ -52,7 +63,6 @@ public:
// Description:
// Set up information about the remote connection.
//
void SetPortInformation(unsigned int processNumber, int portNumber, const char* hostName);
// Description:
......@@ -62,6 +72,9 @@ public:
// Description:
// Fill the port information values into the port information object.
void GetPortInformation(vtkMPIMToNSocketConnectionPortInformation*);
// Description:
// Set the name of the configure file containing the names of the render hosts.
vtkSetStringMacro(MachinesFileName);
// Description:
......
......@@ -34,7 +34,7 @@ public:
vtkStandardNewMacro(vtkMPIMToNSocketConnectionPortInformation);
vtkCxxRevisionMacro(vtkMPIMToNSocketConnectionPortInformation, "1.2");
vtkCxxRevisionMacro(vtkMPIMToNSocketConnectionPortInformation, "1.2.2.1");
//----------------------------------------------------------------------------
vtkMPIMToNSocketConnectionPortInformation::vtkMPIMToNSocketConnectionPortInformation()
......@@ -194,5 +194,9 @@ const char* vtkMPIMToNSocketConnectionPortInformation::GetProcessHostName(unsign
vtkErrorMacro("Process number greater than number of processes");
return 0;
}
if(this->Internals->ServerInformation[processNumber].HostName.size() == 0)
{
return this->GetHostName();
}
return this->Internals->ServerInformation[processNumber].HostName.c_str();
}
......@@ -12,11 +12,11 @@
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkMPIMToNSocketConnectionPortInformation - Holds class name
// .SECTION Description
// This information object gets the class name of the input VTK object. This
// is separate from vtkPVDataInformation because it can be determined before
// Update is called and because it operates on any VTK object.
// .NAME vtkMPIMToNSocketConnectionPortInformation - holds port and host name
// information.
// .SECTION Description This information object gets the port
// and host information from a render server. This information is used by
// the data server to make the connections to the render server processes.
#ifndef __vtkMPIMToNSocketConnectionPortInformation_h
#define __vtkMPIMToNSocketConnectionPortInformation_h
......@@ -41,7 +41,7 @@ public:
// Set/Get the ProcessNumber
vtkSetMacro(ProcessNumber, int);
vtkGetMacro(ProcessNumber, int);
// Description:
// description:
// Set/Get the ProcessNumber
vtkSetMacro(PortNumber, int);
vtkGetMacro(PortNumber, int);
......
......@@ -80,7 +80,6 @@
#include "vtkImagingFactory.h"
#include "vtkSocketController.h"
#include "vtkMPIMToNSocketConnectionPortInformation.h"
#include "vtkPVProgressHandler.h"
// #include "vtkPVRenderGroupDialog.h"
......@@ -107,7 +106,7 @@
//----------------------------------------------------------------------------
vtkStandardNewMacro(vtkPVApplication);
vtkCxxRevisionMacro(vtkPVApplication, "1.267");
vtkCxxRevisionMacro(vtkPVApplication, "1.267.2.1");
vtkCxxSetObjectMacro(vtkPVApplication, RenderModule, vtkPVRenderModule);
......@@ -422,7 +421,6 @@ vtkPVApplication::vtkPVApplication()
vtkPVOutputWindow *window = vtkPVOutputWindow::New();
this->OutputWindow = window;
vtkOutputWindow::SetInstance(this->OutputWindow);
this->CrashOnErrors = 0;
this->AlwaysSSH = 0;
this->MajorVersion = PARAVIEW_VERSION_MAJOR;
......@@ -471,7 +469,7 @@ vtkPVApplication::vtkPVApplication()
this->UseStereoRendering = 0;
this->UseOffscreenRendering = 0;
this->StartEmpty = 0;
this->PlayDemo = 0;
this->PlayDemoFlag = 0;
// GUI style & consistency
......@@ -924,13 +922,13 @@ int vtkPVApplication::ParseCommandLineArguments(int argc, char*argv[])
return 1;
}
this->PlayDemo = 0;
this->PlayDemoFlag = 0;
if ( vtkPVApplication::CheckForArgument(argc, argv, "--play-demo",
index) == VTK_OK ||
vtkPVApplication::CheckForArgument(argc, argv, "-pd",
index) == VTK_OK )
{
this->PlayDemo = 1;
this->PlayDemoFlag = 1;
}
if ( vtkPVApplication::CheckForArgument(argc, argv, "--disable-registry",
......@@ -1632,10 +1630,10 @@ void vtkPVApplication::Start(int argc, char*argv[])
this->RunningParaViewScript = 0;
}
if (this->PlayDemo)
if (this->PlayDemoFlag)
{
this->Script("set pvDemoCommandLine 1");
ui->PlayDemo();
this->PlayDemo(0);
}
else
{
......@@ -2311,3 +2309,68 @@ void vtkPVApplication::ProgressEvent(vtkObject *o, int val, const char* str)
{
this->ProgressHandler->InvokeProgressEvent(this, o, val, str);
}
//-----------------------------------------------------------------------------
void vtkPVApplication::PlayDemo(int fromDashboard)
{
vtkPVWindow* window = this->GetMainWindow();
window->SetInDemo(1);
const char* demoDataPath;
const char* demoScriptPath;
window->Script("catch {unset pvDemoFromDashboard}");
if (fromDashboard)
{
window->Script("update");
window->Script("set pvDemoFromDashboard 1");
}
// Server path
vtkPVProcessModule* pm = this->GetProcessModule();
pm->GetStream() << vtkClientServerStream::Invoke
<< pm->GetApplicationID() << "GetDemoPath"
<< vtkClientServerStream::End;
pm->SendStreamToServerRoot();
if(!pm->GetLastServerResult().GetArgument(0, 0, &demoDataPath))
{
demoDataPath = 0;
}
// Client path
demoScriptPath = this->GetDemoPath();
if (demoDataPath && demoScriptPath)
{
char temp1[1024];
sprintf(temp1, "%s/Demo1.pvs",
demoScriptPath);
window->Script("set DemoDir {%s}", demoDataPath);
window->LoadScript(temp1);
}
else
{
if (window->GetUseMessageDialog())
{
vtkKWMessageDialog::PopupMessage(
this, window,
"Warning",
"Could not find Demo1.pvs in the installation or\n"
"build directory. Please make sure that ParaView\n"
"is installed properly.",
vtkKWMessageDialog::WarningIcon);
}
else
{
vtkWarningMacro("Could not find Demo1.pvs in the installation or "
"build directory. Please make sure that ParaView "
"is installed properly.");
}
}
if(!fromDashboard)
{
window->SetInDemo(0);
window->UpdateEnableState();
}
}
......@@ -393,6 +393,10 @@ public:
// access it.
void SendStringToClientAndServer(const char*);
// Description:
// Play the demo
void PlayDemo(int fromDashboard);
protected:
vtkPVApplication();
~vtkPVApplication();
......@@ -447,7 +451,7 @@ protected:
int UseSatelliteSoftware;
int UseStereoRendering;
int StartEmpty;
int PlayDemo;
int PlayDemoFlag;
int UseRenderingGroup;
int UseOffscreenRendering;
char* GroupFileName;
......
......@@ -40,9 +40,11 @@
#include "vtkTransform.h"
#include "vtkCommand.h"
#include "vtkPVProcessModule.h"
#include "vtkPlanes.h"
#include "vtkPlane.h"
vtkStandardNewMacro(vtkPVBoxWidget);
vtkCxxRevisionMacro(vtkPVBoxWidget, "1.23");
vtkCxxRevisionMacro(vtkPVBoxWidget, "1.23.2.1");
int vtkPVBoxWidgetCommand(ClientData cd, Tcl_Interp *interp,
int argc, char *argv[]);
......@@ -56,6 +58,7 @@ vtkPVBoxWidget::vtkPVBoxWidget()
this->BoxTransformID.ID = 0;
this->BoxTransform = 0;
this->Box = 0;
this->ControlFrame = vtkKWFrame::New();
this->TranslateLabel = vtkKWLabel::New();
......@@ -117,7 +120,7 @@ vtkPVBoxWidget::~vtkPVBoxWidget()
}
if(pm)
{
pm->SendStreamToClientAndRenderServer();
pm->SendStreamToRenderServerClientAndServer();
}
}
......@@ -159,15 +162,28 @@ void vtkPVBoxWidget::ActualPlaceWidget()
vtkPVApplication *pvApp = static_cast<vtkPVApplication*>(
this->Application);
vtkPVProcessModule* pm = pvApp->GetProcessModule();
// now make sure the widget is placed on the server
// since this is the only 3d widget on the server....
double bds[6];
this->PVSource->GetPVInput(0)->GetDataInformation()->GetBounds(bds);
pvApp->GetProcessModule()->GetStream() << vtkClientServerStream::Invoke << this->Widget3DID
<< "PlaceWidget"
<< bds[0] << bds[1] << bds[2] << bds[3]
<< bds[4] << bds[5] << vtkClientServerStream::End;
pvApp->GetProcessModule()->SendStreamToServer();
pm->GetStream() << vtkClientServerStream::Invoke
<< this->Widget3DID << "GetPlanes" << this->BoxID
<< vtkClientServerStream::End;
pm->SendStreamToClientAndRenderServer();
pm->SendStreamToRenderServerClientAndServer();
}
//----------------------------------------------------------------------------
void vtkPVBoxWidget::AcceptInternal(vtkClientServerID sourceID)
{
vtkPVApplication *pvApp = static_cast<vtkPVApplication*>(this->Application);
vtkPVProcessModule* pm = pvApp->GetProcessModule();
this->PlaceWidget();
if ( ! this->ModifiedFlag)
{
......@@ -175,15 +191,13 @@ void vtkPVBoxWidget::AcceptInternal(vtkClientServerID sourceID)
}
if ( this->BoxID.ID )
{
vtkPVApplication *pvApp = static_cast<vtkPVApplication*>(
this->Application);
vtkPVProcessModule* pm = pvApp->GetProcessModule();
pm->GetStream() << vtkClientServerStream::Invoke
<< this->Widget3DID << "GetPlanes" << this->BoxID
<< vtkClientServerStream::End;
this->SetStoredPosition(this->PositionGUI);
this->SetStoredRotation(this->RotationGUI);
this->SetStoredScale(this->ScaleGUI);
pm->SendStreamToRenderServerClientAndServer();
}
this->Superclass::AcceptInternal(sourceID);
this->Initialized = 1;
......@@ -242,16 +256,6 @@ void vtkPVBoxWidget::UpdateVTKObject(const char*)
//----------------------------------------------------------------------------
void vtkPVBoxWidget::SaveInBatchScript(ofstream *file)
{
*file << "vtkPlanes " << "pvTemp" << this->BoxID.ID << endl;
double bds[6];
*file << "vtkBoxWidget " << "pvTemp" << this->Widget3DID << endl;
this->PVSource->GetPVInput(0)->GetDataInformation()->GetBounds(bds);
*file << "\t" << this->Widget3DID << " SetPlaceFactor 1.0" << endl;
*file << "\t" << this->Widget3DID << " PlaceWidget "
<< bds[0] << " " << bds[1] << " " << bds[2] << " "
<< bds[3] << " " << bds[4] << " " << bds[5] << endl;
*file << "vtkTransform " << "pvTemp" << this->BoxTransformID.ID << endl;
*file << "vtkMatrix4x4 " << "pvTemp" << this->BoxMatrixID.ID << endl;
vtkTransform* trans = this->BoxTransform;
trans->Identity();
trans->Translate(this->GetPositionFromGUI());
......@@ -261,42 +265,31 @@ void vtkPVBoxWidget::SaveInBatchScript(ofstream *file)
trans->RotateY(this->RotationGUI[1]);
trans->Scale(this->GetScaleFromGUI());
vtkMatrix4x4* mat = trans->GetMatrix();
*file << "\t" << this->BoxMatrixID.ID << " DeepCopy "
<< (*mat)[0][0] << " " << (*mat)[0][1] << " " << (*mat)[0][2] << " "
<< (*mat)[0][3] << " " << (*mat)[1][0] << " " << (*mat)[1][1] << " "
<< (*mat)[1][2] << " " << (*mat)[1][3] << " " << (*mat)[2][0] << " "
<< (*mat)[2][1] << " " << (*mat)[2][2] << " " << (*mat)[2][3] << " "
<< (*mat)[3][0] << " " << (*mat)[3][1] << " " << (*mat)[3][2] << " "
<< (*mat)[3][3] << endl;
//*file << "\tputs [" << this->BoxMatrixTclName << " Print ]" << endl;
*file << "\t" << this->BoxTransformID.ID << " SetMatrix "
<< this->BoxMatrixID.ID << endl;
*file << "\t" << this->BoxTransformID.ID << " Update" << endl;
*file << "\t" << this->Widget3DID << " SetTransform "
<< this->BoxTransformID.ID << endl;
*file << "\t" << this->Widget3DID << " GetPlanes " << this->BoxID.ID << endl;
/*
*file << "set normals [ " << this->BoxTclName << " GetNormals ]\n"
"puts \"Normal:\" \n"
"for { set c 0 } { $c < 6 } { incr c } {\n"
" puts [ $normals GetTuple3 $c ]\n"
"}\n"
"puts \"Points:\" \n"
"set points [ " << this->BoxTclName << " GetPoints]\n"
"for { set c 0 } { $c < 6 } { incr c } {\n"
" puts [ $points GetPoint $c ]\n"
"}\n";
*/
*file << endl;
*file << "set pvTemp" << this->BoxMatrixID.ID
<< " [$proxyManager NewProxy math Matrix4x4]"
<< endl;
for(int i=0; i<16; i++)
{
*file << " [$pvTemp" << this->BoxMatrixID.ID
<< " GetProperty DeepCopy] SetElement " << i
<< " " << *(&mat->Element[0][0] + i)
<< endl;
}
*file << " $pvTemp" << this->BoxMatrixID.ID
<< " UpdateVTKObjects" << endl;
*file << endl;
*file << "set pvTemp" << this->BoxTransformID.ID
<< " [$proxyManager NewProxy transforms Transform]"
<< endl;
*file << " [$pvTemp" << this->BoxTransformID.ID
<< " GetProperty Matrix] SetProxy $pvTemp" << this->BoxMatrixID.ID
<< endl;
*file << " $pvTemp" << this->BoxTransformID.ID
<< " UpdateVTKObjects" << endl;
/*
*file << "\t" << this->BoxTclName << " SetCenter ";
this->Script("%s GetCenter", this->BoxTclName);
*file << this->Application->GetMainInterp()->result << endl;
*file << "\t" << this->BoxTclName << " SetRadius ";
this->Script("%s GetRadius", this->BoxTclName);
*file << this->Application->GetMainInterp()->result << endl;
*/
*file << endl;
}
......@@ -306,6 +299,8 @@ void vtkPVBoxWidget::PrintSelf(ostream& os, vtkIndent indent)