/*
- Time-stamp: <Tue Jan 11 2000 11:29:41 Stardate: [-30]4188.43 hwloidl>
- $Id: GranSim.h,v 1.2 2000/01/13 14:34:00 hwloidl Exp $
+ Time-stamp: <Fri Mar 24 2000 23:55:42 Stardate: [-30]4554.98 hwloidl>
+ $Id: GranSim.h,v 1.4 2004/11/10 04:17:50 wolfgang Exp $
Headers for GranSim specific objects.
run_queue_hd to be relative to CurrentProc. The main arrays of runnable
and blocking queues are defined in Schedule.c. The important STG-called
GranSim macros (e.g. for fetching nodes) are at the end of this
- file. Usually they are just wrappers to proper C functions in GranSim.c. */
+ file. Usually they are just wrappers to proper C functions in GranSim.c.
+*/
#ifndef GRANSIM_H
#define GRANSIM_H
#if !defined(GRAN)
-//Dummy definitions for basic GranSim macros (see GranSim.h)
+/* Dummy definitions for basic GranSim macros called from STG land */
#define DO_GRAN_ALLOCATE(n) /* nothing */
#define DO_GRAN_UNALLOCATE(n) /* nothing */
#define DO_GRAN_FETCH(node) /* nothing */
#if defined(GRAN) /* whole file */
-extern StgTSO *CurrentTSOs[];
+extern StgTSO *CurrentTSO;
//@node Headers for GranSim specific objects, , ,
//@section Headers for GranSim specific objects
//@menu
-//* Includes::
//* Externs and prototypes::
//* Run and blocking queues::
//* Spark queues::
//* STG-called routines::
//@end menu
-//@node Includes, Externs and prototypes, Headers for GranSim specific objects, Headers for GranSim specific objects
-//@subsection Includes
-
-/*
-#include "Closures.h"
-#include "TSO.h"
-#include "Rts.h"
-*/
-
//@node Externs and prototypes, Run and blocking queues, Includes, Headers for GranSim specific objects
//@subsection Externs and prototypes
//@subsection Spark queues
/*
-In GranSim we use a double linked list to represent spark queues.
-
-This is more flexible, but slower, than the array of pointers
-representation used in GUM. We use the flexibility to define new fields in
-the rtsSpark structure, representing e.g. granularity info (see HWL's PhD
-thesis), or info about the parent of a spark.
+ In GranSim we use a double linked list to represent spark queues.
+
+ This is more flexible, but slower, than the array of pointers
+ representation used in GUM. We use the flexibility to define new fields in
+ the rtsSpark structure, representing e.g. granularity info (see HWL's PhD
+ thesis), or info about the parent of a spark.
*/
/* Sparks and spark queues */
typedef struct rtsSpark_
{
StgClosure *node;
- StgInt name, global;
- StgInt gran_info; /* for granularity improvement mechanisms */
+ nat name, global;
+ nat gran_info; /* for granularity improvement mechanisms */
PEs creator; /* PE that created this spark (unused) */
struct rtsSpark_ *prev, *next;
} rtsSpark;
/* Prototypes of those spark routines visible to compiler generated .hc */
/* Routines only used inside the RTS are defined in rts/parallel GranSimRts.h */
rtsSpark *newSpark(StgClosure *node,
- StgInt name, StgInt gran_info, StgInt size_info,
- StgInt par_info, StgInt local);
-void add_to_spark_queue(rtsSpark *spark);
+ nat name, nat gran_info, nat size_info,
+ nat par_info, nat local);
+// void add_to_spark_queue(rtsSpark *spark);
//@node Processor related stuff, GranSim costs, Spark queues, Headers for GranSim specific objects
//@subsection Processor related stuff
//#error MAX_PROC should be 32 on this architecture
//#endif
-#define CurrentTSO CurrentTSOs[CurrentProc]
+// #define CurrentTSO CurrentTSOs[CurrentProc]
/* Processor numbers to bitmasks and vice-versa */
#define MainProc 0 /* Id of main processor */
#define GRAN_YIELD(ptrs) \
{ \
- extern nat context_switch; \
+ extern int context_switch; \
if ( (CurrentTime[CurrentProc]>=EndOfTimeSlice) || \
((CurrentTime[CurrentProc]>=TimeOfNextEvent) && \
(TimeOfNextEvent!=0) && !IgnoreEvents )) { \