Some registration routines need be executed exactly once before the computation begins. You may choose to declare a regular C++ subroutine initnode in the .ci file to ask CHARM++to execute the routine exactly once on every node before the computation begins, or to declare a regular C++ subroutine initproc to be executed exactly once on every processor.
This code will execute the routines fooNodeInit and static bar::barNodeInit once on every node and fooProcInit and bar::barProcInit on every processor before the main computation starts. Initnode calls are always executed before initproc calls. Both init calls (declared as static member function) can be used in chare, group or chare arrays.
Note that these routines should only do registration, not computation since Charm run-time initialization does not start yet -- use a mainchare instead, which gets executed on only processor 0, to begin the computation. Initcall routines are typically used to do special registrations and global variable setup before the computation actually begins.
October 08, 2008
Charm Homepage