\subsection{Other Calls}

\label{other Charm++ calls}

The following calls provide information about the machines upon which the
parallel program is executing.  Processing Element refers to a single CPU.
Node refers to a single machine-- a set of processing elements which share
memory (i.e. an address space).  Processing Elements and Nodes are numbered,
starting from zero.

Thus if a parallel program is executing on one 4-processor workstation and one
2-processor workstation, there would be 6 processing elements (0, 1 ,2, 3, 4,
and 5) but only 2 nodes (0 and 1).  A given node's processing elements are
numbered sequentially.

\function{int CkNumPes()} \index{CkNumPes}
\desc{returns the total number of processors, across all nodes.}

\function{int CkMyPe()} \index{CkMyPe}
\desc{returns the processor number on which the call was made.}

\function{int CkMyRank()} \index{CkMyRank}
\desc{returns the rank number of the processor on which the call was made.
Processing elements within a node are ranked starting from zero.}

\function{int CkMyNode()} \index{CkMyNode}
\desc{returns the address space number (node number) on which the call was made.}

\function{int CkNumNodes()} \index{CkMyNodes}
\desc{returns the total number of address spaces.}

\function{int CkNodeFirst(int node)} \index{CkNodeFirst}
\desc{returns the processor number of the first processor in this address space.}

\function{int CkNodeSize(int node)} \index{CkNodeSize}
\desc{returns the number of processors in the address space on which the call was made.}

\function{int CkNodeOf(int pe)} \index{CkNodeOf}
\desc{returns the node number on which the call was made.}

\function{int CkRankOf(int pe)} \index{CkRankOf}
\desc{returns the rank of the given processor within its node.}

The following calls provide commonly needed functions.

\function{void CkAbort(const char *message)} \index{CkAbort}
\desc{Cause the program to abort, printing the given error message.}

\function{void CkExit()} \index{CkExit}
\desc{This call informs the Charm kernel that computation on all processors
should terminate.  After the currently executing entry method completes, no
more messages or entry methods will be called.  \kw{CkExit} should be the last
call of the entry method from which it was called.}

\function{double CkTimer()} \index{CkTimer} \index{timers}
\desc{returns the current value of the system timer in milliseconds. The system
timer is started when the program begins execution. This timer measures process
time (user and system).}

\function{double CkWallTimer()} \index{CkWallTimer} \index{timers}
\desc{returns the elapsed time since the program has started from the wall
clock timer.}

