Running with the simulator:


\converse{} provides a simple parallel machine simulator for developing
and debugging purposes. It simulates a message passing system. The simulated
machine is a collection of processing nodes connected with a communication
network. Each node is composed of an application processor, local memory, and 
a communication coprocessor. 
The simulator is a beta version, particularly using the simulator timers
for performance measurements has not been tested yet.

In order to run \converse{} programs with the simulator:
\begin{item}
\item link user program with <machine>/lib/libck-unimain.o
\item prepare a configuration file as described below
\item to run, type pgm +pN (and possibly other runtime options) where
   N is the number of processors.
\end{itemize}



The basic task of the simulator is to manage the message passing
obeying various machine and network parameters.
A message experiences delays in various components of the machine. These
include: 1) sender application processor, 2) sender communication coprocesssor, 
3) network, 4) receiver communication processor, and 5) receiver
application processor.
Each component of the delayed is modelled by the widely used formula
$\alpha + n\beta$ where $\alpha$ is the startup cost, and $\beta$ is the
cost per byte. 
In addition to message delay parameters, there are others related to the 
network capacity and random variations in network delays. These parameters
are specified in a configuration file named "sim.param" in the directory
of the user program. If the simulator can't find this file, it assumes
default values (mostly zero latencies).
Figure~\ref{fig:simconfig} lists a sample configuration. The lines
starting with the \# sign are treated as comments. Each line contains
a keyword followed by some numbers. The explanation of each keyword
is given below:

\begin{description}
\item[\verb+cpu_recv_cost+] $\alpha$ and  $\beta$ values  for the software
                            cost of a message-receive at the application
                            processor.
\item[\verb+cpu_send_cost+] $\alpha$ and  $\beta$ values  for the software
                            cost of a message-send at the application
                            processor.
\item[\verb+rcp_cost+] $\alpha$ and  $\beta$ values for a message-receive 
                       at the communication processor.
\item[\verb+scp_cost+] $\alpha$ and  $\beta$ values for a message-send
                       at the communication processor.
\item[\verb+net_cost+] $\alpha$ and  $\beta$ values for a message-send
                       in the netowrk.
\item[\verb+cpu_queue_threshold_number+] max number of messages queued
                       at the application processors's incoming message queue.
\item[\verb+cpu_queue_threshold_size+] max cumulative size of messages in bytes
                       queued at the application processors's incoming message 
                       queue.


\item[\verb+cpu_queue_threshold_number+] max number of messages in the incoming
                       message queue of communication processor.   


\item[\verb+rcp_queue_threshold_number+] max number of messages in the 
                       incoming-message-queue of communication processors.                    
\item[\verb+rcp_queue_threshold_size+] max cumulative size of messages in bytes
                       in the incoming-message-queue of communication 
                       processors.

\item[\verb+net_queue_threshold_number+] max number of transient messages in 
                       the network.

\item[\verb+net_queue_threshold_size+] max cumulative size of transient 
                       messages in bytes in the network.

\item[\verb+latency-fixed] no random variations in the network latency 
                           ($\alpha$)

\item[\verb+latency-rand+] network latency ($\alpha$) is incremented by
                       a random value distributed exponentially. The first
                       number after the keyword is the mean of the
                       exponential distribution. The second number is the
                       initial seed vbalue for the random number generator.


\item[\verb+processor_scale+] The simulator scales the measured time
                      execution of code-blocks by this value.

\item[\verb+periodic_interval+] \converse{} has periodic checks for
                      various purposes. This is the time on seconds
                      those checks are called.
\end{description}


\begin{figure}
\begin{alltt}
#latency parameters
cpu_recv_cost 1E-6 1E-7              
cpu_send_cost 1E-6 1E-7
rcp_cost      1E-3 1E-7
scp_cost      1E-6 1E-7
net_cost      1E-6 1E-7


#capacity parameters
# choose one 
cpu_nolimit
#cpu_queue_threshold_number 100000
#cpu_queue_threshold_size   100000


#choose one
scp_nolimit
#scp_queue_threshold_number 100000
#scp_queue_threshold_size   100000

#choose one
rcp_net_nolimit
#rcp_queue_threshold_number 100000
#rcp_queue_threshold_size   100000
#net_queue_threshold_number 100000
#net_queue_threshold_size   100000

#random variations in latency
#choose one
latency-fixed
#latency-rand   0.0001 123456

processor_scale 1.0
periodic_interval 0.1
\end{alltt}
\caption{A sample configuration file for the simulator}
\label{fig:simconfig}
\end{figure}
