Skip to Content.
Sympa Menu

charm - Re: [charm] Load Balancer Destructor Not Being Called

charm AT lists.cs.illinois.edu

Subject: Charm++ parallel programming system

List archive

Re: [charm] Load Balancer Destructor Not Being Called


Chronological Thread 
  • From: Chris Wailes <chris.wailes AT gmail.com>
  • To: Phil Miller <mille121 AT illinois.edu>
  • Cc: charm <charm AT lists.cs.illinois.edu>
  • Subject: Re: [charm] Load Balancer Destructor Not Being Called
  • Date: Thu, 22 Jun 2017 16:15:22 -0400

Phil,

Well, it certainly serves my research purposes!  Thanks for the tip.

- Chris

On Thu, Jun 22, 2017 at 3:45 PM, Phil Miller <mille121 AT illinois.edu> wrote:
On Thu, Jun 22, 2017 at 3:26 PM, Chris Wailes <chris.wailes AT gmail.com> wrote:
Phil,

If there's some code you want to run before your application quits, I would recommend calling it as an explicit part of your application's control flow before it calls CkExit().

Unfortunately, I don't think this solution is applicable in this case as I'm just writing a load balancing strategy and not a full application.  This load balancing strategy generates a log file, and I need to write some data to it when the application exits.  Is there some way I can register a callback for when the application terminates?

There is a runtime-internal function that serves this purpose. I'm hesitant to offer it as an exposed API that we'll promise to preserve, but it could at least serve research purposes.

Have a look at registerExitFn declared in src/ck-core/init.h and defined in src/ck-core/init.C. This function is used in exactly the way you request by the runtime-provided tracing modules to write out their logs at job shutdown.
 


- Chris

On Thu, Jun 22, 2017 at 2:23 PM, Phil Miller <mille121 AT illinois.edu> wrote:
On Thu, Jun 22, 2017 at 2:08 PM, Chris Wailes <chris.wailes AT gmail.com> wrote:
The destructor for my custom load balancing strategy isn't being called when Charm++ programs terminate.  Does anyone know why this might be?

Hi Chris,

At present, Charm++ does not destroy any of the objects in the system at application shutdown. There's a broad assumption that process termination will release all held resources, and so that extra code to run would just add to execution time. If there's some code you want to run before your application quits, I would recommend calling it as an explicit part of your application's control flow before it calls CkExit().

Phil






Archive powered by MHonArc 2.6.19.

Top of Page