Skip to content

Commit

Permalink
Remove old GUM/GranSim code
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmar committed Jun 2, 2009
1 parent cfe2fd2 commit dd56e9a
Show file tree
Hide file tree
Showing 43 changed files with 31 additions and 4,164 deletions.
6 changes: 1 addition & 5 deletions compiler/codeGen/SMRep.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -258,16 +258,12 @@ Size of a closure header.

\begin{code}
fixedHdrSize :: WordOff
fixedHdrSize = sTD_HDR_SIZE + profHdrSize + granHdrSize
fixedHdrSize = sTD_HDR_SIZE + profHdrSize
profHdrSize :: WordOff
profHdrSize | opt_SccProfilingOn = pROF_HDR_SIZE
| otherwise = 0
granHdrSize :: WordOff
granHdrSize | opt_GranMacros = gRAN_HDR_SIZE
| otherwise = 0
arrWordsHdrSize :: ByteOff
arrWordsHdrSize = fixedHdrSize*wORD_SIZE + sIZEOF_StgArrWords_NoHdr
Expand Down
3 changes: 0 additions & 3 deletions compiler/main/Constants.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ sTD_HDR_SIZE = STD_HDR_SIZE
pROF_HDR_SIZE :: Int
pROF_HDR_SIZE = PROF_HDR_SIZE
gRAN_HDR_SIZE :: Int
gRAN_HDR_SIZE = GRAN_HDR_SIZE
\end{code}

Size of a double in StgWords.
Expand Down
18 changes: 0 additions & 18 deletions includes/ClosureMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,22 +127,6 @@
#define SET_STATIC_PROF_HDR(ccs)
#endif

#ifdef GRAN
#define SET_GRAN_HDR(c,pe) (c)->header.gran.procs = pe
#define SET_STATIC_GRAN_HDR gran : { procs : Everywhere },
#else
#define SET_GRAN_HDR(c,pe)
#define SET_STATIC_GRAN_HDR
#endif

#ifdef PAR
#define SET_PAR_HDR(c,stuff)
#define SET_STATIC_PAR_HDR(stuff)
#else
#define SET_PAR_HDR(c,stuff)
#define SET_STATIC_PAR_HDR(stuff)
#endif

#ifdef TICKY_TICKY
#define SET_TICKY_HDR(c,stuff) /* old: (c)->header.ticky.updated = stuff */
#define SET_STATIC_TICKY_HDR(stuff) /* old: ticky : { updated : stuff } */
Expand All @@ -154,8 +138,6 @@
#define SET_HDR(c,_info,ccs) \
{ \
(c)->header.info = _info; \
SET_GRAN_HDR((StgClosure *)(c),ThisPE); \
SET_PAR_HDR((StgClosure *)(c),LOCAL_GA); \
SET_PROF_HDR((StgClosure *)(c),ccs); \
SET_TICKY_HDR((StgClosure *)(c),0); \
}
Expand Down
77 changes: 0 additions & 77 deletions includes/Closures.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ typedef struct {
} hp;
} StgProfHeader;

/* -----------------------------------------------------------------------------
The GranSim header
-------------------------------------------------------------------------- */

typedef struct {
StgWord procs; /* bitmask indicating on which PEs this closure resides */
} StgGranHeader;

/* -----------------------------------------------------------------------------
The SMP header
Expand Down Expand Up @@ -63,18 +55,12 @@ typedef struct {
#ifdef PROFILING
StgProfHeader prof;
#endif
#ifdef GRAN
StgGranHeader gran;
#endif
} StgHeader;

typedef struct {
const struct _StgInfoTable* info;
#ifdef PROFILING
StgProfHeader prof;
#endif
#ifdef GRAN
StgGranHeader gran;
#endif
StgSMPThunkHeader smp;
} StgThunkHeader;
Expand Down Expand Up @@ -427,67 +413,4 @@ typedef struct {
StgClosure *alt_code;
} StgCatchRetryFrame;

#if defined(PAR) || defined(GRAN)
/*
StgBlockingQueueElement is a ``collective type'' representing the types
of closures that can be found on a blocking queue: StgTSO, StgRBHSave,
StgBlockedFetch. (StgRBHSave can only appear at the end of a blocking
queue). Logically, this is a union type, but defining another struct
with a common layout is easier to handle in the code.
Note that in the standard setup only StgTSOs can be on a blocking queue.
This is one of the main reasons for slightly different code in files
such as Schedule.c.
*/
typedef struct StgBlockingQueueElement_ {
StgHeader header;
struct StgBlockingQueueElement_ *link; /* next elem in BQ */
struct StgClosure_ *payload[FLEXIBLE_ARRAY];/* contents of the closure */
} StgBlockingQueueElement;

