Commit c80a2b13 authored by Andrew Bauer's avatar Andrew Bauer

Adding ParaView GUI --live=<port> command line option

This option will allow the GUI to automatically connect the server
to the requested Catalyst simulation at the passed in port. The
CatalystLivePause tests were changed to connect using this command
line option instead of the GUI menu option. Also, QMessageBox automatically
closes if ParaView connects to the simulation via Live.
parent b679a25f
......@@ -225,6 +225,48 @@ if (NOT APPLE)
${CMAKE_CURRENT_SOURCE_DIR}/HistogramSelection.xml)
endif()
macro(ADD_CATALYST_LIVE_TEST test_name duration command_line_connect_command)
# These tests are too complex to run in parallel.
set (CATALYST_SIMULATION CatalystWaveletDriver.py)
set (INSITU_SCRIPT CatalystWaveletCoprocessing)
set ("${test_name}_FORCE_SERIAL" TRUE)
add_pv_test("pv" "_DISABLE_C"
COMMAND
--script-ignore-output-errors --script $<TARGET_FILE:pvbatch> -sym
${CMAKE_CURRENT_SOURCE_DIR}/${CATALYST_SIMULATION}
${INSITU_SCRIPT} "${duration}"
--client ${CLIENT_EXECUTABLE}
--enable-bt
${command_line_connect_command}
-dr
--test-directory=${PARAVIEW_TEST_DIR}
BASELINE_DIR ${PARAVIEW_TEST_BASELINE_DIR}
TEST_SCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/${test_name}.xml
EXTRA_LABELS "CATALYST")
add_pv_test(pvcs "_DISABLE_CS"
COMMAND
--script-np 5 --script-ignore-output-errors
--script $<TARGET_FILE:pvbatch> -sym
${CMAKE_CURRENT_SOURCE_DIR}/${CATALYST_SIMULATION}
${INSITU_SCRIPT} "${duration}"
--server $<TARGET_FILE:pvserver>
--enable-bt
--client ${CLIENT_EXECUTABLE}
--enable-bt
${command_line_connect_command}
-dr
--test-directory=${PARAVIEW_TEST_DIR}
BASELINE_DIR ${PARAVIEW_TEST_BASELINE_DIR}
TEST_SCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/${test_name}.xml
EXTRA_LABELS "CATALYST")
endmacro(ADD_CATALYST_LIVE_TEST)
# Catalyst tests
# ----------------------------------------------------------------------
if(PARAVIEW_ENABLE_CATALYST AND PARAVIEW_ENABLE_PYTHON)
......@@ -236,50 +278,11 @@ if(PARAVIEW_ENABLE_CATALYST AND PARAVIEW_ENABLE_PYTHON)
TEST_SCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/CatalystCinemaGUI.xml )
set_tests_properties(pv.CatalystCinemaGUI PROPERTIES RUN_SERIAL ON LABELS "PARAVIEW;CATALYST")
set (catalyst_live_tests
CatalystLiveSetBreakpoint
CatalystLivePause)
set (CATALYST_SIMULATION CatalystWaveletDriver.py)
set (INSITU_SCRIPT CatalystWaveletCoprocessing)
# Test-specific parameters
set (CatalystLiveSetBreakpoint_DURATION 222)
set (CatalystLivePause_DURATION 80)
foreach (tname ${catalyst_live_tests})
# These tests are too complex to run in parallel.
set ("${tname}_FORCE_SERIAL" TRUE)
add_pv_test("pv" "_DISABLE_C"
COMMAND
--script-ignore-output-errors --script $<TARGET_FILE:pvbatch> -sym
${CMAKE_CURRENT_SOURCE_DIR}/${CATALYST_SIMULATION}
${INSITU_SCRIPT} "${${tname}_DURATION}"
--client ${CLIENT_EXECUTABLE}
--enable-bt
-dr
--test-directory=${PARAVIEW_TEST_DIR}
BASELINE_DIR ${PARAVIEW_TEST_BASELINE_DIR}
TEST_SCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/${tname}.xml
EXTRA_LABELS "CATALYST")
add_catalyst_live_test(CatalystLiveSetBreakpoint 222 "")
# the CatalystLivePause test uses the --live=22222 command line option to automatically
# connect to a running simulation on port 22222
add_catalyst_live_test(CatalystLivePause 80 "--live=22222")
add_pv_test(pvcs "_DISABLE_CS"
COMMAND
--script-np 5 --script-ignore-output-errors
--script $<TARGET_FILE:pvbatch> -sym
${CMAKE_CURRENT_SOURCE_DIR}/${CATALYST_SIMULATION}
${INSITU_SCRIPT} "${${tname}_DURATION}"
--server $<TARGET_FILE:pvserver>
--enable-bt
--client ${CLIENT_EXECUTABLE}
--enable-bt
-dr
--test-directory=${PARAVIEW_TEST_DIR}
BASELINE_DIR ${PARAVIEW_TEST_BASELINE_DIR}
TEST_SCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/${tname}.xml
EXTRA_LABELS "CATALYST")
endforeach()
endif()
if (PARAVIEW_ENABLE_XDMF2 AND NOT PARAVIEW_ENABLE_XDMF3)
......
<?xml version="1.0" ?>
<pqevents>
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menu_Catalyst" />
<pqevent object="pqClientMainWindow/menubar/menu_Catalyst" command="activate" arguments="actionCatalystConnect" />
<pqevent object="pqClientMainWindow/1QInputDialog0/1QDialogButtonBox0/1QPushButton0" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/1QMessageBox0/qt_msgbox_buttonbox/1QPushButton0" command="activate" arguments="" />
<!-- wait for Catalyst pipeline to show-up -->
<!-- wait for Catalyst pipeline to show-up -->
<pqevent object="pqClientMainWindow" command="pqLiveInsituManager"
arguments="wait_timestep 5"/>
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mousePress" arguments="1,1,0,12,13,/1:0/0:0/0:1" />
......
......@@ -3,7 +3,6 @@
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menu_Catalyst" />
<pqevent object="pqClientMainWindow/menubar/menu_Catalyst" command="activate" arguments="actionCatalystConnect" />
<pqevent object="pqClientMainWindow/1QInputDialog0/1QDialogButtonBox0/1QPushButton0" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/1QMessageBox0/qt_msgbox_buttonbox/1QPushButton0" command="activate" arguments="" />
<!-- wait for Catalyst pipeline to show-up -->
<pqevent object="pqClientMainWindow" command="pqLiveInsituManager"
......
......@@ -79,6 +79,7 @@ vtkPVOptions::vtkPVOptions()
this->DisableXDisplayTests = 0;
this->ForceOffscreenRendering = 0;
this->ForceOnscreenRendering = 0;
this->CatalystLivePort = -1;
if (this->XMLParser)
{
......@@ -525,4 +526,5 @@ void vtkPVOptions::PrintSelf(ostream& os, vtkIndent indent)
os << indent << "DisableXDisplayTests: " << this->DisableXDisplayTests << endl;
os << indent << "ForceNoMPIInitOnClient: " << this->ForceNoMPIInitOnClient << endl;
os << indent << "ForceMPIInitOnClient: " << this->ForceMPIInitOnClient << endl;
os << indent << "CatalystLivePort: " << this->CatalystLivePort << endl;
}
......@@ -163,6 +163,10 @@ public:
/// Provides access to server-url if specified on the command line.
vtkGetStringMacro(ServerURL);
/// Provides access to the Catalyst Live port if specified on the command line.
/// A value of -1 indicates that no value was set.
vtkGetMacro(CatalystLivePort, int);
//@{
/**
* This is used when user want to open a file at startup
......@@ -320,6 +324,8 @@ protected:
char* TestPlugin; // to load plugins from command line for tests
char* TestPluginPath;
int DisableXDisplayTests;
int
CatalystLivePort; // currently only set through the GUI but may eventually be set in any client
//@}
// inline setters
......
......@@ -38,6 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pqDeleteReaction.h"
#include "pqEventDispatcher.h"
#include "pqFileDialog.h"
#include "pqLiveInsituManager.h"
#include "pqLoadDataReaction.h"
#include "pqLoadStateReaction.h"
#include "pqObjectBuilder.h"
......@@ -198,6 +199,15 @@ void pqCommandLineOptionsBehavior::processCommandLineOptions()
#endif
}
// check if a Catalyst Live port was passed in that we should automatically attempt
// to establish a connection to.
if (options->GetCatalystLivePort() != -1)
{
pqLiveInsituManager* insituManager = pqLiveInsituManager::instance();
insituManager->connect(
pqActiveObjects::instance().activeServer(), options->GetCatalystLivePort());
}
if (options->GetDisableRegistry())
{
// a cout for test playback.
......
......@@ -213,7 +213,7 @@ vtkSMLiveInsituLinkProxy* pqLiveInsituManager::linkProxy(pqServer* insituSession
}
//-----------------------------------------------------------------------------
pqLiveInsituVisualizationManager* pqLiveInsituManager::connect(pqServer* server)
pqLiveInsituVisualizationManager* pqLiveInsituManager::connect(pqServer* server, int portNumber)
{
if (!server)
{
......@@ -226,23 +226,29 @@ pqLiveInsituVisualizationManager* pqLiveInsituManager::connect(pqServer* server)
vtkProcessModule::GetProcessModule()->MultipleSessionsSupportOn();
bool user_ok = false;
int portNumber = QInputDialog::getInt(pqCoreUtilities::mainWidget(), "Catalyst Server Port",
"Enter the port number to accept connections \nfrom Catalyst on:", 22222, 1024, 0x0fffffff, 1,
&user_ok);
if (!user_ok)
if (portNumber == -1)
{
// user cancelled.
return NULL;
portNumber = QInputDialog::getInt(pqCoreUtilities::mainWidget(), "Catalyst Server Port",
"Enter the port number to accept connections \nfrom Catalyst on:", 22222, 1024, 0x0fffffff,
1, &user_ok);
if (!user_ok)
{
// user cancelled.
return NULL;
}
}
pqLiveInsituVisualizationManager* mgr =
new pqLiveInsituVisualizationManager(portNumber, server);
QObject::connect(mgr, SIGNAL(insituDisconnected()), this, SLOT(onCatalystDisconnected()));
this->Managers[server] = mgr;
QMessageBox::information(pqCoreUtilities::mainWidget(), "Ready for Catalyst connections",
QMessageBox* mBox = new QMessageBox(QMessageBox::Information, "Ready for Catalyst connections",
QString("Accepting connections from Catalyst Co-Processor \n"
"for live-coprocessing on port %1")
.arg(portNumber));
.arg(portNumber),
QMessageBox::Ok, pqCoreUtilities::mainWidget());
mBox->open();
QObject::connect(mgr, SIGNAL(insituConnected()), mBox, SLOT(close()));
emit connectionInitiated(server);
return mgr;
}
......
......@@ -101,9 +101,10 @@ public:
pqLiveInsituVisualizationManager* managerFromDisplay(pqServer* displaySession);
static pqLiveInsituVisualizationManager* managerFromInsitu(pqServer* insituSession);
/**
* Creates the manager and accept connections from Catalyst
* Creates the manager and accept connections from Catalyst. Can pass in a requested
* portNumber.
*/
pqLiveInsituVisualizationManager* connect(pqServer* displaySession);
pqLiveInsituVisualizationManager* connect(pqServer* displaySession, int portNumber = -1);
double breakpointTime() const { return this->BreakpointTime; }
double breakpointTimeStep() const { return this->BreakpointTimeStep; }
......
......@@ -142,6 +142,8 @@ void pqOptions::Initialize()
this->AddBooleanArgument(
"--test-slave", 0, &this->TestSlave, "(For testing) When present, tests slave configuration.");
this->AddArgument("--live", 0, &this->CatalystLivePort, "Set the Catalyst Live port");
}
//-----------------------------------------------------------------------------
......
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