Commit 477aa012 authored by whitlocb's avatar whitlocb

VisIt builds and runs on BG/Q

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@24834 18c085ea-50e0-402c-830e-de6fd14e8384
parent af5477ea
......@@ -1072,13 +1072,12 @@ IF(NOT VISIT_DBIO_ONLY)
SET(OPENGL_FOUND ON)
SET(OPENGL_GLU_FOUND ON)
SET(OPENGL_INCLUDE_DIR ${VISIT_OPENGL_DIR}/include)
# Hack for BG/Q. Assume if Mesa has been set and we're telling
# VisIt where to look for GL that we're using Mesa for GL.
IF(HAVE_OSMESA)
# Hack for BG/Q.
IF(BLUEGENEQ)
SET(LIBGL OSMesa)
ELSE(HAVE_OSMESA)
ELSE(BLUEGENEQ)
SET(LIBGL GL)
ENDIF(HAVE_OSMESA)
ENDIF(BLUEGENEQ)
IF(VISIT_STATIC)
SET(OPENGL_gl_LIBRARY ${VISIT_OPENGL_DIR}/lib/lib${LIBGL}.a)
SET(OPENGL_glu_LIBRARY ${VISIT_OPENGL_DIR}/lib/libGLU.a)
......@@ -2310,20 +2309,18 @@ ADD_SUBDIRECTORY(third_party_builtin)
ADD_SUBDIRECTORY(common)
ADD_SUBDIRECTORY(visit_vtk)
ADD_SUBDIRECTORY(avt)
ADD_SUBDIRECTORY(sim)
IF(VISIT_DBIO_ONLY)
ADD_SUBDIRECTORY(tools)
ELSE(VISIT_DBIO_ONLY)
ADD_SUBDIRECTORY(engine)
ENDIF(VISIT_DBIO_ONLY)
IF(NOT VISIT_ENGINE_ONLY AND NOT VISIT_DBIO_ONLY)
ADD_SUBDIRECTORY(launcher)
ADD_SUBDIRECTORY(mdserver)
ENDIF(NOT VISIT_ENGINE_ONLY AND NOT VISIT_DBIO_ONLY)
IF(NOT VISIT_DBIO_ONLY)
ADD_SUBDIRECTORY(sim)
ADD_SUBDIRECTORY(viewer) # sim depends on viewercore
ADD_SUBDIRECTORY(engine) # viewercore depends on rpc and proxy libs.
ADD_SUBDIRECTORY(launcher) # viewercore depends on rpc and proxy libs.
ADD_SUBDIRECTORY(mdserver) # viewercore depends on rpc and proxy libs.
ENDIF(NOT VISIT_DBIO_ONLY)
IF(NOT VISIT_SERVER_COMPONENTS_ONLY AND NOT VISIT_ENGINE_ONLY AND NOT VISIT_DBIO_ONLY)
ADD_SUBDIRECTORY(vtkqt)
ADD_SUBDIRECTORY(winutil)
ADD_SUBDIRECTORY(viewer)
ADD_SUBDIRECTORY(gui)
IF(VISIT_PYTHON_SCRIPTING AND PYTHONLIBS_FOUND)
IF(NOT VISIT_STATIC)
......@@ -2377,10 +2374,8 @@ IF(NOT VISIT_DBIO_ONLY)
ENDIF(NOT VISIT_DBIO_ONLY)
ADD_SUBDIRECTORY(databases)
IF(NOT VISIT_SERVER_COMPONENTS_ONLY AND NOT VISIT_ENGINE_ONLY AND NOT VISIT_DBIO_ONLY)
# Must come after plugins in case we're doing a static build
ADD_SUBDIRECTORY(tools)
ENDIF(NOT VISIT_SERVER_COMPONENTS_ONLY AND NOT VISIT_ENGINE_ONLY AND NOT VISIT_DBIO_ONLY)
# Must come after plugins in case we're doing a static build
ADD_SUBDIRECTORY(tools)
# Now that plugins have been added, do the mains last if we're creating static
# binaries. This is needed to link the plugins into the exe.
......
......@@ -620,13 +620,13 @@ avtDatabaseFactory::FileList(DatabasePluginManager *dbmgr,
dbmgr->ReportWarning(warning);
}
}
CATCH(NonCompliantException &e)
CATCH2(NonCompliantException, e)
{
rv = NULL;
noncompliantPlugins.push_back(info ? info->GetName(): "");
noncompliantErrors.push_back(e.Message());
}
CATCH(NonCompliantFileException &e)
CATCH2(NonCompliantFileException, e)
{
rv = NULL;
noncompliantPlugins.push_back(info ? info->GetName(): "");
......@@ -704,13 +704,13 @@ avtDatabaseFactory::FileList(DatabasePluginManager *dbmgr,
delete dbtmp;
}
}
CATCH(NonCompliantException &e)
CATCH2(NonCompliantException, e)
{
rv = NULL;
noncompliantPlugins.push_back(info ? info->GetName(): "");
noncompliantErrors.push_back(e.Message());
}
CATCH(NonCompliantFileException &e)
CATCH2(NonCompliantFileException, e)
{
rv = NULL;
noncompliantPlugins.push_back(info ? info->GetName(): "");
......@@ -848,13 +848,13 @@ avtDatabaseFactory::FileList(DatabasePluginManager *dbmgr,
dbmgr->ReportWarning(warning);
}
}
CATCH(NonCompliantException &e)
CATCH2(NonCompliantException, e)
{
rv = NULL;
noncompliantPlugins.push_back(info ? info->GetName(): "");
noncompliantErrors.push_back(e.Message());
}
CATCH(NonCompliantFileException &e)
CATCH2(NonCompliantFileException, e)
{
rv = NULL;
noncompliantPlugins.push_back(info ? info->GetName(): "");
......
......@@ -1856,7 +1856,7 @@ avtPosCMFEAlgorithm::SpatialPartition::~SpatialPartition()
// ****************************************************************************
// Class: Boundary
// Class: SPBoundary
//
// Purpose:
// This class is for setting up a spatial partition. It contains methods
......@@ -1880,14 +1880,14 @@ typedef enum
} Axis;
const int npivots = 5;
class Boundary
class SPBoundary
{
public:
Boundary(const double *, int, Axis);
virtual ~Boundary() {;};
SPBoundary(const double *, int, Axis);
~SPBoundary() {;};
const double *GetBoundary() { return bounds; };
bool AttemptSplit(Boundary *&, Boundary *&);
bool AttemptSplit(SPBoundary *&, SPBoundary *&);
bool IsDone(void) { return isDone; };
bool IsLeaf(void) { return (numProcs == 1); };
void AddCell(const double *);
......@@ -1895,7 +1895,7 @@ class Boundary
void AddRGrid(const double *, const double *, const double *,
int, int, int);
static void SetIs2D(bool b) { is2D = b; };
static void PrepareSplitQuery(Boundary **, int);
static void PrepareSplitQuery(SPBoundary **, int);
protected:
double bounds[6];
......@@ -1908,18 +1908,18 @@ class Boundary
static bool is2D;
};
bool Boundary::is2D = false;
bool SPBoundary::is2D = false;
// ****************************************************************************
// Method: Boundary constructor
// Method: SPBoundary constructor
//
// Programmer: Hank Childs
// Creation: January 9, 2006
//
// ****************************************************************************
Boundary::Boundary(const double *b, int n, Axis a)
SPBoundary::SPBoundary(const double *b, int n, Axis a)
{
int i;
......@@ -1951,10 +1951,10 @@ Boundary::Boundary(const double *b, int n, Axis a)
// ****************************************************************************
// Method: Boundary::PrepareSplitQuery
// Method: SPBoundary::PrepareSplitQuery
//
// Purpose:
// Each Boundary is operating only with the information on this processor.
// Each SPBoundary is operating only with the information on this processor.
// When it comes time to determine if we can split a boundary, the info
// from each processor needs to be unified. That is the purpose of this
// method. It unifies the information so that Boundaries can later make
......@@ -1966,7 +1966,7 @@ Boundary::Boundary(const double *b, int n, Axis a)
// ****************************************************************************
void
Boundary::PrepareSplitQuery(Boundary **b_list, int listSize)
SPBoundary::PrepareSplitQuery(SPBoundary **b_list, int listSize)
{
int i, j;
int idx;
......@@ -1992,7 +1992,7 @@ Boundary::PrepareSplitQuery(Boundary **b_list, int listSize)
// ****************************************************************************
// Method: Boundary::AddPoint
// Method: SPBoundary::AddPoint
//
// Purpose:
// Adds a point to the boundary.
......@@ -2003,7 +2003,7 @@ Boundary::PrepareSplitQuery(Boundary **b_list, int listSize)
// ****************************************************************************
void
Boundary::AddPoint(const double *pt)
SPBoundary::AddPoint(const double *pt)
{
double p = (axis == X_AXIS ? pt[0] : axis == Y_AXIS ? pt[1] : pt[2]);
for (int i = 0 ; i < npivots ; i++)
......@@ -2017,7 +2017,7 @@ Boundary::AddPoint(const double *pt)
// ****************************************************************************
// Method: Boundary::AddRGrid
// Method: SPBoundary::AddRGrid
//
// Purpose:
// Adds an rgrid to the boundary.
......@@ -2028,7 +2028,7 @@ Boundary::AddPoint(const double *pt)
// ****************************************************************************
void
Boundary::AddRGrid(const double *x, const double *y, const double *z, int nX,
SPBoundary::AddRGrid(const double *x, const double *y, const double *z, int nX,
int nY, int nZ)
{
//
......@@ -2097,7 +2097,7 @@ Boundary::AddRGrid(const double *x, const double *y, const double *z, int nX,
// ****************************************************************************
// Method: Boundary::AttemptSplit
// Method: SPBoundary::AttemptSplit
//
// Purpose:
// Sees if the boundary has found an acceptable pivot to split around.
......@@ -2108,7 +2108,7 @@ Boundary::AddRGrid(const double *x, const double *y, const double *z, int nX,
// ****************************************************************************
bool
Boundary::AttemptSplit(Boundary *&b1, Boundary *&b2)
SPBoundary::AttemptSplit(SPBoundary *&b1, SPBoundary *&b2)
{
int i;
......@@ -2157,27 +2157,27 @@ Boundary::AttemptSplit(Boundary *&b1, Boundary *&b2)
if (axis == X_AXIS)
{
b_tmp[1] = pivots[closestI];
b1 = new Boundary(b_tmp, numProcs1, Y_AXIS);
b1 = new SPBoundary(b_tmp, numProcs1, Y_AXIS);
b_tmp[0] = pivots[closestI];
b_tmp[1] = bounds[1];
b2 = new Boundary(b_tmp, numProcs2, Y_AXIS);
b2 = new SPBoundary(b_tmp, numProcs2, Y_AXIS);
}
else if (axis == Y_AXIS)
{
Axis next_axis = (is2D ? X_AXIS : Z_AXIS);
b_tmp[3] = pivots[closestI];
b1 = new Boundary(b_tmp, numProcs1, next_axis);
b1 = new SPBoundary(b_tmp, numProcs1, next_axis);
b_tmp[2] = pivots[closestI];
b_tmp[3] = bounds[3];
b2 = new Boundary(b_tmp, numProcs2, next_axis);
b2 = new SPBoundary(b_tmp, numProcs2, next_axis);
}
else
{
b_tmp[5] = pivots[closestI];
b1 = new Boundary(b_tmp, numProcs1, X_AXIS);
b1 = new SPBoundary(b_tmp, numProcs1, X_AXIS);
b_tmp[4] = pivots[closestI];
b_tmp[5] = bounds[5];
b2 = new Boundary(b_tmp, numProcs2, X_AXIS);
b2 = new SPBoundary(b_tmp, numProcs2, X_AXIS);
}
isDone = true;
}
......@@ -2285,9 +2285,9 @@ avtPosCMFEAlgorithm::SpatialPartition::CreatePartition(DesiredPoints &dp,
// which represents our spatial partitioning.
//
bool is2D = (bounds[4] == bounds[5]);
Boundary::SetIs2D(is2D);
SPBoundary::SetIs2D(is2D);
int nProcs = PAR_Size();
Boundary **b_list = new Boundary*[2*nProcs];
SPBoundary **b_list = new SPBoundary*[2*nProcs];
double dbounds[6];
dbounds[0] = bounds[0];
dbounds[1] = bounds[1];
......@@ -2300,7 +2300,7 @@ avtPosCMFEAlgorithm::SpatialPartition::CreatePartition(DesiredPoints &dp,
dbounds[4] -= 1.;
dbounds[5] += 1.;
}
b_list[0] = new Boundary(dbounds, nProcs, X_AXIS);
b_list[0] = new SPBoundary(dbounds, nProcs, X_AXIS);
int listSize = 1;
int *bin_lookup = new int[2*nProcs];
bool keepGoing = (nProcs > 1);
......@@ -2340,7 +2340,7 @@ avtPosCMFEAlgorithm::SpatialPartition::CreatePartition(DesiredPoints &dp,
it.GetElementsListFromRange(pt, pt, list);
for (int j = 0 ; j < (int) list.size() ; j++)
{
Boundary *b = b_list[bin_lookup[list[j]]];
SPBoundary *b = b_list[bin_lookup[list[j]]];
b->AddPoint(pt);
}
}
......@@ -2363,7 +2363,7 @@ avtPosCMFEAlgorithm::SpatialPartition::CreatePartition(DesiredPoints &dp,
it.GetElementsListFromRange(min, max, list);
for (int j = 0 ; j < (int) list.size() ; j++)
{
Boundary *b = b_list[bin_lookup[list[j]]];
SPBoundary *b = b_list[bin_lookup[list[j]]];
b->AddRGrid(x, y, z, nX, nY, nZ);
}
}
......@@ -2386,20 +2386,20 @@ avtPosCMFEAlgorithm::SpatialPartition::CreatePartition(DesiredPoints &dp,
it.GetElementsListFromRange(pt, pt, list);
for (int k = 0 ; k < (int) list.size() ; k++)
{
Boundary *b = b_list[bin_lookup[list[k]]];
SPBoundary *b = b_list[bin_lookup[list[k]]];
b->AddPoint(pt);
}
}
}
// See which boundaries found a suitable pivot and can now split.
Boundary::PrepareSplitQuery(b_list, listSize);
SPBoundary::PrepareSplitQuery(b_list, listSize);
int numAtStartOfLoop = listSize;
for (int i = 0 ; i < numAtStartOfLoop ; i++)
{
if (b_list[i]->IsDone())
continue;
Boundary *b1, *b2;
SPBoundary *b1, *b2;
if (b_list[i]->AttemptSplit(b1, b2))
{
b_list[listSize++] = b1;
......@@ -2439,7 +2439,7 @@ avtPosCMFEAlgorithm::SpatialPartition::CreatePartition(DesiredPoints &dp,
{
const double *b = b_list[i]->GetBoundary();
if (DebugStream::Level1()) {
debug1 << "Boundary " << count++ << " = " << b[0] << "-" <<b[1]
debug1 << "SPBoundary " << count++ << " = " << b[0] << "-" <<b[1]
<< ", " << b[2] << "-" << b[3] << ", " << b[4] << "-"
<< b[5] << endl;
}
......
......@@ -137,7 +137,7 @@ class PIPELINE_API avtDataSelection
virtual const char * GetType() const = 0;
virtual bool operator==(const avtDataSelection &) const
{ EXCEPTION0(ImproperUseException); };
{ EXCEPTION0(ImproperUseException); return false; };
virtual std::string DescriptionString(void) = 0;
private:
......
......@@ -154,13 +154,20 @@ VisWinRenderingWithoutWindow::GetRenderWindow(void)
// Modifications:
// Eric Brugger, Fri May 10 14:39:42 PDT 2013
// I removed support for mangled mesa.
//
//
// Brad Whitlock, Fri Oct 17 20:02:39 PDT 2014
// Check to see if we have X11 before looking for the DISPLAY variable. If
// have built VisIt or VTK without X11 support then we won't get an X11-based
// render window. In that case, we'd like to try and render what VTK provides
// since it is likely a vtkOSOpenGLRenderWindow, on offscreen window. I also
// improved the warning message.
//
// ****************************************************************************
void
VisWinRenderingWithoutWindow::RenderRenderWindow(void)
{
#if defined(__unix__) && !defined(__APPLE__) && !defined(HAVE_OSMESA)
#if defined(__unix__) && !defined(__APPLE__) && defined(HAVE_LIBX11) && !defined(HAVE_OSMESA)
if(displayStatus == DS_NOT_CHECKED)
{
// On X11 systems not using mangled mesa, make sure that the DISPLAY is set.
......@@ -177,10 +184,14 @@ VisWinRenderingWithoutWindow::RenderRenderWindow(void)
else
{
avtCallback::IssueWarning("VisIt was not built with support for "
"software-based offscreen rendering. This means that the DISPLAY "
"variable must be set to a valid X-server display in order to render "
"an image. If you are running client/server, consider adding -X to "
"your SSH arguments.");
"software-based offscreen rendering. This is often the case when "
"the --mesa flag was not passed to the build_visit script.\n\n"
"This means that the DISPLAY environment variable must be set to a "
"valid X-server display in order to render an image. If you are running "
"client/server, you may be able to work around this issue by -X to the "
"SSH arguments in the host profile for the remote computer. The best"
"alternative is to rebuild VisIt with --mesa support on the remote "
"computer.");
}
#else
GetRenderWindow()->Render();
......
......@@ -197,6 +197,7 @@ state/AppearanceAttributes.C
state/AttributeGroup.C
state/AttributeSubject.C
state/AttributeSubjectMap.C
state/AttributeSubjectSerialize.C
state/Axes2D.C
state/Axes3D.C
state/AxesArray.C
......@@ -350,19 +351,22 @@ IF(WIN32)
TARGET_LINK_LIBRARIES(visitcommon ws2_32 shlwapi userenv)
ELSE(WIN32)
TARGET_LINK_LIBRARIES(visitcommon ${CMAKE_THREAD_LIBS} ${DL_LIB})
ADD_EXECUTABLE(StringHelpers_test utility/StringHelpers_test.C)
TARGET_LINK_LIBRARIES(StringHelpers_test visitcommon ${CMAKE_THREAD_LIBS} ${DL_LIB})
ADD_EXECUTABLE(Namescheme_test utility/Namescheme_test.C)
TARGET_LINK_LIBRARIES(Namescheme_test visitcommon ${CMAKE_THREAD_LIBS} ${DL_LIB})
ADD_EXECUTABLE(MRUCache_test utility/MRUCache_test.C)
ADD_EXECUTABLE(exprconfig expr/ExprConfig.C)
TARGET_LINK_LIBRARIES(exprconfig visitcommon ${CMAKE_THREAD_LIBS} ${DL_LIB})
ADD_EXECUTABLE(exprtest expr/test.C)
TARGET_LINK_LIBRARIES(exprtest visitcommon ${CMAKE_THREAD_LIBS} ${DL_LIB})
ADD_CUSTOM_TARGET(init)
ADD_DEPENDENCIES(init exprconfig)
ADD_CUSTOM_COMMAND(TARGET init POST_BUILD COMMAND exprconfig ExprInit.C
WORKING_DIRECTORY ${VISIT_SOURCE_DIR}/common/expr)
IF(NOT VISIT_ENGINE_ONLY AND NOT VISIT_SERVER_COMPONENTS_ONLY)
ADD_EXECUTABLE(StringHelpers_test utility/StringHelpers_test.C)
TARGET_LINK_LIBRARIES(StringHelpers_test visitcommon ${CMAKE_THREAD_LIBS} ${DL_LIB})
ADD_EXECUTABLE(Namescheme_test utility/Namescheme_test.C)
TARGET_LINK_LIBRARIES(Namescheme_test visitcommon ${CMAKE_THREAD_LIBS} ${DL_LIB})
ADD_EXECUTABLE(MRUCache_test utility/MRUCache_test.C)
ADD_EXECUTABLE(exprconfig expr/ExprConfig.C)
TARGET_LINK_LIBRARIES(exprconfig visitcommon ${CMAKE_THREAD_LIBS} ${DL_LIB})
ADD_EXECUTABLE(exprtest expr/test.C)
TARGET_LINK_LIBRARIES(exprtest visitcommon ${CMAKE_THREAD_LIBS} ${DL_LIB})
ADD_CUSTOM_TARGET(init)
ADD_DEPENDENCIES(init exprconfig)
ADD_CUSTOM_COMMAND(TARGET init POST_BUILD COMMAND exprconfig ExprInit.C
WORKING_DIRECTORY ${VISIT_SOURCE_DIR}/common/expr)
ENDIF(NOT VISIT_ENGINE_ONLY AND NOT VISIT_SERVER_COMPONENTS_ONLY)
ENDIF(WIN32)
VISIT_INSTALL_TARGETS(visitcommon)
......@@ -39,7 +39,7 @@
#include <visit-config.h>
#include <convert.h>
#include <Connection.h>
#include <AttributeSubject.h>
const bool Connection::SRC = false;
const bool Connection::DEST = true;
......@@ -53,16 +53,6 @@ long Connection::WriteHeader(const unsigned char *buf, long len)
return DirectWrite(buf,len);
}
void Connection::Flush(AttributeSubject *subject)
{
// Write out the subject's guido and message size.
WriteInt(subject->GetGuido());
int sz = subject->CalculateMessageSize(*this);
WriteInt(sz);
subject->Write(*this);
Flush();
}
// *******************************************************************
// Method: Connection::Connection
//
......@@ -456,6 +446,25 @@ Connection::GetDestinationFormat() const
return destFormat;
}
// *******************************************************************
// Method: Connection::GetSourceFormat
//
// Purpose:
// Returns a reference to the source machine's type representation.
//
// Programmer: Brad Whitlock
// Creation: Thu Oct 5 13:17:56 PST 2000
//
// Modifications:
//
// *******************************************************************
const TypeRepresentation &
Connection::GetSourceFormat() const
{
return srcFormat;
}
// *******************************************************************
// Method: Connection::EnableConversion
//
......
......@@ -65,7 +65,7 @@
// I added convenience methods for reading/writing string.
//
// ****************************************************************************
class AttributeSubject;
class COMM_API Connection
{
public:
......@@ -78,7 +78,7 @@ public:
virtual int Fill() = 0;
virtual void Flush() = 0;
virtual long Size() = 0;
virtual void Flush(AttributeSubject*);
// These read or write a byte to whatever we're using
// as the connection.
virtual void Write(unsigned char value) = 0;
......@@ -124,6 +124,7 @@ public:
// Set the destination format.
void SetDestinationFormat(const TypeRepresentation &);
const TypeRepresentation &GetDestinationFormat() const;
const TypeRepresentation &GetSourceFormat() const;
void EnableConversion(bool val);
protected:
// Conversion related stuff.
......
......@@ -70,6 +70,15 @@
//
std::map<int, bool> LaunchService::childDied;
// Pass this information to the thread to set up the bridge.
struct BridgeInfo
{
int newlocalport;
int oldlocalport;
int bufferSize;
bool logging;
};
// ****************************************************************************
// Function: CreateSocketBridge
//
......@@ -88,13 +97,17 @@ std::map<int, bool> LaunchService::childDied;
// Thomas R. Treadway, Mon Oct 8 13:27:42 PDT 2007
// Backing out SSH tunneling on Panther (MacOS X 10.3)
//
// Brad Whitlock, Tue Oct 14 17:12:46 PDT 2014
// Pass the bridge set up information in a struct. Set the buffer size.
//
// ****************************************************************************
static void CreateSocketBridge(void *ports)
static void CreateSocketBridge(void *ptr)
{
int newlocalport = ((int*)ports)[0];
int oldlocalport = ((int*)ports)[1];
SocketBridge bridge(newlocalport,oldlocalport);
BridgeInfo *info = (BridgeInfo *)ptr;
SocketBridge bridge(info->newlocalport, info->oldlocalport);
bridge.SetLogging(info->logging);
if(info->bufferSize > 0)
bridge.SetBufferSize(info->bufferSize);
bridge.Bridge();
}
......@@ -189,6 +202,9 @@ LaunchService::DeadChildHandler(int)
// I changed the routine so the check for setting up the bridge is passed
// in rather than calculated in here from launch arguments.
//
// Brad Whitlock, Tue Oct 14 17:16:31 PDT 2014
// Allow the buffer size to be passed in to the thread that makes the bridge.
//
// ****************************************************************************
bool
......@@ -200,6 +216,7 @@ LaunchService::SetupGatewaySocketBridgeIfNeeded(stringVector &launchArgs)
int oldlocalport = -1;
int portargument = -1;
int hostargument = -1;
int bufferSize = -1;
for (size_t i=0; i<launchArgs.size(); i++)
{
if (i<launchArgs.size()-1 && launchArgs[i] == "-port")
......@@ -211,6 +228,10 @@ LaunchService::SetupGatewaySocketBridgeIfNeeded(stringVector &launchArgs)
{
hostargument = i+1;
}
else if (launchArgs[i] == "-fixed-buffer-sockets")
{
bufferSize = SocketConnection::FIXED_BUFFER_SIZE;
}
}
bool setupBridge = (portargument != -1 && hostargument != -1);
......@@ -243,11 +264,13 @@ LaunchService::SetupGatewaySocketBridgeIfNeeded(stringVector &launchArgs)
launchArgs[portargument] = newportstr;
// fork and start the socket bridge
int *ports = new int[2];
ports[0] = newlocalport;
ports[1] = oldlocalport;
BridgeInfo *info = new BridgeInfo;
info->newlocalport = newlocalport;
info->oldlocalport = oldlocalport;
info->bufferSize = bufferSize;
info->logging = DebugStream::Level1();
#ifdef _WIN32
_beginthread(CreateSocketBridge, 0, (void*)ports);
_beginthread(CreateSocketBridge, 0, (void*)info);
#else
switch (fork())
{
......@@ -264,7 +287,7 @@ LaunchService::SetupGatewaySocketBridgeIfNeeded(stringVector &launchArgs)
{
close(k);
}
CreateSocketBridge((void*)ports);
CreateSocketBridge((void*)info);
exit(0); // HOOKS_IGNORE
break;
}
......
......@@ -278,7 +278,7 @@ ParentProcess::Connect(int numRead, int numWrite, int *argc, char **argv[],
{
const char *mName = "ParentProcess::Connect: ";
char **argv2 = *argv;
bool rhostSpecified = false;
bool rhostSpecified = false, fixedBufferMode = false;
int i, deleteCount = 0, port = 0;
// Log the arguments.
......@@ -347,6 +347,10 @@ ParentProcess::Connect(int numRead, int numWrite, int *argc, char **argv[],
createSockets = false;
deleteCount = 1;
}
else if(std::string(argv2[i]) == std::string("-fixed-buffer-sockets"))
{
fixedBufferMode = true;
}
//
// Delete some arguments.
......@@ -379,7 +383,10 @@ ParentProcess::Connect(int numRead, int numWrite, int *argc, char **argv[],
int desc = GetClientSocketDescriptor(port);
if(desc != -1)
{
writeConnections[nWriteConnections] = new SocketConnection(desc);
SocketConnection *s = new SocketConnection(desc);
s->SetFixedBufferMode(fixedBufferMode);
writeConnections[nWriteConnections] = s;
++nWriteConnections;
}
}
......@@ -393,8 +400,10 @@ ParentProcess::Connect(int numRead, int numWrite, int *argc, char **argv[],
{
int desc = GetClientSocketDescriptor(port);
if(desc != -1)
{
readConnections[nReadConnections] = new SocketConnection(desc);
{
SocketConnection *s = new SocketConnection(desc);
s->SetFixedBufferMode(fixedBufferMode);
readConnections[nReadConnections] = s;
++nReadConnections;
}
}
......
......@@ -236,6 +236,8 @@ RemoteProcess::RemoteProcess(const std::string &rProgram) : localHost("notset"),
// Set the callback information.
progressCallback = 0;
progressCallbackData = 0;
fixedBufferMode = false;
}
// ****************************************************************************
......@@ -1520,6 +1522,10 @@ RemoteProcess::StartMakingConnection(const std::string &remoteHost,
//
// Mark C. Miller, Wed Jun 17 14:27:08 PDT 2009
// Replaced CATCHALL(...) with CATCHALL.
//
// Brad Whitlock, Tue Oct 14 15:59:18 PDT 2014
// Added code to enable fixed buffer socket mode.
//
// ****************************************************************************
void
......@@ -1553,7 +1559,10 @@ RemoteProcess::FinishMakingConnection(int numRead, int numWrite)
else
{
int descriptor = AcceptSocket();
readConnections[nReadConnections] = new SocketConnection(descriptor);
SocketConnection *s = new SocketConnection(descriptor);
debug1 << mName << "fixedBufferMode=" << fixedBufferMode << endl;
s->SetFixedBufferMode(fixedBufferMode);
readConnections[nReadConnections] = s;
}
++nReadConnections;
}
......@@ -1573,7 +1582,10 @@ RemoteProcess::FinishMakingConnection(int numRead, int numWrite)
else
{
int descriptor = AcceptSocket();
writeConnections[nWriteConnections] = new SocketConnection(descriptor);
SocketConnection *s = new SocketConnection(descriptor);
debug1 << mName << "fixedBufferMode=" << fixedBufferMode << endl;
s->SetFixedBufferMode(fixedBufferMode);
writeConnections[nWriteConnections] = s;
}
++nWriteConnections;
}
......@@ -2201,6 +2213,14 @@ RemoteProcess::CreateCommandLine(stringVector &args, const MachineProfile &profi
//
args.push_back("-key");
args.push_back(securityKey);