/* only difference to std code is type of the elem in the BQ */
typedef struct StgBlockingQueue_ {
StgHeader header;
struct StgBlockingQueueElement_ *blocking_queue; /* start of the BQ */
} StgBlockingQueue;

/* this closure is hanging at the end of a blocking queue in (see RBH.c) */
typedef struct StgRBHSave_ {
StgHeader header;
StgClosure *payload[FLEXIBLE_ARRAY]; /* 2 words ripped out of the guts of the */
} StgRBHSave; /* closure holding the blocking queue */

typedef struct StgRBH_ {
StgHeader header;
struct StgBlockingQueueElement_ *blocking_queue; /* start of the BQ */
} StgRBH;

#endif

#if defined(PAR)
/* global indirections aka FETCH_ME closures */
typedef struct StgFetchMe_ {
StgHeader header;
globalAddr *ga; /* ptr to unique id for a closure */
} StgFetchMe;

/* same contents as an ordinary StgBlockingQueue */
typedef struct StgFetchMeBlockingQueue_ {
StgHeader header;
struct StgBlockingQueueElement_ *blocking_queue; /* start of the BQ */
} StgFetchMeBlockingQueue;

/* This is an entry in a blocking queue. It indicates a fetch request from a
TSO on another PE demanding the value of this closur. Note that a
StgBlockedFetch can only occur in a BQ. Once the node is evaluated and
updated with the result, the result will be sent back (the PE is encoded
in the globalAddr) and the StgBlockedFetch closure will be nuked.
*/
typedef struct StgBlockedFetch_ {
StgHeader header;
struct StgBlockingQueueElement_ *link; /* next elem in the BQ */
StgClosure *node; /* node to fetch */
globalAddr ga; /* where to send the result to */
} StgBlockedFetch; /* NB: not just a ptr to a GA */
#endif

#endif /* CLOSURES_H */
4 changes: 0 additions & 4 deletions includes/Hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,3 @@ extern void StackOverflowHook (unsigned long stack_size);
extern void OutOfHeapHook (unsigned long request_size, unsigned long heap_size);
extern void MallocFailHook (unsigned long request_size /* in bytes */, char *msg);
extern void defaultsHook (void);
#if defined(PAR)
extern void InitEachPEHook (void);
extern void ShutdownEachPEHook (void);
#endif
67 changes: 0 additions & 67 deletions includes/InfoTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,70 +53,6 @@ typedef struct {
#endif
} StgProfInfo;

/* -----------------------------------------------------------------------------
Parallelism info
-------------------------------------------------------------------------- */

#if 0 && (defined(PAR) || defined(GRAN))

/* CURRENTLY UNUSED
ToDo: use this in StgInfoTable (mutually recursive) -- HWL */

typedef struct {
StgInfoTable *rbh_infoptr; /* infoptr to the RBH */
} StgParInfo;

#endif /* 0 */

/*
Copied from ghc-0.29; ToDo: check this code -- HWL
In the parallel system, all updatable closures have corresponding
revertible black holes. When we are assembly-mangling, we guarantee
that the revertible black hole code precedes the normal entry code, so
that the RBH info table resides at a fixed offset from the normal info
table. Otherwise, we add the RBH info table pointer to the end of the
normal info table and vice versa.
Currently has to use a !RBH_MAGIC_OFFSET setting.
Still todo: init of par.infoptr field in all infotables!!
*/

#if defined(PAR) || defined(GRAN)

# ifdef RBH_MAGIC_OFFSET

# error magic offset not yet implemented

# define RBH_INFO_WORDS 0
# define INCLUDE_RBH_INFO(infoptr)

