Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r935 - in trunk/fox/afr_demo: Engine/Control Engine/ImageTraversers StandAlone


Chronological Thread 
  • From: abhinav@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r935 - in trunk/fox/afr_demo: Engine/Control Engine/ImageTraversers StandAlone
  • Date: Sun, 12 Feb 2006 23:26:29 -0700 (MST)

Author: abhinav
Date: Sun Feb 12 23:26:28 2006
New Revision: 935

Modified:
   trunk/fox/afr_demo/Engine/Control/AFRPipeline.cc
   trunk/fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverserNew.cc
   trunk/fox/afr_demo/StandAlone/afr.cc
Log:

removed calls to getSamplesDone in GSTAfrImageTraversetNew to test if this is 
causing the slowdown of outer loop.

Also attempted to avoid race condition for initializing currenttime.

M    fox/afr_demo/Engine/Control/AFRPipeline.cc
M    fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverserNew.cc
M    fox/afr_demo/StandAlone/afr.cc


Modified: trunk/fox/afr_demo/Engine/Control/AFRPipeline.cc
==============================================================================
--- trunk/fox/afr_demo/Engine/Control/AFRPipeline.cc    (original)
+++ trunk/fox/afr_demo/Engine/Control/AFRPipeline.cc    Sun Feb 12 23:26:28 
2006
@@ -323,6 +323,7 @@
 
///////////////////////////////////////////////////////////////////////////////
 //
 
///////////////////////////////////////////////////////////////////////////////
+
 void AFRPipeline::blockUntilFinished()
 {
   ASSERT(running);
@@ -337,6 +338,28 @@
     if(currentImageTraverser->allThreadsInitialized())
     {
       allThreadInitDone = true;
+      allThreadInitTime = SCIRun::Time::currentSeconds();
+      cout << "ALL threads initialized at time" << allThreadInitTime << endl;
+    }
+  }
+  
+  animFrameState.frameTime = SCIRun::Time::currentSeconds() * timeScale;
+  return animFrameState.frameTime;
+}
+/*void AFRPipeline::blockUntilFinished()
+{
+  ASSERT(running);
+  ASSERT(workers.size()>0);
+  workers[0]->join();
+}
+
+Real AFRPipeline::getCurrentTime()
+{
+  if(!allThreadInitDone)
+  {
+    if(currentImageTraverser->allThreadsInitialized())
+    {
+      allThreadInitDone = true;
       current_samples = allThreadInitSampleCount = 
currentImageTraverser->getSamplesDone();
       if(timeMode==RealTime) 
          allThreadInitTime = SCIRun::Time::currentSeconds();
@@ -363,8 +386,7 @@
   //cout << "time: " << animFrameState.frameTime << endl;
   return animFrameState.frameTime;
 }
-
-
+*/
 
///////////////////////////////////////////////////////////////////////////////
 // MAIN RENDERING LOOP
 
///////////////////////////////////////////////////////////////////////////////
@@ -604,7 +626,7 @@
       long displayFrame = 
(renderFrameState.frameNumber-1)%channel->pipelineDepth;
       Image* image = channel->images[displayFrame];
    
-      if(image && image->isValid()){
+      /*if(image && image->isValid()){
         // Compute the current sampling rate.
 
         current_samples = currentImageTraverser->getSamplesDone();
@@ -619,17 +641,17 @@
         currentImageTraverser->setSamplingRate( (unsigned int)sampling_rate 
);
         
//////////////////////////////////////////////////////////////////////////
         // Debug window refresh.
-        /*if(proc == debug_proc) {
+        if(proc == debug_proc) {
 
           // I think that the debug window should be a property of the 
pipeline,
           // or greater application, not the image traverser.
           if (debug_window) {
             debug_window->display_stats( myContext, currentImageTraverser, 
currentImageTraverser->getNumThreads(), getCurrentTime() );
-        }*/
+        }
         //}
 
         last_samples = current_samples;
-      }
+      }*/
     }
 
     /////////////////////////////////////////////////////////////////////////

Modified: trunk/fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverserNew.cc
==============================================================================
--- trunk/fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverserNew.cc      
  (original)
+++ trunk/fox/afr_demo/Engine/ImageTraversers/GSTAFRImageTraverserNew.cc      
  Sun Feb 12 23:26:28 2006
@@ -928,7 +928,8 @@
       afr_context->endAdjustTiles( afr_begin );
       //cout << "updateCount says: " << updatecount[masterID] << endl;
     }
-    else if (getSamplesDone()>= (xres*yres)) {
+    //else if (getSamplesDone()>= (xres*yres)) {
+    else if (currenttime>2.0) {
       initpass[masterID] = true;
       std::cerr << "Master Thread: " << masterID << " initialized" << 
std::endl;    
     }

Modified: trunk/fox/afr_demo/StandAlone/afr.cc
==============================================================================
--- trunk/fox/afr_demo/StandAlone/afr.cc        (original)
+++ trunk/fox/afr_demo/StandAlone/afr.cc        Sun Feb 12 23:26:28 2006
@@ -181,6 +181,9 @@
   vector<string> args;
   for(int i=1;i<argc;i++)
     args.push_back(argv[i]);
+
+  // Attempting to avoid race condition in current time.
+  SCIRun::Time::currentSeconds();
        
   try {
 




  • [MANTA] r935 - in trunk/fox/afr_demo: Engine/Control Engine/ImageTraversers StandAlone, abhinav, 02/12/2006

Archive powered by MHonArc 2.6.16.

Top of page