From 4d181e1f2d615ed6c5702a34a6d8367ed74f6298 Mon Sep 17 00:00:00 2001 From: adash Date: Thu, 24 Jul 2008 21:22:20 +0000 Subject: [PATCH] Segfault fix in prefetch queue + additional macros for debugging --- Robust/src/Runtime/DSTM/interface/dstm.h | 7 +++++++ Robust/src/Runtime/DSTM/interface/queue.c | 6 +++--- Robust/src/Runtime/DSTM/interface/queue.h | 1 + Robust/src/Runtime/DSTM/interface/sockpool.c | 1 + 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Robust/src/Runtime/DSTM/interface/dstm.h b/Robust/src/Runtime/DSTM/interface/dstm.h index abfcae6b..c97787c3 100644 --- a/Robust/src/Runtime/DSTM/interface/dstm.h +++ b/Robust/src/Runtime/DSTM/interface/dstm.h @@ -12,6 +12,8 @@ #define GET_PTR_OID(x) ((unsigned int *)(x + sizeof(int))) #define GET_PTR_EOFF(x,n) ((short *)(x + sizeof(int) + (n*sizeof(unsigned int)))) #define GET_PTR_ARRYFLD(x,n) ((short *)(x + sizeof(int) + (n*sizeof(unsigned int)) + (n*sizeof(short)))) +#define ENDEBUG(s) { printf("Inside %s()\n", s); fflush(stdout);} +#define EXDEBUG(s) {printf("Outside %s()\n", s); fflush(stdout);} /***************************************** * Coordinator Messages ***************************************/ @@ -77,6 +79,7 @@ #include #include "sockpool.h" #include "prelookup.h" +#include //bit designations for status field of objheader #define DIRTY 0x01 @@ -84,6 +87,9 @@ #define LOCK 0x04 #define LOCAL 0x08 +/*******Global statistics *********/ +extern int numprefetchsites; + #ifdef COMPILER #include "structdefs.h" @@ -283,6 +289,7 @@ prefetchpile_t *foundLocal(char *);// returns node with prefetch elements(oids, int lookupObject(unsigned int * oid, short offset); int transPrefetchProcess(transrecord_t *, int **, short); void sendPrefetchReq(prefetchpile_t*, int); +void sendPrefetchReqnew(prefetchpile_t*, int); int getPrefetchResponse(int); unsigned short getObjType(unsigned int oid); int startRemoteThread(unsigned int oid, unsigned int mid); diff --git a/Robust/src/Runtime/DSTM/interface/queue.c b/Robust/src/Runtime/DSTM/interface/queue.c index 38434dc6..9f2eb419 100644 --- a/Robust/src/Runtime/DSTM/interface/queue.c +++ b/Robust/src/Runtime/DSTM/interface/queue.c @@ -28,15 +28,15 @@ void * getmemory(int size) { while(headoffset #include #include +#include "dstm.h" void queueInit(void); void * getmemory(int size); diff --git a/Robust/src/Runtime/DSTM/interface/sockpool.c b/Robust/src/Runtime/DSTM/interface/sockpool.c index fed260bb..2cb2a241 100644 --- a/Robust/src/Runtime/DSTM/interface/sockpool.c +++ b/Robust/src/Runtime/DSTM/interface/sockpool.c @@ -70,6 +70,7 @@ int createNewSocket(unsigned int mid) { remoteAddr.sin_port = htons(LISTEN_PORT); remoteAddr.sin_addr.s_addr = htonl(mid); if(connect(sd, (struct sockaddr *)&remoteAddr, sizeof(remoteAddr)) < 0) { + perror("socket connect: "); printf("%s(): Error %d connecting to %s:%d\n", __func__, errno, inet_ntoa(remoteAddr.sin_addr), LISTEN_PORT); close(sd); return -1; -- 2.34.1