Commit 6148e66e authored by cyrush's avatar cyrush

make debug sr images output to debug dump directory

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@3257 18c085ea-50e0-402c-830e-de6fd14e8384
parent 11dada9a
......@@ -167,6 +167,10 @@ avtDebugDumpOptions::DisableDatasetDump()
// Programmer: Cyrus Harrison
// Creation: Feburary 13, 2008
//
// Modifications:
// Cyrus Harrison, Tue Feb 19 08:29:10 PST 2008
// Support for Windows directories.
//
// ****************************************************************************
void
......@@ -175,9 +179,10 @@ avtDebugDumpOptions::SetDumpDirectory(const string &odir)
string res_dir = odir;
if(res_dir != "")
{
// make sure it has a "/" suffix
if (res_dir[res_dir.length()-1] !='/')
res_dir += '/';
// make sure it has a "/" or "\" (windows) suffix
string slash = string(SLASH_STRING);
if (res_dir[res_dir.length()-1] != slash[0] )
res_dir += slash;
// make sure the dir exists!
VisItStat_t s;
VisItStat(res_dir.c_str(), &s);
......
......@@ -154,6 +154,9 @@ const int INTERRUPT_MESSAGE_TAG = GetUniqueStaticMessageTag();
// Jeremy Meredith, Wed Jan 23 16:50:36 EST 2008
// Added setEFileOpenOptionsRPC.
//
// Cyrus Harrison, Tue Feb 19 08:42:51 PST 2008
// Removed shouldDoDashDump (flag now contained in avtDebugDumpOptions)
//
// ****************************************************************************
Engine::Engine()
......@@ -172,7 +175,6 @@ Engine::Engine()
metaData = NULL;
silAtts = NULL;
commandFromSim = NULL;
shouldDoDashDump = false;
quitRPC = NULL;
keepAliveRPC = NULL;
......@@ -475,6 +477,9 @@ Engine::Finalize(void)
// Jeremy Meredith, Wed Jan 23 16:50:36 EST 2008
// Added setEFileOpenOptionsRPC.
//
// Cyrus Harrison, Tue Feb 19 08:42:51 PST 2008
// Removed shouldDoDashDump (flag now contained in avtDebugDumpOptions)
//
// ****************************************************************************
void
......@@ -519,8 +524,6 @@ Engine::SetUpViewerInterface(int *argc, char **argv[])
// code to set the display and decide if we are using Mesa.
//
netmgr = new NetworkManager;
if (shouldDoDashDump)
netmgr->DumpRenders();
#if !defined(_WIN32)
// Set up the alarm signal handler.
......@@ -1120,6 +1123,9 @@ Engine::ProcessInput()
// Cyrus Harrison, Wed Feb 13 11:06:03 PST 2008
// Change -dump and -info dump to set new avtDebugDumpOptions object.
//
// Cyrus Harrison, Tue Feb 19 08:42:51 PST 2008
// Removed shouldDoDashDump (flag now contained in avtDebugDumpOptions)
//
// ****************************************************************************
void
......@@ -1239,7 +1245,6 @@ Engine::ProcessCommandLine(int argc, char **argv)
}
else if (strcmp(argv[i], "-dump") == 0)
{
shouldDoDashDump = true;
avtDebugDumpOptions::EnableDump();
// check for optional -dump output directory
......@@ -1251,7 +1256,6 @@ Engine::ProcessCommandLine(int argc, char **argv)
}
else if (strcmp(argv[i], "-info-dump") == 0)
{
shouldDoDashDump = true;
avtDebugDumpOptions::EnableDump();
avtDebugDumpOptions::DisableDatasetDump();
......
......@@ -163,6 +163,9 @@ class ProcessAttributes;
// Jeremy Meredith, Wed Jan 23 16:50:36 EST 2008
// Added setEFileOpenOptionsRPC.
//
// Cyrus Harrison, Tue Feb 19 08:42:51 PST 2008
// Removed shouldDoDashDump (flag now contained in avtDebugDumpOptions)
//
// ****************************************************************************
class Engine
......@@ -268,8 +271,6 @@ class Engine
// The load balancer
LoadBalancer *lb;
// Whether or not to do -dump.
bool shouldDoDashDump;
// The Xfer object
#ifdef PARALLEL
......
......@@ -68,6 +68,7 @@
#include <avtApplyDDFExpression.h>
#include <avtCallback.h>
#include <avtColorTables.h>
#include <avtDebugDumpOptions.h>
#include <avtExtents.h>
#include <avtNullData.h>
#include <avtDataObjectQuery.h>
......@@ -184,6 +185,9 @@ void *NetworkManager::progressCallbackArgs = NULL;
// Hank Childs, Sat Feb 18 11:31:23 PST 2006
// Added a call back for the apply ddf expression.
//
// Cyrus Harrison, Tue Feb 19 08:42:51 PST 2008
// Removed dumpRenders (now controled by avtDebugDumpOptions)
//
// ****************************************************************************
NetworkManager::NetworkManager(void) : virtualDatabases()
{
......@@ -193,7 +197,6 @@ NetworkManager::NetworkManager(void) : virtualDatabases()
requireOriginalNodes = false;
inQueryMode = false;
uniqueNetworkId = 0;
dumpRenders = false;
// stuff to support scalable rendering. We always have window 0
NewVisWindow(0);
......@@ -1974,6 +1977,10 @@ NetworkManager::HasNonMeshPlots(const intVector plotIds)
// Jeremy Meredith, Thu Jan 31 14:56:06 EST 2008
// Added new axis array window mode.
//
// Cyrus Harrison, Tue Feb 19 09:33:47 PST 2008
// Changed to use avtDebugDumpOptions::DumpEnabled to determine if
// debug sr images should be created.
//
// ****************************************************************************
avtDataObjectWriter_p
......@@ -2002,6 +2009,8 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, int annotMode,
std::vector<int>& plotsCurrentlyInWindow = viswinMap[windowID].plotsCurrentlyInWindow;
std::vector<avtPlot_p>& imageBasedPlots = viswinMap[windowID].imageBasedPlots;
bool dump_renders = avtDebugDumpOptions::DumpEnabled();
TRY
{
int t1 = visitTimer->StartTimer();
......@@ -2376,7 +2385,7 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, int annotMode,
visitTimer->StopTimer(t3, "Screen capture for SR");
if (dumpRenders)
if (dump_renders)
DumpImage(theImage, "before_OpaqueComposite");
avtWholeImageCompositer *imageCompositer;
......@@ -2431,7 +2440,7 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, int annotMode,
// Dump the composited image when debugging. Note that we only
// want all processors to dump it if we have done an Allreduce
// in the compositor, and this only happens in two pass mode.
if (dumpRenders)
if (dump_renders)
DumpImage(compositedImageAsDataObject,
"after_OpaqueComposite", two_pass_mode);
CallProgressCallback("NetworkManager", "Compositing", 1, 1);
......@@ -2466,7 +2475,7 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, int annotMode,
visitTimer->StopTimer(t1, "Second-pass screen capture for SR");
if (dumpRenders)
if (dump_renders)
DumpImage(theImage2, "before_TranslucentComposite");
avtTiledImageCompositor imageCompositer2;
......@@ -2644,7 +2653,7 @@ NetworkManager::Render(intVector plotIds, bool getZBuffer, int annotMode,
writer = compositedImageAsDataObject->InstantiateWriter();
writer->SetInput(compositedImageAsDataObject);
if (dumpRenders)
if (dump_renders)
DumpImage(compositedImageAsDataObject,
"after_AllComposites", false);
delete imageCompositer;
......@@ -4400,6 +4409,9 @@ NetworkManager::CallProgressCallback(const char *module, const char *msg,
// Brad Whitlock, Fri Feb 15 15:27:21 PST 2008
// Delete fileWriter.
//
// Cyrus Harrison, Tue Feb 19 08:38:12 PST 2008
// Added support for optional debug dump directory.
//
// ****************************************************************************
static void
DumpImage(avtDataObject_p img, const char *fmt, bool allprocs)
......@@ -4414,16 +4426,18 @@ DumpImage(avtDataObject_p img, const char *fmt, bool allprocs)
#ifdef PARALLEL
if (allprocs)
sprintf(tmpName, "%s_%03d_%03d.png", fmt, PAR_Rank(), numDumpsAll);
SNPRINTF(tmpName, 256, "%s_%03d_%03d.png", fmt, PAR_Rank(), numDumpsAll);
else
sprintf(tmpName, "%s_%03d.png", fmt, numDumps);
SNPRINTF(tmpName, 256, "%s_%03d.png", fmt, numDumps);
#else
sprintf(tmpName, "%s_%03d.png", fmt, numDumps);
SNPRINTF(tmpName, 256, "%s_%03d.png", fmt, numDumps);
#endif
string dump_image = avtDebugDumpOptions::GetDumpDirectory() + tmpName;
fileWriter->SetFormat(SaveWindowAttributes::PNG);
int compress = 1;
fileWriter->Write(tmpName, img, 100, false, compress, false);
fileWriter->Write(dump_image.c_str(), img, 100, false, compress, false);
delete fileWriter;
if (allprocs)
......
......@@ -309,6 +309,9 @@ typedef void (*ProgressCallback)(void *, const char *, const char *,int,int);
// Hank Childs, Fri Feb 1 15:44:46 PST 2008
// Add an arguement to GetDBFromCache for loading plugins.
//
// Cyrus Harrison, Tue Feb 19 08:42:51 PST 2008
// Removed dumpRenders (now controled by avtDebugDumpOptions)
//
// ****************************************************************************
class NetworkManager
......@@ -329,7 +332,7 @@ class NetworkManager
const CompactSILRestrictionAttributes &,
const MaterialAttributes &,
const MeshManagementAttributes &,
bool);
bool);
void DefineDB(const std::string &, const std::string &,
const stringVector &, int, const std::string &);
void AddFilter(const std::string&,
......@@ -387,8 +390,6 @@ class NetworkManager
void ConstructDDF(const int, ConstructDDFAttributes *);
avtDDF *GetDDF(const char *);
void DumpRenders(void) { dumpRenders = true; };
void CloneNetwork(const int id);
void AddQueryOverTimeFilter(QueryOverTimeAttributes *,
const int clonedFromId);
......@@ -421,7 +422,6 @@ class NetworkManager
std::map<int, EngineVisWinInfo> viswinMap;
bool dumpRenders;
std::vector<avtDDF *> ddf;
std::vector<std::string> ddf_names;
......
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