[kepler-dev] Wrapup sequence question

Edward A. Lee eal at eecs.berkeley.edu
Tue Mar 6 16:38:57 PST 2007


Under PN, every actor runs in its own thread, running a
program that looks something like this:

  preintialize();
  initialize();
  while (!_stopRequested && prefire()) {
     fire();
     if (!postfire()) break;
  }
  wrapup();

Since these are all separate threads, one thread could complete
before even another thread starts, in principle...

Edward

At 12:16 PM 3/6/2007, Norbert Podhorszki wrote:
>Hi,
>
>I have experienced a strange behaviour (for me at least) about the wrapup sequence. Could you please explain me why is this a feature or a bug? The attached workflow example is a Kepler workflow, using the Logger actor, which exploits the documented fact that the wrapup() method will be called at the end of the workflow execution. I use the Logger in several places in the workflow to log into the same file, which is closed in wrapup().
>
>1. Consider the following workflow: (CA for CompositeActor)
>   (SDFDirector)
>   Ramp -- CA -- CA2 -- Display
>
>where Ramp generates just one element.
>Both CA and CA2 logs the value in the same log file, "wrapuptest.log" (i.e. we get two lines).
>
>2. Consider that both CAs have their own SDF director. Still everything works fine, we get two lines in the log.
>
>3. Consider a third composite CAinCA inside CA, which has its own SDF director again, and is limited to iterate only once. Still fine.
>
>4. Replace the top level SDF with PN director. Interestingly, the actors in CA will be wrapped up before CA2 is executed.
>Why?
>This means, that the Logger closes the file in CA, then opens (and overwrites) it again in CA2.
>
>
>Thanks for any explanation, Norbert
>
>     Norbert Podhorszki
>   ------------------------------------
>     University of California, Davis
>     Department of Computer Science
>     1 Shields Ave, 2236 Kemper Hall
>     Davis, CA 95616
>     (530) 752-5076
>     pnorbert at cs.ucdavis.edu
>     ----------------------------------
>
>
>_______________________________________________
>Kepler-dev mailing list
>Kepler-dev at ecoinformatics.org
>http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev

------------ 
Edward A. Lee
Chair of EECS and Robert S. Pepper Distinguished Professor
231 Cory Hall, UC Berkeley, Berkeley, CA 94720-1770
phone: 510-642-0253, fax: 510-642-2845
eal at eecs.Berkeley.EDU, http://ptolemy.eecs.berkeley.edu/~eal  



More information about the Kepler-dev mailing list