src/LoadBalance/LinearMap.cpp file

Advanced Charm++ array creation with a map in a linear fashion.

Advanced Charm++ array creation refers to various ways arrays can be created with the Charm++ runtime system. See http://charm.cs.illinois.edu/manuals/html/charm++/manual.html, Sec. Advanced Array Creation. This class does a simple linear distribution.

Note that to help with performance, it is not advised to do heavy computations in the overridden member functions, procNum() and populateInitial(), since they can be potentially called many times. See also this note on the inner workings of the Charm++ runtime system regarding map objects and array element creation from long-time Charm++ developer, Eric Bohm, also at: http://lists.cs.uiuc.edu/pipermail/charm/2015-May/002047.html

Procnum will be called to construct your chare, the first time a message is sent to it from a node, and each time subsequent sends do not find a precached location record for it. The latter event can occur when many sends have pushed it out of cache, or after migration.

The potential global memory footprint of location management caching is proportional to the total number of objects multiplied by the number of nodes. Therefore, the runtime system keeps a finite number on each node. At the limit, procnum could be called for nearly every message send, therefore procnum should be designed to be inexpensive.

The heavy portion of array element placement should therefore be done in the constructor.