ROSS
ross.h
Go to the documentation of this file.
1 #ifndef INC_ross_h
2 #define INC_ross_h
3 
4 /** @mainpage Rensselaer's Optimistic Simulation System (ROSS)
5  @section intro_sec Introduction
6 
7  ROSS is an acronym for Rensselaer's Optimistic Simulation System. It is a
8  parallel discrete-event simulator that executes on shared-memory
9  multiprocessor systems. ROSS is geared for running large-scale simulation
10  models (i.e., 100K to even 1 million object models). The synchronization
11  mechanism is based on Time Warp. Time Warp is an optimistic
12  synchronization mechanism develop by Jefferson and Sowizral [10, 11] used
13  in the parallelization of discrete-event simulation. The distributed
14  simulator consists of a collection of logical processes or LPs, each
15  modeling a distinct component of the system being modeled, e.g., a server
16  in a queuing network. LPs communicate by exchanging timestamped event
17  messages, e.g., denoting the arrival of a new job at that server.
18 
19  The Time Warp mechanism uses a detection-and-recovery protocol to
20  synchronize the computation. Any time an LP determines that it has
21  processed events out of timestamp order, it "rolls back" those events, and
22  re-executes them. For a detailed discussion of Time Warp as well as other
23  parallel simulation protocols we refer the reader to [8]
24 
25  ROSS was modeled after a Time Warp simulator called GTW or Georgia Tech
26  Time Warp[7]. ROSS helped to demonstrate that Time Warp simulators can be
27  run efficiently both in terms of speed and memory usage relative to a
28  high-performance sequential simulator.
29 
30  To achieve high parallel performance, ROSS uses a technique call Reverse
31  Computation. Here, the roll back mechanism in the optimistic simulator is
32  realized not by classic state-saving, but by literally allowing to the
33  greatest possible extent events to be reverse. Thus, as models are
34  developed for parallel execution, both the forward and reverse execution
35  code must be written. Currently, both are done by hand. We are
36  investigating automatic methods that are able to generate the reverse
37  execution code using only the forward execution code as input. For more
38  information on ROSS and Reverse Computation we refer the interested reader
39  to [4, 5]. Both of these text are provided as additional reading in the
40  ROSS distribution.
41 
42 @section license_sec License
43 Copyright (c) 2013, Rensselaer Polytechnic Institute
44 All rights reserved.
45 
46 Redistribution and use in source and binary forms, with or without
47 modification, are permitted provided that the following conditions are
48 met:
49 
50  Redistributions of source code must retain the above copyright
51  notice, this list of conditions and the following disclaimer.
52 
53  Redistributions in binary form must reproduce the above copyright
54  notice, this list of conditions and the following disclaimer in the
55  documentation and/or other materials provided with the distribution.
56 
57  Neither the name of Rensselaer Polytechnic Institute nor the names
58  of its contributors may be used to endorse or promote products
59  derived from this software without specific prior written
60  permission.
61 
62 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
63 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
64 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
65 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
66 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
67 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
68 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
69 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
70 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
71 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
72 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
73 
74 */
75 
76 /*******************************************************************
77  * The location of this include is important, as it is outside of *
78  * the __cplusplus check. This is required as the mpi header will *
79  * mess up and complain if we force it into an extern "C" context. *
80  *******************************************************************/
81 #include <mpi.h>
82 
83 #ifdef __cplusplus
84 extern "C" {
85 #endif
86 
87 #ifndef ARRAY_SIZE
88 #define ARRAY_SIZE(a) ( sizeof((a)) / sizeof((a)[0]) )
89 #endif
90 
91 #ifdef __GNUC__
92 # define NORETURN __attribute__((__noreturn__))
93 #else
94 # define NORETURN
95 # ifndef __attribute__
96 # define __attribute__(x)
97 # endif
98 #endif
99 
100 /*********************************************************************
101  *
102  * Include ``standard'' headers that most of ROSS will require.
103  *
104  ********************************************************************/
105 
106 #include "config.h"
107 
108 #include <errno.h>
109 #include <sys/types.h>
110 #include <math.h>
111 #include <limits.h>
112 #include <stdlib.h>
113 #include <unistd.h>
114 #include <string.h>
115 #include <stdio.h>
116 #include <stdarg.h>
117 #include <stdint.h>
118 
119 #if !defined(DBL_MAX)
120 #include <float.h>
121 #endif
122 
123 #include <sys/time.h>
124 #include <time.h>
125 
126 #ifdef USE_BGPM
127 #include<bgpm.h>
128 #endif
129 
130 #ifdef ROSS_INTERNAL
131 #undef malloc
132 #undef calloc
133 #undef realloc
134 #undef strdup
135 #undef free
136 
137 # define malloc(a) must_use_tw_calloc_not_malloc
138 # define calloc(a,b) must_use_tw_calloc_not_calloc
139 # define realloc(a,b) must_use_tw_calloc_not_realloc
140 # define strdup(b) must_use_tw_calloc_not_strdup
141 # define free(b) must_not_use_free
142 #endif
143 
144 // #include "config.h" -- moved to individual files that need them -- e.g., tw-setup.c
145 
146 /* tw_peid -- Processing Element "PE" id */
147 typedef unsigned long tw_peid;
148 
149 /* tw_stime -- Simulation time value for sim clock (NOT wall!) */
150 typedef double tw_stime;
151 #define MPI_TYPE_TW_STIME MPI_DOUBLE
152 #define TW_STIME_CRT(x) (x)
153 #define TW_STIME_DBL(x) (x)
154 #define TW_STIME_CMP(x, y) (((x) < (y)) ? -1 : ((x) > (y)))
155 #define TW_STIME_ADD(x, y) ((x) + (y))
156 #define TW_STIME_MAX DBL_MAX
157 
158 /* tw_lpid -- Logical Process "LP" id */
159 //typedef unsigned long long tw_lpid;
160 typedef uint64_t tw_lpid;
161 
162 
163 #include "buddy.h"
164 #include "ross-random.h"
165 
166 #ifdef ROSS_RAND_clcg4
167 # include "rand-clcg4.h"
168 #endif
169 
170 #ifdef ROSS_CLOCK_i386
171 # include "clock/i386.h"
172 #endif
173 #ifdef ROSS_CLOCK_amd64
174 # include "clock/amd64.h"
175 #endif
176 #ifdef ROSS_CLOCK_ia64
177 # include "clock/ia64.h"
178 #endif
179 #ifdef ROSS_CLOCK_ppc
180 # include "clock/ppc.h"
181 #endif
182 #ifdef ROSS_CLOCK_ppc64le
183 # include "clock/ppc64le.h"
184 #endif
185 #ifdef ROSS_CLOCK_bgl
186 # include "clock/bgl.h"
187 #endif
188 #ifdef ROSS_CLOCK_bgq
189 # include "clock/bgq.h"
190 #endif
191 #ifdef ROSS_CLOCK_aarch64
192 # include "clock/aarch64.h"
193 #endif
194 #ifdef ROSS_CLOCK_armv7l
195 # include "clock/armv7l.h"
196 #endif
197 #ifdef ROSS_CLOCK_gtod
198 # include "clock/gtod.h"
199 #endif
200 
201 #include "tw-timing.h"
202 #include "ross-types.h"
203 #include "tw-opts.h"
204 
205 #ifdef ROSS_NETWORK_mpi
206 # include "network-mpi.h"
207 #endif
208 
209 #include "ross-gvt.h"
210 #include "ross-extern.h"
211 #include "ross-kernel-inline.h"
212 #include "hash-quadratic.h"
213 
214 #include "queue/tw-queue.h"
215 
216 #ifdef ROSS_GVT_7oclock
217 # include "gvt/7oclock.h"
218 #endif
219 #ifdef ROSS_GVT_mpi_allreduce
220 # include "mpi.h"
221 # include "gvt/mpi_allreduce.h"
222 #endif
223 
225 
226 #ifdef USE_DAMARIS
227 #include "damaris/core/damaris.h"
228 #endif
229 
230 #include "tw-eventq.h"
231 
232 #ifdef USE_RIO
233 #include "rio/io.h"
234 #endif
235 
236 #include "ross-inline.h"
237 
238 
239 #ifdef __cplusplus
240 }
241 #endif
242 
243 #endif
double tw_stime
Definition: ross.h:150
Definition of ROSS basic types.
Buddy-system memory allocator.
uint64_t tw_lpid
Definition: ross.h:160
unsigned long tw_peid
Definition: ross.h:147