Enable support for building mpi-win-x86_64-gcc
[charm.git] / doc / pose / intro.tex
blobffbaabcf4bacecb7c6c4a15088671aa4d47dc433
1 \section{Introduction}
3 \pose{} (Parallel Object-oriented Simulation Environment) is a tool for
4 parallel discrete event simulation (PDES) based on Charm++. You should have
5 a background in object-oriented programming (preferably C++) and know the
6 basic principles behind discrete event simulation. Familiarity
7 with simple parallel programming in Charm++ is also a plus.
9 \pose{} uses the approach of message-driven execution of Charm++, but
10 adds the element of discrete timestamps to control when, in simulated
11 time, a message is executed.
13 Users may choose synchronization strategies (conservative or several
14 optimistic variants) on a per class basis, depending on the desired
15 behavior of the object. However, \pose{} is intended to perform best
16 with a special type of {\it adaptive} synchronization strategy which
17 changes it's behavior on a per object basis. Thus, other
18 synchronization strategies may not be properly maintained. There are
19 two significant versions of the adaptive strategy, {\sl adapt4}, a
20 simple, stable version, and {\sl adept}, the development version.
22 \subsection{Developing a model in \pose{}}
24 Modeling a system in \pose{} is similar to how you would model in C++ or
25 any OOP language. Objects are entities that hold data, and have a
26 fixed set of operations that can be performed on them (methods).
28 Charm++ provides the parallelism we desire, but the model does not
29 differ dramatically from C++. The primary difference is that objects
30 may exist on a set of processors, and so invoking methods on them
31 requires communication via messages. These parallel objects are
32 called {\it chares}.
34 \pose{} adds to Charm++ by putting timestamps on method invocations
35 (events), and executing events in timestamp order to preserve the
36 validity of the global state.
38 Developing a model in \pose{} involves identifying the entities we
39 wish to model, determining their interactions with other entities and
40 determining how they change over time.
42 \subsection{PDES in \pose{}}
44 A simulation in \pose{} consists of a set of \charmpp{} chares performing
45 timestamped events in parallel. In \pose{}, these chares are called {\sl
46 posers}. \pose{} is designed to work with many such entities per
47 processor. The more a system can be broken down into its parallel
48 components when designing the simulation model, the more potential
49 parallelism in the final application.
51 A poser class is defined with a synchronization strategy associated
52 with it. We encourage the use of the adaptive strategies, as
53 mentioned earlier. Adaptive strategies are optimistic, and will
54 potentially execute events out of order, but have rollback and
55 cancellation messages as well as checkpointing abilities to deal with
56 this behind the scenes.
58 Execution is driven by events. An event arrives for a poser and is
59 sorted into a queue by timestamp. The poser has a local time called
60 object virtual time (OVT) which represents its progress through the
61 simulation. When an event arrives with a timestamp $t>$OVT, the OVT is
62 advanced to $t$. If the event has timestamp $t<$OVT, it may be that
63 other events with greater timestamps were executed. If this is the
64 case, a rollback will occur. If not, the event is simply executed
65 along with the others in the queue.
67 Time can also pass on a poser within the course of executing an
68 event. An {\sl elapse} function is used to advance the OVT.
70 \pose{} maintains a global clock, the global virtual time (GVT), that
71 represents the progress of the entire simulation.
73 Currently, \pose{} has no way to directly specify event dependencies, so if
74 they exist, the programmer must handle errors in ordering carefully.
75 \pose{} provides a delayed error message print and abort function that
76 is only performed if there is no chance of rolling back the dependency
77 error. Another mechanism provided by \pose{} is a method of tagging
78 events with {\it sequence numbers}. This allows the user to determine the
79 execution order of events which have the same timestamp.