# define RBH_INFOPTR(infoptr) (((P_)infoptr) - RBH_MAGIC_OFFSET)
# define REVERT_INFOPTR(infoptr) (((P_)infoptr) + RBH_MAGIC_OFFSET)

# else

# define RBH_INFO_WORDS 1
# define INCLUDE_RBH_INFO(info) rbh_infoptr : &(info)

# define RBH_INFOPTR(infoptr) (((StgInfoTable *)(infoptr))->rbh_infoptr)
# define REVERT_INFOPTR(infoptr) (((StgInfoTable *)(infoptr))->rbh_infoptr)

# endif

/* see ParallelRts.h */
/*
EXTFUN(RBH_entry);
StgClosure *convertToRBH(StgClosure *closure);
#if defined(GRAN)
void convertFromRBH(StgClosure *closure);
#elif defined(PAR)
void convertToFetchMe(StgPtr closure, globalAddr *ga);
#endif
*/

#endif

/* -----------------------------------------------------------------------------
Ticky info
Expand Down Expand Up @@ -282,9 +218,6 @@ typedef struct _StgInfoTable {
StgFunPtr entry; /* pointer to the entry code */
#endif

#if defined(PAR) || defined(GRAN)
struct _StgInfoTable *rbh_infoptr;
#endif
#ifdef PROFILING
StgProfInfo prof;
#endif
Expand Down
1 change: 1 addition & 0 deletions includes/README
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Rts.h
StgDLL.h /* stuff related to Windows DLLs */
MachRegs.h /* global register assignments for this arch */
Regs.h /* "registers" in the virtual machine */
TickyCounters.h
StgMiscClosures.h /* decls for closures & info tables in the RTS */
SMP.h /* basic primitives for synchronisation */

Expand Down
19 changes: 0 additions & 19 deletions includes/Rts.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,7 @@ TAG_CLOSURE(StgWord tag,StgClosure * p)
/* Info tables, closures & code fragments defined in the RTS */
#include "StgMiscClosures.h"

/* Simulated-parallel information */
#include "GranSim.h"

/* Parallel information */
#include "Parallel.h"
#include "OSThreads.h"
#include "SMPClosureOps.h"
#include "SpinLock.h"
Expand All @@ -190,9 +186,6 @@ TAG_CLOSURE(StgWord tag,StgClosure * p)
#include "Block.h"
#include "ClosureMacros.h"

/* Ticky-ticky counters */
#include "TickyCounters.h"

/* Runtime-system hooks */
#include "Hooks.h"
#include "RtsMessages.h"
Expand Down Expand Up @@ -287,18 +280,6 @@ TICK_VAR(2)
#define DEBUG_ONLY(s) doNothing()
#endif

#if defined(GRAN) && defined(DEBUG)
#define IF_GRAN_DEBUG(c,s) if (RtsFlags.GranFlags.Debug.c) { s; }
#else
#define IF_GRAN_DEBUG(c,s) doNothing()
#endif

#if defined(PAR) && defined(DEBUG)
#define IF_PAR_DEBUG(c,s) if (RtsFlags.ParFlags.Debug.c) { s; }
#else
#define IF_PAR_DEBUG(c,s) doNothing()
#endif

/* -----------------------------------------------------------------------------
Useful macros and inline functions
-------------------------------------------------------------------------- */
Expand Down
4 changes: 1 addition & 3 deletions includes/RtsConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/*
* Whether the runtime system will use libbfd for debugging purposes.
*/
#if defined(DEBUG) && defined(HAVE_BFD_H) && defined(HAVE_LIBBFD) && !defined(_WIN32) && !defined(PAR) && !defined(GRAN)
#if defined(DEBUG) && defined(HAVE_BFD_H) && defined(HAVE_LIBBFD) && !defined(_WIN32)
#define USING_LIBBFD 1
#endif

Expand Down Expand Up @@ -55,9 +55,7 @@
Signals - supported on non-PAR versions of the runtime. See RtsSignals.h.
-------------------------------------------------------------------------- */

#if !defined(PAR)
#define RTS_USER_SIGNALS 1
#endif

/* Profile spin locks */

Expand Down
Loading

0 comments on commit dd56e9a

Please sign in to comment.