diff --git a/c_tools/mock/loaders/multidark_loader.cpp b/c_tools/mock/loaders/multidark_loader.cpp index c6cbf79..29bd0af 100644 --- a/c_tools/mock/loaders/multidark_loader.cpp +++ b/c_tools/mock/loaders/multidark_loader.cpp @@ -61,9 +61,6 @@ public: double tempData; - simu->new_attribute("uniqueID", uniqueID, delete_adaptor); - simu->new_attribute("index", index, delete_adaptor); - cout << "loading multidark particles" << endl; long actualNumPart = 0; @@ -96,6 +93,8 @@ public: applyTransformations(simu); simu->NumPart = actualNumPart; simu->TotalNumPart = actualNumPart; + simu->new_attribute("uniqueID", uniqueID, delete_adaptor); + simu->new_attribute("index", index, delete_adaptor); return simu; } }; diff --git a/external/external_build.cmake b/external/external_build.cmake index 029f429..e6b19ac 100644 --- a/external/external_build.cmake +++ b/external/external_build.cmake @@ -334,6 +334,11 @@ IF(SDF_SUPPORT) ) SET(LIBSDF_INCLUDE_PATH ${LIBSDF_PATH}/include) SET(LIBSDF_LIBRARY ${LIBSDF_PATH}/Objfiles/${LIBSDF_ARCH}/libsw.a) + + find_library(RT_LIBRARY rt) + IF (RT_LIBRARY) + SET(LIBSDF_LIBRARY ${LIBSDF_LIBRARY} ${RT_LIBRARY}) + ENDIF (RT_LIBRARY) ENDIF(SDF_SUPPORT) include_directories(${CMAKE_BINARY_DIR}/src diff --git a/external/libsdf/GNUmakefile b/external/libsdf/GNUmakefile index 0997fee..5ade09d 100644 --- a/external/libsdf/GNUmakefile +++ b/external/libsdf/GNUmakefile @@ -20,7 +20,7 @@ all: All # spell them a little differently in this file... include Make-common/Make.generic -subdirs:= libSDF libmpmy +subdirs:= libSDF libmpmy libsw All: for dir in $(subdirs); do (cd $$dir; $(MAKE) ARCH=$(ARCH) all); done diff --git a/external/libsdf/include/libsdf/abm.h b/external/libsdf/include/libsdf/abm.h new file mode 100644 index 0000000..1e54286 --- /dev/null +++ b/external/libsdf/include/libsdf/abm.h @@ -0,0 +1,91 @@ +#ifndef ABM_dot_H +#define ABM_dot_H + +#include "chn.h" +#include "dll.h" +#include "mpmy.h" +#include "timers.h" + +/* Notice that memcpy is a perfectly good ABMpktz_t. Overzealous + compilers will complain because arg2 isn't const and arg3 is an int + rather than a size_t. AAAARRRRGGGGHHHH.... */ +typedef void (ABMpktz_t)(void *to, void *arg, int sz); +typedef void (ABMhndlr_t)(int src, int len, void *ptr); + +typedef struct { + int nfuncs; + ABMhndlr_t **hndlarray; + Dll undeliveredLL; /* An LL of all messages that have been ISent, but + not Test'ed affirmative. */ + int done; /* I hate these! */ + int doc; + int allbitsdone; + int alldone; + Dll *Enqueued; /* array of DLL's, one for each dest */ + int *destarr; /* which of Enqueued are non-empty? */ + int ndests; /* how many of Enqueued are non-empty? */ + int *cntarr; /* how much data for each dest? */ + Chn undelChn; /* chain for undelivereLL */ + Chn QelmtChn; /* chain for all of the Enqueued Dll's */ + MPMY_Comm_request Recv_Hndl; + int tag; + int pktsize; + char *recvbuf1; + char *recvbuf2; + char *recvbufA; + char *recvbufB; +} ABM ; + +#ifdef __cplusplus +extern "C"{ +#endif +/* Set the whole thing up. State goes into abm */ +void ABMSetup(ABM *abm, int pktsize, int tag, int nfuncs, ABMhndlr_t *hndlarray[]); + +/* Post a message of given size. When it's time to deliver it, + the packetizing func will be called-back with the given arg. + When it arrives, the 'handler' hndlarray[type] on the dest node + will be called to process it. */ +void ABMPost(ABM *abm, int dest, int sz, int type, ABMpktz_t *func, void *arg); + +/* Poll for incoming messages. Handlers get called under here. */ +int ABMPoll(ABM *abm); + +/* Poll for incoming messages. But wait until something arrives. */ +int ABMPollWait(ABM *abm); + +/* Flush any Posted messages to dest. Packetizers get called under here. (but + this may be called by ABMPost if we run out of space) */ +void ABMFlush(ABM *abm); + +/* Assert that we won't be sending out any more 'requests' AND that they, + along with any 'cascades' that they may have generated have been received. + This is automatic with a request/reply type protocol, but requires some + kind of ack if messages do not generate a reply to the originator. + See pqsort.c for one way to do the acks. */ +void ABMIamDone(ABM *abm); + +/* Return true if everybody has called ABMIamDone */ +int ABMAllDone(ABM *abm); + +/* Free all memory. Etc. */ +void ABMShutdown(ABM *abm); + +/* Maintain a bunch of 'informative' Counter_t's. They record the number + of bytes sent in messages of logarithmically binned lenths between + lo and hi. */ +void ABMHistEnable(int log2lo, int log2hi); + +#define ABMHISTFIRST 3 /* don't bother with the hist below 8 bytes */ +#define ABMHISTLEN 16 +extern Counter_t ABMIsendCnt; /* How many 'buffers' did we actualy Isend. */ +extern Counter_t ABMPostCnt; /* How many 'messages' did we Post. */ +extern Counter_t ABMByteCnt; /* How many bytes were Isent. */ +extern Counter_t ABMHistCnt[ABMHISTLEN]; + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/external/libsdf/include/libsdf/dll.h b/external/libsdf/include/libsdf/dll.h new file mode 100644 index 0000000..5d510d0 --- /dev/null +++ b/external/libsdf/include/libsdf/dll.h @@ -0,0 +1,90 @@ +#ifndef _DLLdotH_ +#define _DLLdotH_ + +#include "chn.h" + +#ifdef __cplusplus +extern "C"{ +#endif + +typedef struct Dll_elmt_s{ + struct Dll_elmt_s *up, *down; + void *stuff[1]; /* Will be alloc'ed to something else! */ + /* DON'T PUT ANYTHING HERE!!! It will be silently mangleded */ +} Dll_elmt; + +typedef struct { + Dll_elmt Sup, Inf; + Chn *chn; + int length; /* why not? */ +} Dll ; + +/* Create a Chain suitable for passing to DllCreate */ +void DllCreateChn(Chn *chn, int sz, int n); +/* Create a new Dll */ +void DllCreate(Dll *dll, Chn *chn); +/* Terminate a Dll */ +void DllTerminate(Dll *dll); +/* Return a new element just above 'DOWN' */ +Dll_elmt *DllInsertAbove(Dll *dll, Dll_elmt *down); +/* Return a new element just below 'UP' */ +Dll_elmt *DllInsertBelow(Dll *dll, Dll_elmt *up); +/* Delete OLD. Return nothing. */ +void DllDelete(Dll *dll, Dll_elmt *old); +/* Delete OLD. Return the entry that used to be above it. */ +Dll_elmt *DllDeleteUp(Dll *dll, Dll_elmt *old); +/* Delete OLD. Return the entry that used to be below it. */ +Dll_elmt *DllDeleteDown(Dll *dll, Dll_elmt *old); +/* Extract the 'mover' and place it immediately above 'down'. + Like DllDelete, followed by DllInsertAbove, but preserve the + data in the object. */ +void DllMoveAbove(Dll *dll, Dll_elmt *mover, Dll_elmt *down); +/* Extract the 'mover' and place it immediately below 'up'. + Like DllDelete, followed by DllInsertBelow, but preserve the + data in the object. */ +void DllMoveBelow(Dll *dll, Dll_elmt *mover, Dll_elmt *up); + +/* These would require __inline__ to be done properly. */ +/* Insert a new element at the bottom, equivalent to: + DllInsertAbove(dll, DllInf(dll)); */ +Dll_elmt *DllInsertAtBottom(Dll *dll); +/* Insert a new element at the top, equivalent to: + DllInsertBelow(dll, DllSup(dll)); */ +Dll_elmt *DllInsertAtTop(Dll *dll); +/* Move to bottom */ +void DllMoveToBottom(Dll *dll, Dll_elmt *mover); +/* Move to top */ +void DllMoveToTop(Dll *dll, Dll_elmt *mover); + +/* Should we bother with __inline__. These are simple enough that #define + is sufficient. */ + +/* How many elements? */ +int DllLength(Dll *dll); +#define DllLength(dll) ((dll)->length) +/* One past the topmost 'user' element */ +Dll_elmt *DllSup(Dll *dll); +#define DllSup(dll) (&((dll)->Sup)) +/* One below the lowest 'user' element */ +Dll_elmt *DllInf(Dll *dll); +#define DllInf(dll) (&((dll)->Inf)) +/* The highest 'user' element */ +Dll_elmt *DllTop(Dll *dll); +#define DllTop(dll) ((dll)->Sup.down) +/* The lowest 'user' element */ +Dll_elmt *DllBottom(Dll *dll); +#define DllBottom(dll) ((dll)->Inf.up) +/* The 'user' data */ +void *DllData(Dll_elmt *elmt); +#define DllData(elmt) ((void *)((elmt)->stuff)) +/* The next elements, both up and down */ +Dll_elmt *DllUp(Dll_elmt *elmt); +#define DllUp(elmt) ((elmt)->up) +Dll_elmt *DllDown(Dll_elmt *elmt); +#define DllDown(elmt) ((elmt)->down) + +#ifdef __cplusplus +} +#endif + +#endif /* _DLLdotH_ */ diff --git a/external/libsdf/include/libsdf/files.h b/external/libsdf/include/libsdf/files.h new file mode 100644 index 0000000..0b3b78b --- /dev/null +++ b/external/libsdf/include/libsdf/files.h @@ -0,0 +1,19 @@ +#ifndef _FILESdotH +#define _FILESdotH + +#ifdef __cplusplus +extern "C"{ +#endif /* __cplusplus */ +int fexists(const char *name); +int fexists_and_unlink(const char *name); +/* These are advisory routines. They don't actually do anything */ +/* They just check for files named "_ForceOutput_" and "_ForceStop_" */ +int ForceCheckpoint(void); +int ForceOutput(void); +int ForceStop(void); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif + diff --git a/external/libsdf/include/libsdf/gc.h b/external/libsdf/include/libsdf/gc.h new file mode 100644 index 0000000..d3fd667 --- /dev/null +++ b/external/libsdf/include/libsdf/gc.h @@ -0,0 +1,57 @@ +#ifndef _GCdotH +#define _GCdotH + +#include + +/* little functions for doing gray-code stuff. */ + +#ifdef __cplusplus +extern "C"{ +#endif /* __cplusplus */ + +/* Return the parity of num, i.e., parity(0x22)=0 */ +unsigned int parity(unsigned int num); + +/* Return the index of the highest bit in num, i.e., + hibit(3) = 1, hibit(1)=0, hibit(513)=9, hibit(0)=-1 */ +int hibit(unsigned int num); + +/* Return the index of the lowest bit in num, i.e., + lobit(3) = 0, lobit(2)=1, lobit(512)=9, lobit(513)=0, lobit(0)=BITSPERWORD + */ +int lobit(unsigned int num); + +/* Return the integer log2 of the argument. Round down. Return -1 for 0. */ +/* Same as hibit! */ +int ilog2(unsigned int num); + +/* Return the word-wise xor checksum of n bytes in buf. */ +unsigned int cksum(const void *buf, unsigned int n); + +/* Return the number of set bits in num. Is this sometimes called + "popcount"? */ +unsigned int countbits(unsigned int num); + +/* Return the 'up' graycode neighbor of proc (out of nproc) */ +int Gcup(unsigned int proc, unsigned int nproc); + +/* Return the 'down' graycode neighbor of proc (out of nproc) */ +int Gcdown(unsigned int proc, unsigned int nproc); + +/* This isn't really gray-code related, but where else can it go? */ +/* It does the simple-minded "decomposition" of gnobj objects over nproc */ +/* processors. It returns how many to keep and which one to start with. */ +void NobjInitial(int gnobj, int nproc, int procnum, int *nobj, int *start); +void NobjInitial64(int64_t gnobj, int nproc, int procnum, int *nobj, int64_t *start); + +/* These two came from alt.sources */ +/* Return the 'index' of the given gray code (assuming 32-bit longs!) */ +unsigned long gray2bin(unsigned long b); + +/* Return the graycode of a given index */ +unsigned long bin2gray(unsigned long g); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif diff --git a/external/libsdf/include/libsdf/heap.h b/external/libsdf/include/libsdf/heap.h new file mode 100644 index 0000000..9c36356 --- /dev/null +++ b/external/libsdf/include/libsdf/heap.h @@ -0,0 +1,152 @@ +/* Super-fast priority queue. ? Completely inlined by gcc. */ +/* Assume that each pointer points at */ +/* a key, AND whatever else the caller is interested in keeping. */ +#ifndef HEAPdotH +#define HEAPdotH + + +typedef struct{ + const float **arr; + unsigned int sz; + unsigned int cnt; +} Heap; + +#ifdef __cplusplus +extern "C"{ +#endif /* __cplusplus */ +extern void HeapInit(Heap *hp, unsigned int initial_nelem); +extern void HeapTerminate(Heap *hp); +extern void HeapPush(Heap *hp, const float *ptr); +extern void HeapPop(Heap *hp, const float **keyp); +extern const float *HeapPeek(const Heap *hp); +extern const float **HeapBase(const Heap *hp); +extern const float **HeapEnd(const Heap *hp); +extern unsigned int HeapCnt(const Heap *hp); +extern int HeapIsBad(const Heap *hp); +extern const float HeapMinf; +extern const float HeapInf; +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +/* This is an attempt to get the inline functions into the .h file */ +/* without having to maintain two source files. */ +#if (defined(__GNUC__) || defined(__ICC__)) || defined(HEAPdotC) + +#ifndef assert +#include "Assert.h" +#endif +#include +#include +#include "Malloc.h" + +#undef INLINE +#if (defined (__GNUC__) || defined(__ICC__)) && !defined (HEAPdotC) +#define INLINE extern __inline__ +#else +#define INLINE +#endif + +#ifndef NULL +#define NULL (void *)0 +#endif +#ifndef EXIT_SUCCESS +#define EXIT_SUCCESS 0 +#endif + +#if defined(HeapKey) || defined(HeapParent) || defined(HeapLeft) + # error Problems with conflicting definitions in heap.h +#endif +#define HeapKey(i) (*arr[i]) +#define HeapParent(i) (i>>1) +#define HeapLeft(i) (i<<1) +/* Use left+1 for right */ + +INLINE void HeapPush(Heap *hp, const float *ptr){ + const float **arr = hp->arr; + const float *tmp; + unsigned int i = hp->cnt++; + unsigned int pi; + + if( i == hp->sz ){ + unsigned int newsz = (hp->sz)<<1; + arr = hp->arr = Realloc(hp->arr, (newsz+1)*sizeof(*(hp->arr))); + assert(hp->arr); + hp->sz = newsz; + } + + arr[i] = ptr; + pi = HeapParent(i); + while( HeapKey(pi) <= HeapKey(i) ){ + tmp = arr[pi]; + arr[pi] = arr[i]; + arr[i] = tmp; + i = pi; + pi = HeapParent(i); + } +} + +INLINE void HeapPop(Heap *hp, const float **keyp){ + const float **arr = hp->arr; + const float *save; + unsigned int i, li, ri, ix, n; + float kl, kr, ksave, kx; + + *keyp = arr[1]; + n = --hp->cnt; + assert( n>0 ); + i = 1; + li = 2; + ri = 3; + save = arr[n]; + ksave = *save; + arr[n] = &HeapMinf; + while( li < n ){ + kl = HeapKey(li); + kr = HeapKey(ri); + if( kl >= kr ){ + ix = li; + kx = kl; + }else{ + ix = ri; + kx = kr; + } + if( ksave >= kx ){ + break; + } + + /* Move ix up the heap */ + arr[i] = arr[ix]; + i = ix; + li = HeapLeft(ix); + ri = li+1; + } + arr[i] = save; +} + +INLINE const float *HeapPeek(const Heap *hp){ + return hp->arr[1]; +} + +INLINE const float **HeapBase(const Heap *hp){ + return &hp->arr[1]; +} + +INLINE const float **HeapEnd(const Heap *hp){ + return &hp->arr[hp->cnt]; +} + +INLINE unsigned int HeapCnt(const Heap *hp){ + return hp->cnt-1; +} + +/* Undefine our private macros */ +#ifndef HEAPdotC +#undef HeapKey +#undef HeapParent +#undef HeapLeft +#endif /* HEAPdotC */ +#undef INLINE + +#endif /* __GNUC__ || HEAPdotC */ +#endif /* already included */ diff --git a/external/libsdf/include/libsdf/hwclock.h b/external/libsdf/include/libsdf/hwclock.h new file mode 100644 index 0000000..408a38a --- /dev/null +++ b/external/libsdf/include/libsdf/hwclock.h @@ -0,0 +1,3 @@ +double hwclock(void); +double hwtick(void); +void zero_hwclock(void); diff --git a/external/libsdf/include/libsdf/key.h b/external/libsdf/include/libsdf/key.h new file mode 100644 index 0000000..856e532 --- /dev/null +++ b/external/libsdf/include/libsdf/key.h @@ -0,0 +1,524 @@ +#ifndef _KeyDOTh +#define _KeyDOTh + +#include + +/* Should we use long long keys??? + Compiling tree.c (which does a fair amount of key arith), with + LONG_LONG_KEYS turned on results + in 25% shorter sparc code (12k vs. 9k), and 15% shorter i860 code + (14k vs 12k). + + HOWEVER: in both cases, the LONG_LONG_KEYS code does NOT inline + the leftshift and rightshift operators. They are implemented as + calls to ___lshrdi3 and ___lshldi3 in libgcc.a + + The bottom line: TBD. I-cache vs. call overhead, vs. do the __lsh calls + prevent gcc from doing any optimizations across the call? I'd guess + that the LONG_LONG_KEYS are faster. +*/ +#if defined(KEY96BITS) +#define NK 3 +#define _KTYPE unsigned int +#define KEYBITS 94 +#else +#if defined(LONG_NK1_KEY) +#define NK 1 +#define _KTYPE unsigned long int +#else +#if defined(LONG_LONG_KEYS) +#define NK 2 +#define _KTYPE unsigned long long int +#define KEYBITS 94 +#else +#define NK 2 +#define _KTYPE unsigned long int +#define KEYBITS 94 +#endif + +#endif /* LONG_LONG */ +#endif /* ONE_LONG */ + +/* Test for #if FORCE_KEY_ALIGNMENT, not for #ifdef, which gives + the Make.$(ARCH) the opportunity to do -DFORCE_KEY_ALIGNMENT=0 +*/ +#if !defined(FORCE_KEY_ALIGNMENT) && NK==1 +#define FORCE_KEY_ALIGNMENT 1 +#endif + +/* We have to typedef Key_t as a struct, or else we can't return it from */ +/* a function */ +typedef struct { + _KTYPE k[NK]; +} Key_t; + +/* Be careful! KEYBITS is not necessarily where the "body" bit is located */ +#ifndef KEYBITS +#define KEYBITS (CHAR_BIT*sizeof(Key_t)) +#endif + +#ifdef __cplusplus +extern "C"{ +#endif /* __cplusplus */ +extern char *PrintKey(Key_t key); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#if (defined(__GNUC__) || defined(__ICC__)) || defined(KEYdotC) + +#if (__STDC_VERSION__ >= 199901L) && !defined (KEYdotC) +#define INLINE inline +#else +#if (defined (__GNUC__) || defined(__ICC__)) && !defined (KEYdotC) +#define INLINE extern __inline__ +#else +#define INLINE +#endif +#endif + +#if NK==1 + +INLINE int +KeyGT(Key_t key1, Key_t key2) +{ + return (key1.k[0] > key2.k[0]); +} + +INLINE int +KeyLT(Key_t key1, Key_t key2) +{ + return (key1.k[0] < key2.k[0]); +} + +INLINE int +KeyGE(Key_t key1, Key_t key2) +{ + return (key1.k[0] >= key2.k[0]); +} + +INLINE int +KeyLE(Key_t key1, Key_t key2) +{ + return (key1.k[0] <= key2.k[0]); +} + +INLINE int +KeyEQ(Key_t key1, Key_t key2) +{ + return (key1.k[0] == key2.k[0]); +} + +INLINE int +KeyNEQ(Key_t key1, Key_t key2) +{ + return (key1.k[0] != key2.k[0]); +} + +INLINE Key_t +KeyXOR(Key_t key1, Key_t key2) +{ + Key_t ret; + ret.k[0] = key1.k[0] ^ key2.k[0]; + return(ret); +} + +INLINE Key_t +KeyAnd(Key_t key1, Key_t key2) +{ + Key_t ret; + ret.k[0] = key1.k[0] & key2.k[0]; + return(ret); +} + +INLINE Key_t +KeyOr(Key_t key1, Key_t key2) +{ + Key_t ret; + ret.k[0] = key1.k[0] | key2.k[0]; + return(ret); +} + +INLINE int +KeyCmp(Key_t key1, Key_t key2) +{ + if(key1.k[0] > key2.k[0] ) + return 1; + else if( key1.k[0] < key2.k[0] ) + return -1; + else + return 0; +} + +INLINE Key_t +KeyNot(Key_t key1) +{ + key1.k[0] = ~key1.k[0]; + return key1; +} + +INLINE Key_t +KeyRshift(Key_t u, int b) +{ + Key_t ret; + if (b >= CHAR_BIT*sizeof(u.k[0])) ret.k[0] = 0; + else ret.k[0] = u.k[0] >> b; + return(ret); +} + +INLINE Key_t +KeyLshift(Key_t u, int b) +{ + Key_t ret; + ret.k[0] = u.k[0] << b; + return(ret); +} + +/* cast int to Key_t */ +INLINE Key_t +KeyInt(int i) +{ + Key_t ret; + ret.k[0] = i; + return(ret); +} + +INLINE Key_t +KeyOrInt(Key_t u, unsigned int i) +{ + Key_t ret; + ret.k[0] = u.k[0] | i; + return(ret); +} + +/* bitwise and key with int */ +/* This is a common operation, and is more efficient than converting the */ +/* int to a key. It returns an int! */ + +INLINE unsigned int +KeyAndInt(Key_t u, unsigned int i) +{ + return(u.k[0] & i); +} + +/* bitwise and key with ~int */ +/* This is also common operation, and is more efficient than converting the */ +/* int to a key. It returns an Key_t (leaving the top bits alone)! */ + +INLINE Key_t +KeyAndNotInt(Key_t u, unsigned int i) +{ + u.k[0] &= ~((_KTYPE)i); + return u; +} + +INLINE Key_t +KeyAdd(Key_t key1, Key_t key2) +{ + Key_t ret; + + ret.k[0] = key1.k[0] + key2.k[0]; + return(ret); +} + +INLINE Key_t +KeySub(Key_t key1, Key_t key2) +{ + Key_t ret; + + ret.k[0] = key1.k[0] - key2.k[0]; + return(ret); +} + +INLINE Key_t +KeyAddInt(Key_t key1, int i) +{ + Key_t ret; + + ret.k[0] = key1.k[0] + i; + return(ret); +} + +#else +#if NK==2 + +INLINE int +KeyGT(Key_t key1, Key_t key2) +{ + if( key1.k[1] > key2.k[1] ) + return 1; + else if( key1.k[1] < key2.k[1] ) + return 0; + else + return (key1.k[0] > key2.k[0]); +} + +INLINE int +KeyLT(Key_t key1, Key_t key2) +{ + if( key1.k[1] < key2.k[1] ) + return 1; + else if( key1.k[1] > key2.k[1] ) + return 0; + else + return (key1.k[0] < key2.k[0]); +} + +INLINE int +KeyGE(Key_t key1, Key_t key2) +{ + if( key1.k[1] > key2.k[1] ) + return 1; + else if( key1.k[1] < key2.k[1] ) + return 0; + else + return (key1.k[0] >= key2.k[0]); +} + +INLINE int +KeyLE(Key_t key1, Key_t key2) +{ + if( key1.k[1] < key2.k[1] ) + return 1; + else if( key1.k[1] > key2.k[1] ) + return 0; + else + return (key1.k[0] <= key2.k[0]); +} + +INLINE int +KeyEQ(Key_t key1, Key_t key2) +{ + return (key1.k[0] == key2.k[0] && key1.k[1] == key2.k[1]); +} + +INLINE int +KeyNEQ(Key_t key1, Key_t key2) +{ + return (key1.k[0] != key2.k[0] || key1.k[1] != key2.k[1]); +} + +INLINE Key_t +KeyXOR(Key_t key1, Key_t key2) +{ + Key_t ret; + ret.k[0] = key1.k[0] ^ key2.k[0]; + ret.k[1] = key1.k[1] ^ key2.k[1]; + return(ret); +} + +INLINE Key_t +KeyAnd(Key_t key1, Key_t key2) +{ + Key_t ret; + ret.k[0] = key1.k[0] & key2.k[0]; + ret.k[1] = key1.k[1] & key2.k[1]; + return(ret); +} + +INLINE Key_t +KeyOr(Key_t key1, Key_t key2) +{ + Key_t ret; + ret.k[0] = key1.k[0] | key2.k[0]; + ret.k[1] = key1.k[1] | key2.k[1]; + return(ret); +} + +INLINE int +KeyCmp(Key_t key1, Key_t key2) +{ + if(key1.k[1] > key2.k[1] ) + return 1; + else if( key1.k[1] < key2.k[1] ) + return -1; + + if(key1.k[0] > key2.k[0] ) + return 1; + else if( key1.k[0] < key2.k[0] ) + return -1; + return 0; +} + +INLINE Key_t +KeyNot(Key_t key1) +{ + key1.k[0] = ~key1.k[0]; + key1.k[1] = ~key1.k[1]; + return key1; +} + +INLINE Key_t +KeyRshift(Key_t u, int b) +{ + Key_t ret; + long bm = CHAR_BIT*sizeof(u.k[0])-b; + + if (b == 0) { + ret = u; + } else if (bm > 0) { + ret.k[0] = (u.k[0] >> b) | (u.k[1] << bm); + ret.k[1] = u.k[1] >> b; + } else { + ret.k[0] = u.k[1] >> -bm; + ret.k[1] = 0; + } + return(ret); +} + +INLINE Key_t +KeyLshift(Key_t u, int b) +{ + Key_t ret; + long bm = CHAR_BIT*sizeof(u.k[0])-b; + + if (b == 0) { + ret = u; + } else if (bm > 0) { + ret.k[1] = (u.k[1] << b) | (u.k[0] >> bm); + ret.k[0] = u.k[0] << b; + } else { + ret.k[1] = u.k[0] << -bm; + ret.k[0] = 0; + } + return(ret); +} + +/* cast int to Key_t */ +INLINE Key_t +KeyInt(int i) +{ + Key_t ret; + ret.k[1] = 0; + ret.k[0] = i; + return(ret); +} + +INLINE Key_t +KeyOrInt(Key_t u, unsigned int i) +{ + Key_t ret; + ret.k[0] = u.k[0] | i; + ret.k[1] = u.k[1]; + return(ret); +} + +/* bitwise and key with int */ +/* This is a common operation, and is more efficient than converting the */ +/* int to a key. It returns an int! */ + +INLINE unsigned int +KeyAndInt(Key_t u, unsigned int i) +{ + return(u.k[0] & i); +} + +/* bitwise and key with ~int */ +/* This is also common operation, and is more efficient than converting the */ +/* int to a key. It returns an Key_t (leaving the top bits alone)! */ + +INLINE Key_t +KeyAndNotInt(Key_t u, unsigned int i) +{ + u.k[0] &= ~((_KTYPE)i); + return u; +} + +INLINE Key_t +KeyAdd(Key_t key1, Key_t key2) +{ + Key_t ret; + + ret.k[0] = key1.k[0] + key2.k[0]; + ret.k[1] = key1.k[1] + key2.k[1]; + /* We assume keys are unsigned quantities */ + if (ret.k[0] < key1.k[0] || ret.k[0] < key2.k[0]) /* carry */ + ret.k[1]++; + return(ret); +} + +INLINE Key_t +KeySub(Key_t key1, Key_t key2) +{ + Key_t ret; + + ret.k[0] = key1.k[0] - key2.k[0]; + ret.k[1] = key1.k[1] - key2.k[1]; + /* We assume keys are unsigned quantities */ + if (ret.k[0] > key1.k[0] || ret.k[0] > key2.k[0]) /* borrow */ + ret.k[1]--; + return(ret); +} + +INLINE Key_t +KeyAddInt(Key_t key1, int i) +{ + Key_t ret; + + ret.k[0] = key1.k[0] + i; + ret.k[1] = key1.k[1]; + if (i >= 0 && ret.k[0] < key1.k[0]) /* carry */ + ret.k[1]++; + else if (i < 0 && ret.k[0] > key1.k[0]) /* borrow */ + ret.k[1]--; + return(ret); +} + +#else + # error NK must be 1 or 2 +#endif /* NK==2 */ +#endif /* NK==1 */ + +INLINE int +TreeLevel(Key_t key, int ndim) +{ + int level; + int chubits = (KEYBITS-1)/ndim; + Key_t testkey; + + /* First check whether it's a 'body' (at the deepest level.) */ + /* This will save considerable time... */ + testkey = KeyLshift(KeyInt(1), chubits*ndim); + if( KeyEQ( testkey, KeyAnd(testkey, key) ) ) + return chubits; + + /* Now start looking from low levels */ + testkey = KeyInt(1); + for (level = 0; level= pos[i]. The equality + can be a headache for float-to-int conversions! Consider using + InflateBbox and or CubeBbox! */ +void TightBbox(float *pstart, int nobj, int pstride, int ndim, tbbox *bb); + +/* Make the bbox a cube by expanding the smaller dimensions. */ +void CubeBbox(tbbox *bb); + +/* Increase the linear dimension by 'factor' on all sides */ +void InflateBbox(tbbox *bb, float factor); + +/* Return 1 if bb1 completely contains bb2 */ +int ContainsBbox(tbbox *bb1, tbbox *bb2); + +/* Construct bbu, the 'union' of bb1 and bb2 */ +void UnionBbox(tbbox *bb1, tbbox *bb2, tbbox *bbu); + +/* Generate keys for an array of positions (imagine sizeof(body) as the + stride argument!) */ +void GenerateKeys(float *pstart, int nobj, int pstride, tbbox *bb, Key_t *kstart, int kstride, int ordering); +/* This will be set when GenerateKeys detects that a key is out of + bounds. GenerateKeys will not crash and burn, but prudent callers + will check KeyOutOfBounds after calling it. It is cumulative. */ +extern int KeyOutOfBounds; + +/* Replacement for CellCorner: you supply the bbox that describes the + Universe, and we return a bbox that describes the cell */ +void CellBBFromKey(Key_t key, tbbox *bb, tbbox *cellbb, int ordering); + +/* Some primitive building blocks. They can be combined with + KeyFromInts and IntsFromKey to do the full conversion... */ +void IntsFromFloats(const float *x, unsigned int *ix, tbbox *bb, int nbits); +void FloatsFromInts(const int *ix, float *x, tbbox *bb, int nbits); + +/* These two names conflict with physics_generic.c. Good. It will + keep me from using physics_generic.c accidentally. */ +Key_t KeyFromInts(unsigned int *xp, int ndim, int nbits); +int IntsFromKey(Key_t key, unsigned int *ip, int ndim); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif diff --git a/external/libsdf/include/libsdf/lsv.h b/external/libsdf/include/libsdf/lsv.h new file mode 100644 index 0000000..5383e2d --- /dev/null +++ b/external/libsdf/include/libsdf/lsv.h @@ -0,0 +1,27 @@ +#ifndef _LsvDOTh +#define _LsvDOTh + +#define LSV_ANY (-2) + +#ifdef __cplusplus +extern "C"{ +#endif /* __cplusplus */ +extern int LSV_procnum; +extern int LSV_nproc; + +extern char Smy_name[]; /* my hostname or inet address */ + +void Ssend(const void *outb, int outcnt, int dest, int type); +int Srecv_block(void *inb, int size, int type, int *from); +int Srecv(void *inb, int size, int type, int *from); +void Sclose(void); +void Sdiag(int (*)(const char *, ...)); + +void Sinit_host1(int *portp, char **namep); +void Sinit_host(int nproc); +void Sinit_elt(void); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _LsvDOTh */ diff --git a/external/libsdf/include/libsdf/peano.h b/external/libsdf/include/libsdf/peano.h new file mode 100644 index 0000000..854b0a5 --- /dev/null +++ b/external/libsdf/include/libsdf/peano.h @@ -0,0 +1,8 @@ +#ifndef __PeanoDOt_H_ +#define __PeanoDOt_H_ +#include "key.h" + +Key_t PHKeyFromInts(unsigned int ikey[], int ndim, int depth); +unsigned int IntsFromPHKey(Key_t key, unsigned int ikey[], int ndim); + +#endif diff --git a/external/libsdf/include/libsdf/qromo.h b/external/libsdf/include/libsdf/qromo.h new file mode 100644 index 0000000..c3577fc --- /dev/null +++ b/external/libsdf/include/libsdf/qromo.h @@ -0,0 +1,8 @@ +float qromo(float (*func)(float), float a, float b, + float (*choose)(float (*)(float), float, float, int)); +float midpnt(float (*func)(float), float a, float b, int n); + +double qromod(double (*func)(double), double a, double b, + double (*choose)(double (*)(double), double, double, int)); +double midpntd(double (*func)(double), double a, double b, int n); + diff --git a/external/libsdf/include/libsdf/randoms.h b/external/libsdf/include/libsdf/randoms.h new file mode 100644 index 0000000..663eebf --- /dev/null +++ b/external/libsdf/include/libsdf/randoms.h @@ -0,0 +1,26 @@ +#ifndef Randoms2DOTh +#define Randoms2DOTh + +#define NTAB 32 + +typedef struct{ + long idum, idum2; + long iy, iv[NTAB]; + int did_init; + int next_norml_ok; + float next_norml; +} ran_state; + +#ifdef __cplusplus +extern "C"{ +#endif /* __cplusplus */ +void ran_init(int seed, ran_state *st); +float uniform_rand(ran_state *s); +float normal_rand(ran_state *s); +float sphere_rand(ran_state *st, int ndim, float *x); +float cube_rand(ran_state *st, int ndim, float *x); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif diff --git a/external/libsdf/include/libsdf/ring.h b/external/libsdf/include/libsdf/ring.h new file mode 100644 index 0000000..e05717c --- /dev/null +++ b/external/libsdf/include/libsdf/ring.h @@ -0,0 +1,19 @@ +#ifndef _RingDOTh +#define _RingDOTh + +#ifdef __cplusplus +extern "C"{ +#endif /* __cplusplus */ +void Ring(void *bptr, int bsize, int bnobj, + void *optr, int osize, int onobj, int oused, + void initf(void *, void *), void interactf(void *, void *, int, int)); + +void Ring2(void *bptr, int bsize, int bnobj, + void *optr, int osize, int onobj, int tsize, + void initf(void *, void *), void interactf(void *, void *, int, int), void finishf(void *, void *)); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _RingDOTh */ diff --git a/external/libsdf/include/libsdf/stk.h b/external/libsdf/include/libsdf/stk.h new file mode 100644 index 0000000..82512f8 --- /dev/null +++ b/external/libsdf/include/libsdf/stk.h @@ -0,0 +1,192 @@ +#ifndef STKdotH +#define STKdotH + +#include +#include +#include "Malloc.h" + +/* A quick and dirty stack implementation. Less functionality than */ +/* the RMS obstack. Is it faster? */ + +/* We could lift the code from obstack to determine proper alignment, + but I think it's easier to just -Define it in Make.$ARCH */ + +/* Use char * so we can do arithmetic without annoying casts. */ +typedef struct stk{ + char *bottom; + char *ptr; + char *top; + int growby; + void *(*realloc_like)(void *, size_t); + unsigned int align_mask; +} Stk; + +#ifdef __cplusplus +extern "C"{ +#endif /* __cplusplus */ +/* StkInitWithData starts with the given DATA ptr */ +void StkInitWithData(struct stk *s, size_t initial_sz, + void *(*realloc_like)(void *, size_t), void *data, + unsigned int alignment); + +/* StkCopy makes a completely new stack, initialized with the data in FROM */ + +void StkCopy(struct stk *to, const struct stk *from); +/* StkInit initializes a stack. */ +void StkInit(struct stk *s, size_t initial_sz, + void *(*realloc_like)(void *, size_t), unsigned int alignment); + +/* StkGrow adds at least nbytes to the available space in the stack. */ +/* FOR INTERNAL USE ONLY */ +void StkGrow(Stk *s, int nbytes); + +/* StkTerminate frees the space and forget about it forever */ +void StkTerminate(struct stk *s); + +#if !(__STDC_VERSION__ >= 199901L) +/* StkInitEz chooses reasonable defaults. */ +extern void StkInitEz(struct stk *s); + +/* StkPush returns a pointer to room for nbytes at the top of the */ +/* stack. It's up to you to put something there. */ +extern void *StkPush(struct stk *s, int nbytes); +/* The 'Align' version makes sure that the stack remains aligned. + Use if WITH AND ONLY WITH StkPopAlign */ +extern void *StkPushAlign(struct stk *s, int nbytes); + +/* StkPushData does a push and a memcpy */ +extern void *StkPushData(struct stk *s, void *p, int nbytes); + +/* StkPop returns a pointer to the beginning of the nbytes at the */ +/* top of the stack. The data under those bytes is guaranteed to */ +/* remain intact ONLY UNTIL THE NEXT StkPush, i.e., the data has been */ +/* popped. */ +extern void *StkPop(struct stk *s, int nbytes); +/* The 'Align' version makes sure that the stack remains aligned. Use + it IF AND ONLY IF with StkPushAlign was used. NOTE: you must use + the StkPushAlign on the push BEFORE the one that requires alignment! */ +extern void *StkPopAlign(struct stk *s, int nbytes); + +/* StkPeek returns the same thing as StkPop, but it doesn't "pop" anything. */ +/* The top of the stack is found by StkPeek(s, 0); */ +extern void *StkPeek(const struct stk *s, int nbytes); + +/* StkBase returns the current base of the stack. Beware, it can move */ +/* around! It is only guaranteed to stay in place until the next StkPush */ +extern void *StkBase(const struct stk *s); + +/* StkSz is the size of the stack. */ +extern size_t StkSz(const struct stk *s); + +/* StkTop is easily constructed from the others, but we provide it anyway. */ +/* It returns a pointer just past the end of the current stack. */ +extern void *StkTop(const struct stk *s); + +/* StkClear is equivalent to StkPop(s, StkSz(s)), but it returns void */ +extern void StkClear(struct stk *s); + +/* StkCrunch realloc's the stack so it doesn't use any more space */ +/* than necessary. Use it if you know you've reached the high-water-mark */ +extern void *StkCrunch(struct stk *s); + +/* Discover the alignment of a given stack. I.e., how would it */ +extern int StkAlign(const struct stk *s, unsigned int nbytes); + +#endif + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +/* Here's a convenient define for popping a known type. */ +#define StkPopType(s, t) (*(t *)StkPop(s, sizeof(t))) + +#define StkPushType(s, val, t) (*(t *)StkPush(s, sizeof(t)) = val) + +/* StkAlign(n) tells you how many bytes will really be pushed if you */ +/* do a StkPush(n) */ +#ifdef STK_FORCE_ALIGNMENT +#define _STK_DEFAULT_ALIGNMENT STK_FORCE_ALIGNMENT +#else +#define _STK_DEFAULT_ALIGNMENT 1 +#endif + +/* Here are all the inlined definitions. Non-inlined functions */ +/* can go in stk.c */ + +#if (defined(__GNUC__) || defined(__ICC__)) || defined(STKdotC) + +#undef INLINE +#if (__STDC_VERSION__ >= 199901L) && !defined (STKdotC) +#define INLINE inline +#else +#if (defined (__GNUC__) || defined(__ICC__)) && !defined (STKdotC) +#define INLINE extern __inline__ +#else +#define INLINE +#endif +#endif + +INLINE int StkAlign(const struct stk *s, unsigned int nbytes){ + return (nbytes + s->align_mask ) & ~s->align_mask; +} + +INLINE void StkInitEz(struct stk *s){ + StkInit(s, 1024, Realloc_f, _STK_DEFAULT_ALIGNMENT); +} + +INLINE void *StkPush(struct stk *s, int nbytes){ + char *ret; + nbytes = StkAlign(s, nbytes); + + if( s->ptr + nbytes > s->top ){ + StkGrow(s, nbytes); + } + ret = s->ptr; + s->ptr += nbytes; + return ret; +} + +INLINE void *StkPushData(struct stk *s, void *p, int nbytes){ + return memcpy(StkPush(s, nbytes), p, nbytes); +} + +INLINE void *StkPop(struct stk *s, int nbytes){ + nbytes = StkAlign(s, nbytes); +#ifdef NO_CHECK + return s->ptr -= nbytes; +#else + s->ptr -= nbytes; + if( s->ptr < s->bottom ){ + s->ptr += nbytes; /* undo the damage */ + return NULL; + }else + return s->ptr; +#endif +} + +INLINE void *StkPeek(const struct stk *s, int nbytes){ + return s->ptr - nbytes; +} + +INLINE void StkClear(struct stk *s){ + s->ptr = s->bottom; +} + +INLINE void *StkBase(const struct stk *s){ + return s->bottom; +} + +INLINE size_t StkSz(const struct stk *s){ + return s->ptr - s->bottom; +} + +INLINE void *StkTop(const struct stk *s){ + /* NOTE that StkTop is NOT s->top !! */ + return s->ptr; +} + +#undef INLINE +#endif /* GNUC || STKdotC */ + +#endif /* STKdotH */ diff --git a/external/libsdf/include/libsdf/swampi.h b/external/libsdf/include/libsdf/swampi.h new file mode 100644 index 0000000..7a11b93 --- /dev/null +++ b/external/libsdf/include/libsdf/swampi.h @@ -0,0 +1,144 @@ +#ifndef _MpiDOTh +#define _MpiDOTh + +#define MPI_Init SWAMPI_Init +#define MPI_Finalize SWAMPI_Finalize +#define MPI_Abort SWAMPI_Abort +#define MPI_Comm_rank SWAMPI_Comm_rank +#define MPI_Comm_size SWAMPI_Comm_size +#define MPI_Comm_free SWAMPI_Comm_free +#define MPI_Get_count SWAMPI_Get_count +#define MPI_Isend SWAMPI_Isend +#define MPI_Irecv SWAMPI_Irecv +#define MPI_Issend SWAMPI_Isend /* can Isend handle Issends? */ +#define MPI_Test SWAMPI_Test +#define MPI_Wait SWAMPI_Wait +#define MPI_Waitall SWAMPI_Waitall +#define MPI_Send SWAMPI_Send +#define MPI_Recv SWAMPI_Recv +#define MPI_Sendrecv SWAMPI_Sendrecv +#define MPI_Bcast SWAMPI_Bcast +#define MPI_Reduce SWAMPI_Reduce +#define MPI_Allreduce SWAMPI_Allreduce +#define MPI_Barrier SWAMPI_Barrier +#define MPI_Alltoallv SWAMPI_Alltoallv +#define MPI_Alltoall SWAMPI_Alltoall +#define MPI_Comm_dup SWAMPI_Comm_dup +#define MPI_Comm_split SWAMPI_Comm_split +#define MPI_Type_contiguous SWAMPI_Type_contiguous +#define MPI_Type_commit SWAMPI_Type_commit +#define MPI_Wtime SWAMPI_Wtime +#define MPI_Wtick SWAMPI_Wtick + +#ifdef __cplusplus +extern "C"{ +#endif /* __cplusplus */ + +typedef struct { + int MPI_SOURCE; + int MPI_TAG; + int MPI_ERROR; + int count; +} MPI_Status; + +/* MAXLOC and MINLOC structures */ +typedef struct { float x; int i;} MPI_float_int; +typedef struct { double x; int i;} MPI_double_int; +typedef struct { long x; int i;} MPI_long_int; +typedef struct { int x; int i;} MPI_2int; +typedef struct { short x; int i;} MPI_short_int; +typedef struct { long double x; int i;} MPI_long_double_int; + +/* Fortran types */ +typedef struct { float real; float imag; } MPI_complex; +typedef struct { double real; double imag; } MPI_double_complex; + +/* must match MPI_Datasize array in swampi.c */ +typedef enum { + MPI_FLOAT, MPI_DOUBLE, MPI_LONG_DOUBLE, + MPI_BYTE, MPI_CHAR, MPI_SHORT, MPI_INT, + MPI_LONG, MPI_LONG_LONG, + MPI_UNSIGNED, MPI_UNSIGNED_INT, MPI_UNSIGNED_CHAR, + MPI_UNSIGNED_SHORT, MPI_UNSIGNED_LONG, MPI_UNSIGNED_LONG_LONG, + MPI_FLOAT_INT, MPI_DOUBLE_INT, MPI_LONG_INT, + MPI_2INT, MPI_SHORT_INT, MPI_LONG_DOUBLE_INT, + MPI_COMPLEX, MPI_DOUBLE_COMPLEX, /* for Fortran */ + MPI_USER_DATA, _MPI_NUMDATATYPES +} MPI_Datatype; + +typedef enum { + MPI_SUM, MPI_PROD, MPI_MAX, MPI_MIN, MPI_BAND, MPI_BOR, + MPI_BXOR, MPI_LAND, MPI_LOR, MPI_LXOR, MPI_MAXLOC, MPI_MINLOC, + _MPI_NUMOPS +} MPI_Op; + + +typedef void (*MPI_user_comb_func)(void *from1, void *from2, void *to); +typedef int MPI_Comm; +typedef void * MPI_Request; + +enum MPI_comm { MPI_COMM_WORLD, MPI_COMM_PRIVATE, MPI_COMM_NULL }; +enum MPI_src { MPI_ANY_SOURCE = -1 }; +enum MPI_tag { MPI_ANY_TAG = -1 }; +enum MPI_ret { MPI_ERR_OTHER = -1, MPI_SUCCESS = 0 }; + +#define MPI_UNDEFINED (-32766) +#define MPI_REQUEST_NULL ((MPI_Request) 0) + +int MPI_Init(int *argcp, char ***argvp); +int MPI_Finalize(void); +int MPI_Abort(MPI_Comm comm, int errorcode); +int MPI_Comm_rank(MPI_Comm comm, int *rank); +int MPI_Comm_size(MPI_Comm comm, int *size); +int MPI_Get_count(MPI_Status *status, MPI_Datatype type, int *cnt); +int MPI_Isend(void *buf, int cnt, MPI_Datatype type, int dest, int tag, + MPI_Comm comm, MPI_Request *req); +int MPI_Irecv(void *buf, int cnt, MPI_Datatype type, int src, int tag, + MPI_Comm comm, MPI_Request *req); +int MPI_Test(MPI_Request *cptr, int *flag, MPI_Status *stat); +int MPI_Wait(MPI_Request *cptr, MPI_Status *status); +int MPI_Waitall(int count, MPI_Request *reqv, MPI_Status *statusv); +int MPI_Send(void *buf, int cnt, MPI_Datatype type, int dest, int tag, + MPI_Comm comm); +int MPI_Recv(void *buf, int cnt, MPI_Datatype type, int src, int tag, + MPI_Comm comm, MPI_Status *status); +int MPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype, + int dest, int sendtag, void *recvbuf, int recvcount, + MPI_Datatype recvtype, int source, int recvtag, + MPI_Comm comm, MPI_Status *status); +int MPI_Bcast(void *buf, int cnt, MPI_Datatype type, int src, MPI_Comm comm); +int MPI_Reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, + MPI_Op op, int root, MPI_Comm comm); +int MPI_Allreduce(void *sendbuf, void *recvbuf, int count, + MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); +int MPI_Barrier(MPI_Comm comm); +int MPI_Alltoallv(void *sbuf, int *sendcnts, int *sdispls, MPI_Datatype stype, + void *rbuf, int *recvcnts, int *rdispls, MPI_Datatype rtype, + MPI_Comm comm); +int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, int recvcount, MPI_Datatype recvtype, + MPI_Comm comm); +int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm); +int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm); +int MPI_Comm_free(MPI_Comm *comm); +int MPI_Type_contiguous(int len, MPI_Datatype type, MPI_Datatype *ptr); +int MPI_Type_commit(MPI_Datatype *ptr); + +double MPI_Wtime(void); +double MPI_Wtick(void); + +/* These convert the enums to a text description */ +char *mpi_op_name[_MPI_NUMOPS], *mpi_datatype_name[_MPI_NUMDATATYPES]; + +/* These are private for mpi_reduce.c and mpi_bcast.c */ +extern int _MPI_Procnum, _MPI_Nproc; +extern unsigned int *_MPI_Datasize; + +/* These are for mpirun.c */ +void _MPI_init_host1(int *portp, char **namep, int nproc); +void _MPI_init_host(int nproc); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* _MpiDOTh */ diff --git a/external/libsdf/include/libsdf/verify.h b/external/libsdf/include/libsdf/verify.h new file mode 100644 index 0000000..64cb75e --- /dev/null +++ b/external/libsdf/include/libsdf/verify.h @@ -0,0 +1,44 @@ +/* Defines Verify and VerifyX, which verify the truth of the given + expression. Unlike assert, they guarantee that the expression be evaluated + exactly once. Thus, you might say: + + Verify(fp=fopen(name, "w")) + Verify((nwrit=fwrite(p, sz,ni, fp)) >= 0); + VerifyX((nwrit=fwrite(p, sz, ni, fp)) >= 0, Shout("errno=%d, nwrit=%d\n", + errno, nwrit)); + Verify0(stat(path, , &buf)); + Notice that VerifyX allows you to add "Xtra" information in the event of + a failure. +*/ +#undef Verify +#undef VerifyX +/* Is there ever really a good reason to shut this off?? */ +/* You can with -DNVERIFY. */ +# ifndef NVERIFY +#include "error.h" + +#ifndef NO_STRINGIFICATION +/* One can write a really slick version that uses GNU varargs macros, but */ +/* unfortunately, it would break every other pre-processor. It isn't even */ +/* possible to #ifdef __GNUC__ it because the pre-processor complains */ +/* about an incorrect arg count. It might be possible to write it as a */ +/* varargs function, but what's the point? */ +#define VerifyX( expr, xtra) \ + (expr) ? (void)0 : (xtra, Error("%s failed\n" , #expr)) +#define VerifySX( expr, xtra) \ + (expr) ? (void)0 : (xtra, SinglError("%s failed\n" , #expr)) +#else +/* Not only do we not have Stringification, but we assume that we have */ +/* the brain-damaged macro substitution into string constants. */ +#define VerifyX( expr, xtra) \ + (expr) ? (void)0 : (xtra, Error("%s failed\n" , "expr")) +#define VerifySX( expr, xtra) \ + (expr) ? (void)0 : (xtra, SinglError("%s failed\n" , "expr")) +#endif /* NO_STRINGIFICATION */ +# else +# define VerifyX( expr, xtra) ((expr),(void)0) +# endif +#define Verify( expr ) VerifyX(expr, (void)0) +#define VerifyS( expr ) VerifySX(expr, (void)0) +#define Verify0( expr ) Verify(!(expr)) +#define VerifyS0( expr ) VerifyS(!(expr)) diff --git a/external/libsdf/include/libsdf/vop.h b/external/libsdf/include/libsdf/vop.h new file mode 100644 index 0000000..5ec749a --- /dev/null +++ b/external/libsdf/include/libsdf/vop.h @@ -0,0 +1,328 @@ +/* + * Copyright 1991 Michael S. Warren and John K. Salmon. All Rights Reserved. + */ + +#ifndef NDIM + # error NDIM must be defined before reading this file. +#endif + +#if (NDIM!=3) && (NDIM!=2) + #error NDIM must be either 2 or 3 +#endif + +#ifdef __STDC__ +#define GLUE(a,b) a##b +#else +#define GLUE(a,b) a/**/b +#endif + +/* UGLY, but you can use these for parentheses inside the VV macros! */ +#define LPAREN ( +#define RPAREN ) +#define COMMA , +#define Dot(a, b) (VVinfix(a, *b, +)) + +#if (NDIM==3) + +#define Sinfix(s, op) s op s op s +#define Vinfix(a, op) a[0] op a[1] op a[2] +#define VVinfix(a, b, op) a[0] b[0] op a[1] b[1] op a[2] b[2] +/* Usage: printf(Sinfix("%g", " "), Vinfix(pos, COMMA)) */ + +#define VS(a, b) do { \ + a[0] b; \ + a[1] b; \ + a[2] b; \ + } while(0) + +#define VV(a, b) do { \ + a[0] b[0]; \ + a[1] b[1]; \ + a[2] b[2]; \ + } while(0) + +#define VVS(a, b, s) do { \ + a[0] b[0] s; \ + a[1] b[1] s; \ + a[2] b[2] s; \ + } while(0) + +#define VVV(a, b, c) do { \ + a[0] b[0] c[0]; \ + a[1] b[1] c[1]; \ + a[2] b[2] c[2]; \ + } while(0) + +#define VVVV(a, b, c, d) do { \ + a[0] b[0] c[0] d[0]; \ + a[1] b[1] c[1] d[1]; \ + a[2] b[2] c[2] d[2]; \ + } while(0) + + +#define VVVS(a, b, c, s) do { \ + a[0] b[0] c[0] s; \ + a[1] b[1] c[1] s; \ + a[2] b[2] c[2] s; \ + } while(0) + +#define VVVVS(a, b, c, d, s) do { \ + a[0] b[0] c[0] d[0] s; \ + a[1] b[1] c[1] d[1] s; \ + a[2] b[2] c[2] d[2] s; \ + } while(0) + + +#define VVVVV(a, b, c, d, e) do { \ + a[0] b[0] c[0] d[0] e[0]; \ + a[1] b[1] c[1] d[1] e[1]; \ + a[2] b[2] c[2] d[2] e[2]; \ + } while(0) + +#define VVVVVS(a, b, c, d, e, s) do { \ + a[0] b[0] c[0] d[0] e[0] s; \ + a[1] b[1] c[1] d[1] e[1] s; \ + a[2] b[2] c[2] d[2] e[2] s; \ + } while(0) + +#define VVVVVV(a, b, c, d, e, f) do { \ + a[0] b[0] c[0] d[0] e[0] f[0]; \ + a[1] b[1] c[1] d[1] e[1] f[1]; \ + a[2] b[2] c[2] d[2] e[2] f[2]; \ + } while(0) + +/* Eleven args! */ +#define Velv(a, b, c, d, e, f, g, h, i, j, k) do { \ + a[0] b[0] c[0] d[0] e[0] f[0] g[0] h[0] i[0] j[0] k[0]; \ + a[1] b[1] c[1] d[1] e[1] f[1] g[1] h[1] i[1] j[1] k[1]; \ + a[2] b[2] c[2] d[2] e[2] f[2] g[2] h[2] i[2] j[2] k[2]; \ + } while(0) + +/* And a couple of matrix operations to support gsw. */ +#define MS(a, b) do { \ + a[0][0] b; \ + a[0][1] b; \ + a[0][2] b; \ + a[1][0] b; \ + a[1][1] b; \ + a[1][2] b; \ + a[2][0] b; \ + a[2][1] b; \ + a[2][2] b; \ + } while(0) + +#define MVV(a, b, c) do { \ + a[0][0] b[0] c[0]; \ + a[0][1] b[0] c[1]; \ + a[0][2] b[0] c[2]; \ + a[1][0] b[1] c[0]; \ + a[1][1] b[1] c[1]; \ + a[1][2] b[1] c[2]; \ + a[2][0] b[2] c[0]; \ + a[2][1] b[2] c[1]; \ + a[2][2] b[2] c[2]; \ + } while(0) + +#define Vdecl(type, v) type v[NDIM] + +#define Dotx(a, b) \ + (GLUE(a,0)*GLUE(b,0) + GLUE(a,1)*GLUE(b,1) + GLUE(a,2)*GLUE(b,2)) + +/* Use for declarations */ +#define Vxd(a) \ + GLUE(a,0); \ + GLUE(a,1); \ + GLUE(a,2) + +/* Use in prototypes */ +#define Vxp(a) \ + GLUE(a,0), \ + GLUE(a,1), \ + GLUE(a,2) + +#define VxS(a, b) do { \ + GLUE(a,0) b; \ + GLUE(a,1) b; \ + GLUE(a,2) b; \ + } while(0) + +#define VxV(a, b) do { \ + GLUE(a,0) b[0]; \ + GLUE(a,1) b[1]; \ + GLUE(a,2) b[2]; \ + } while(0) + +#define VxdV(a, b) \ + GLUE(a,0) b[0]; \ + GLUE(a,1) b[1]; \ + GLUE(a,2) b[2] + +#define VVx(a, b) do { \ + a[0] GLUE(b,0); \ + a[1] GLUE(b,1); \ + a[2] GLUE(b,2); \ + } while(0) + +#define VxVx(a, b) do { \ + GLUE(a,0) GLUE(b,0); \ + GLUE(a,1) GLUE(b,1); \ + GLUE(a,2) GLUE(b,2); \ + } while(0) + + +#define VxVV(a, b, c) do { \ + GLUE(a,0) b[0] c[0]; \ + GLUE(a,1) b[1] c[1]; \ + GLUE(a,2) b[2] c[2]; \ + } while(0) + +#define VxVVS(a, b, c, s) do { \ + GLUE(a,0) b[0] c[0] s; \ + GLUE(a,1) b[1] c[1] s; \ + GLUE(a,2) b[2] c[2] s; \ + } while(0) + +#define VxVVx(a, b, c) do { \ + GLUE(a,0) b[0] GLUE(c,0); \ + GLUE(a,1) b[1] GLUE(c,1); \ + GLUE(a,2) b[2] GLUE(c,2); \ + } while(0) + +#define VxVxV(a, b, c) do { \ + GLUE(a,0) GLUE(b,0) c[0]; \ + GLUE(a,1) GLUE(b,1) c[1]; \ + GLUE(a,2) GLUE(b,2) c[2]; \ + } while(0) + +#define VxVxVx(a, b, c) do { \ + GLUE(a,0) GLUE(b,0) GLUE(c,0); \ + GLUE(a,1) GLUE(b,1) GLUE(c,1); \ + GLUE(a,2) GLUE(b,2) GLUE(c,2); \ + } while(0) + +#define VVxVx(a, b, c) do{ \ + a[0] GLUE(b,0) GLUE(c,0); \ + a[1] GLUE(b,1) GLUE(c,1); \ + a[2] GLUE(b,2) GLUE(c,2); \ + } while(0) + +#endif /* NDIM == 3 */ + +#if (NDIM==2) + +#define Sinfix(s, op) s op s +#define Vinfix(a, op) a[0] op a[1] +#define VVinfix(a, b, op) a[0] b[0] op a[1] b[1] +/* Usage: printf(Sinfix("%g", " "), Vinfix(pos, COMMA)) */ + +#define VS(a, b) do { \ + a[0] b; \ + a[1] b; \ + } while(0) + +#define VV(a, b) do { \ + a[0] b[0]; \ + a[1] b[1]; \ + } while(0) + +#define VVS(a, b, s) do { \ + a[0] b[0] s; \ + a[1] b[1] s; \ + a[2] b[2] s; \ + } while(0) + +#define VVV(a, b, c) do { \ + a[0] b[0] c[0]; \ + a[1] b[1] c[1]; \ + } while(0) + +#define VVVS(a, b, c, s) do { \ + a[0] b[0] c[0] s; \ + a[1] b[1] c[1] s; \ + } while(0) + +#define VVVVS(a, b, c, d, s) do { \ + a[0] b[0] c[0] d[0] s; \ + a[1] b[1] c[1] d[1] s; \ + } while(0) + +#define VVVV(a, b, c, d) do { \ + a[0] b[0] c[0] d[0]; \ + a[1] b[1] c[1] d[1]; \ + } while(0) + +#define VVVVV(a, b, c, d, e) do { \ + a[0] b[0] c[0] d[0] e[0]; \ + a[1] b[1] c[1] d[1] e[1]; \ + } while(0) + +#define Vdecl(type, v) type v[NDIM] + +#define Dotx(a, b) \ + (GLUE(a,0)*GLUE(b,0) + GLUE(a,1)*GLUE(b,1)) + +#define Vxd(a) \ + GLUE(a,0); \ + GLUE(a,1) + +#define VxS(a, b) do { \ + GLUE(a,0) b; \ + GLUE(a,1) b; \ + } while(0) + +#define VxV(a, b) do { \ + GLUE(a,0) b[0]; \ + GLUE(a,1) b[1]; \ + } while(0) + +#define VxdV(a, b) \ + GLUE(a,0) b[0]; \ + GLUE(a,1) b[1] + +#define VVx(a, b) do { \ + a[0] GLUE(b,0); \ + a[1] GLUE(b,1); \ + } while(0) + +#define VxVx(a, b) do { \ + GLUE(a,0) GLUE(b,0); \ + GLUE(a,1) GLUE(b,1); \ + } while(0) + + +#define VxVV(a, b, c) do { \ + GLUE(a,0) b[0] c[0]; \ + GLUE(a,1) b[1] c[1]; \ + } while(0) + +#define VxVVS(a, b, c, s) do { \ + GLUE(a,0) b[0] c[0] s; \ + GLUE(a,1) b[1] c[1] s; \ + } while(0) + +#define VxVVx(a, b, c) do { \ + GLUE(a,0) b[0] GLUE(c,0); \ + GLUE(a,1) b[1] GLUE(c,1); \ + } while(0) + +#define VxVVS(a, b, c, s) do { \ + GLUE(a,0) b[0] c[0] s; \ + GLUE(a,1) b[1] c[1] s; \ + } while(0) + +#define VVxVx(a, b, c) do{ \ + a[0] GLUE(b,0) GLUE(c,0); \ + a[1] GLUE(b,1) GLUE(c,1); \ + } while(0) + +#define VxVxV(a, b, c) do { \ + GLUE(a,0) GLUE(b,0) c[0]; \ + GLUE(a,1) GLUE(b,1) c[1]; \ + } while(0) + +#define VxVxVx(a, b, c) do { \ + GLUE(a,0) GLUE(b,0) GLUE(c,0); \ + GLUE(a,1) GLUE(b,1) GLUE(c,1); \ + } while(0) + +#endif /* NDIM == 2 */ diff --git a/external/libsdf/libSDF/GNUmakefile b/external/libsdf/libSDF/GNUmakefile index 062b13a..94db107 100644 --- a/external/libsdf/libSDF/GNUmakefile +++ b/external/libsdf/libSDF/GNUmakefile @@ -16,31 +16,56 @@ include $(treedir)/Make-common/Make.$(ARCH) include $(treedir)/Make-common/Make.generic # These rules are slight modifications of the builtin ones -$(objdir)/%.c : %.y - $(YACC.y) $< - mv -f y.tab.c $@ +%.c : %.y + -($(YACC.y) $<; mv -f y.tab.c $@) -$(objdir)/%.c : %.l +%.c : %.l # commands to execute (built-in): - @$(RM) $@ - $(LEX.l) $< > $@ + -($(LEX) $(LEX.L) $<; mv -f lex.yy.c $@) # Makedepends can't pick these up... -$(objdir)/SDF-parse$(objsuf): SDF-private.h $(objdir)/SDF-lex.c $(objdir)/SDF-parse.c - (cd $(objdir); $(CC) $(CFLAGS) -I../../../include -I../.. -c SDF-parse.c) +$(objdir)/SDF-parse$(objsuf): SDF-private.h SDF-lex.c SDF-parse.c + (cd $(objdir); $(CC) $(CFLAGS) -I../../../include/libsdf -I../.. -c ../../SDF-parse.c) # DO NOT DELETE THIS LINE -- make depend depends on it. $(objdir)/SDF-parse$(objsuf): $(objdir)/SDF-parse$(objsuf): -$(objdir)/SDF-parse$(objsuf): $(treedir)/include/libsdf/protos.h -$(objdir)/SDF-parse$(objsuf): $(treedir)/include/libsdf/Msgs.h +$(objdir)/SDF-parse$(objsuf): +$(objdir)/SDF-parse$(objsuf): +$(objdir)/SDF-parse$(objsuf): +$(objdir)/SDF-parse$(objsuf): +$(objdir)/SDF-parse$(objsuf): +$(objdir)/SDF-parse$(objsuf): +$(objdir)/SDF-parse$(objsuf): +$(objdir)/SDF-parse$(objsuf): +$(objdir)/SDF-parse$(objsuf): +$(objdir)/SDF-parse$(objsuf): +$(objdir)/SDF-parse$(objsuf): +$(objdir)/SDF-parse$(objsuf): $(treedir)/include/libsdf/protos.h $(treedir)/include/libsdf/Msgs.h $(objdir)/SDF-parse$(objsuf): $(treedir)/include/libsdf/gccextensions.h SDF-private.h stdio.h $(objdir)/SDF-parse$(objsuf): $(treedir)/include/libsdf/mpmy_io.h $(objdir)/SDF-parse$(objsuf): $(treedir)/include/libsdf/SDF.h $(treedir)/include/libsdf/Malloc.h $(objdir)/SDF-parse$(objsuf): $(treedir)/include/libsdf/error.h SDF-lex.c $(objdir)/SDF-parse$(objsuf): $(objdir)/SDF-parse$(objsuf): +$(objdir)/SDF-parse$(objsuf): +$(objdir)/SDF-parse$(objsuf): +$(objdir)/SDF-parse$(objsuf): +$(objdir)/SDF-parse$(objsuf): +$(objdir)/SDFfuncs$(objsuf): +$(objdir)/SDFfuncs$(objsuf): +$(objdir)/SDFfuncs$(objsuf): +$(objdir)/SDFfuncs$(objsuf): +$(objdir)/SDFfuncs$(objsuf): +$(objdir)/SDFfuncs$(objsuf): +$(objdir)/SDFfuncs$(objsuf): +$(objdir)/SDFfuncs$(objsuf): +$(objdir)/SDFfuncs$(objsuf): +$(objdir)/SDFfuncs$(objsuf): +$(objdir)/SDFfuncs$(objsuf): +$(objdir)/SDFfuncs$(objsuf): +$(objdir)/SDFfuncs$(objsuf): $(objdir)/SDFfuncs$(objsuf): $(objdir)/SDFfuncs$(objsuf): $(objdir)/SDFfuncs$(objsuf): @@ -53,12 +78,35 @@ $(objdir)/SDFfuncs$(objsuf): $(treedir)/include/libsdf/error.h $(treedir)/includ $(objdir)/SDFfuncs$(objsuf): $(treedir)/include/libsdf/mpmy.h $(treedir)/include/libsdf/timers.h $(objdir)/SDFfuncs$(objsuf): $(objdir)/SDFget$(objsuf): stdio.h $(treedir)/include/libsdf/mpmy_io.h -$(objdir)/SDFget$(objsuf): $(treedir)/include/libsdf/error.h $(treedir)/include/libsdf/gccextensions.h -$(objdir)/SDFget$(objsuf): $(treedir)/include/libsdf/SDF.h +$(objdir)/SDFget$(objsuf): +$(objdir)/SDFget$(objsuf): +$(objdir)/SDFget$(objsuf): +$(objdir)/SDFget$(objsuf): +$(objdir)/SDFget$(objsuf): +$(objdir)/SDFget$(objsuf): +$(objdir)/SDFget$(objsuf): +$(objdir)/SDFget$(objsuf): +$(objdir)/SDFget$(objsuf): +$(objdir)/SDFget$(objsuf): $(treedir)/include/libsdf/error.h +$(objdir)/SDFget$(objsuf): $(treedir)/include/libsdf/gccextensions.h $(treedir)/include/libsdf/SDF.h +$(objdir)/SDFhdrio$(objsuf): +$(objdir)/SDFhdrio$(objsuf): +$(objdir)/SDFhdrio$(objsuf): +$(objdir)/SDFhdrio$(objsuf): +$(objdir)/SDFhdrio$(objsuf): +$(objdir)/SDFhdrio$(objsuf): $(objdir)/SDFhdrio$(objsuf): $(objdir)/SDFhdrio$(objsuf): $(treedir)/include/libsdf/Msgs.h $(treedir)/include/libsdf/gccextensions.h $(objdir)/SDFhdrio$(objsuf): $(treedir)/include/libsdf/error.h SDF-private.h -$(objdir)/SDFhdrio$(objsuf): stdio.h -$(objdir)/SDFhdrio$(objsuf): $(treedir)/include/libsdf/mpmy_io.h +$(objdir)/SDFhdrio$(objsuf): +$(objdir)/SDFhdrio$(objsuf): +$(objdir)/SDFhdrio$(objsuf): +$(objdir)/SDFhdrio$(objsuf): +$(objdir)/SDFhdrio$(objsuf): +$(objdir)/SDFhdrio$(objsuf): +$(objdir)/SDFhdrio$(objsuf): +$(objdir)/SDFhdrio$(objsuf): +$(objdir)/SDFhdrio$(objsuf): +$(objdir)/SDFhdrio$(objsuf): stdio.h $(treedir)/include/libsdf/mpmy_io.h $(objdir)/SDFhdrio$(objsuf): $(objdir)/SDFhdrio$(objsuf): $(treedir)/include/libsdf/SDF.h diff --git a/external/libsdf/libSDF/SDF-lex.c b/external/libsdf/libSDF/SDF-lex.c index 4dd8101..0b45156 100644 --- a/external/libsdf/libSDF/SDF-lex.c +++ b/external/libsdf/libSDF/SDF-lex.c @@ -1,5 +1,5 @@ -#line 3 "" +#line 3 "lex.yy.c" #define YY_INT_ALIGNED short int @@ -53,7 +53,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -84,6 +83,8 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -140,7 +141,15 @@ typedef unsigned int flex_uint32_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -607,7 +616,7 @@ void SDFlexprepare(void){ #else /* Not FLEX_SCANNER */ void SDFlexprepare(void){} #endif -#line 611 "" +#line 620 "lex.yy.c" #define INITIAL 0 @@ -688,7 +697,12 @@ static int input (void ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -696,7 +710,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO fwrite( yytext, yyleng, 1, yyout ) +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -707,7 +721,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - int n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -791,7 +805,7 @@ YY_DECL #line 60 "SDF-lex.l" -#line 795 "" +#line 809 "lex.yy.c" if ( !(yy_init) ) { @@ -1054,7 +1068,7 @@ YY_RULE_SETUP #line 140 "SDF-lex.l" ECHO; YY_BREAK -#line 1058 "" +#line 1072 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1812,8 +1826,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ diff --git a/external/libsdf/libSDF/SDF-parse.c b/external/libsdf/libSDF/SDF-parse.c index 0e8c1e3..f1a2fc7 100644 --- a/external/libsdf/libSDF/SDF-parse.c +++ b/external/libsdf/libSDF/SDF-parse.c @@ -1,24 +1,21 @@ -/* A Bison parser, made by GNU Bison 2.3. */ +/* A Bison parser, made by GNU Bison 2.5. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify +/* Bison implementation for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -29,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -47,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.3" +#define YYBISON_VERSION "2.5" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -55,41 +52,20 @@ /* Pure parsers. */ #define YYPURE 0 +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + /* Using locations. */ #define YYLSP_NEEDED 0 -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - STRUCT = 258, - NAME = 259, - TYPE = 260, - CONST = 261, - VALUEPARAM = 262, - PARAMETER = 263, - EOHDR = 264, - LEXERROR = 265 - }; -#endif -/* Tokens. */ -#define STRUCT 258 -#define NAME 259 -#define TYPE 260 -#define CONST 261 -#define VALUEPARAM 262 -#define PARAMETER 263 -#define EOHDR 264 -#define LEXERROR 265 - - - - /* Copy the first part of user declarations. */ + +/* Line 268 of yacc.c */ #line 1 "SDF-parse.y" /* @@ -168,6 +144,9 @@ static int finish_parse(void); +/* Line 268 of yacc.c */ +#line 149 "y.tab.c" + /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 @@ -186,10 +165,43 @@ static int finish_parse(void); # define YYTOKEN_TABLE 0 #endif + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + STRUCT = 258, + NAME = 259, + TYPE = 260, + CONST = 261, + VALUEPARAM = 262, + PARAMETER = 263, + EOHDR = 264, + LEXERROR = 265 + }; +#endif +/* Tokens. */ +#define STRUCT 258 +#define NAME 259 +#define TYPE 260 +#define CONST 261 +#define VALUEPARAM 262 +#define PARAMETER 263 +#define EOHDR 264 +#define LEXERROR 265 + + + + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 90 "SDF-parse.y" { + +/* Line 293 of yacc.c */ +#line 90 "SDF-parse.y" + enum SDF_type_enum type; enum value_param_enum valueparam; char *string; @@ -198,22 +210,23 @@ typedef union YYSTYPE dcl_list_t dcl_list; one_dcl_t one_dcl; const_list_t const_list; -} -/* Line 193 of yacc.c. */ -#line 204 "y.tab.c" - YYSTYPE; + + + +/* Line 293 of yacc.c */ +#line 218 "y.tab.c" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 #endif - /* Copy the second part of user declarations. */ -/* Line 216 of yacc.c. */ -#line 217 "y.tab.c" +/* Line 343 of yacc.c */ +#line 230 "y.tab.c" #ifdef short # undef short @@ -263,7 +276,7 @@ typedef short int yytype_int16; #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ -# if YYENABLE_NLS +# if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) @@ -288,14 +301,14 @@ typedef short int yytype_int16; #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int -YYID (int i) +YYID (int yyi) #else static int -YYID (i) - int i; +YYID (yyi) + int yyi; #endif { - return i; + return yyi; } #endif @@ -316,11 +329,11 @@ YYID (i) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # endif @@ -343,24 +356,24 @@ YYID (i) # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined _STDLIB_H \ +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif @@ -376,9 +389,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss; - YYSTYPE yyvs; - }; + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; +}; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) @@ -389,6 +402,27 @@ union yyalloc ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) +# define YYCOPY_NEEDED 1 + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY @@ -406,24 +440,7 @@ union yyalloc while (YYID (0)) # endif # endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif +#endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 13 @@ -520,7 +537,7 @@ static const char *const yytname[] = "$end", "error", "$undefined", "STRUCT", "NAME", "TYPE", "CONST", "VALUEPARAM", "PARAMETER", "EOHDR", "LEXERROR", "';'", "'='", "'['", "']'", "'{'", "'}'", "','", "$accept", "hdr", "hdr1", "stmt", - "declaration", "many_typed_dcl_list", "typed_dcl_list", "@1", + "declaration", "many_typed_dcl_list", "typed_dcl_list", "$@1", "comma_sep_dcls", "dcl1", "const_lst", "comma_sep_consts", 0 }; #endif @@ -551,8 +568,8 @@ static const yytype_uint8 yyr2[] = 1, 4, 3, 1, 3, 1, 3 }; -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero +/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { @@ -591,8 +608,7 @@ static const yytype_int8 yypgoto[] = /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ + number is the opposite. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { @@ -603,6 +619,12 @@ static const yytype_uint8 yytable[] = 0, 47, 0, 0, 38 }; +#define yypact_value_is_default(yystate) \ + ((yystate) == (-14)) + +#define yytable_value_is_error(yytable_value) \ + YYID (0) + static const yytype_int8 yycheck[] = { 10, 5, 15, 6, 6, 0, 6, 16, 17, 7, @@ -635,9 +657,18 @@ static const yytype_uint8 yystos[] = /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ + Once GCC version 2 has supplanted version 1, this can go. However, + YYFAIL appears to be in use. Nevertheless, it is formally deprecated + in Bison 2.4.2's NEWS entry, where a plan to phase it out is + discussed. */ #define YYFAIL goto yyerrlab +#if defined YYFAIL + /* This is here to suppress warnings from the GCC cpp's + -Wunused-macros. Normally we don't worry about that warning, but + some users do, and we want to make it easy for users to remove + YYFAIL uses, which will produce warnings from Bison 2.5. */ +#endif #define YYRECOVERING() (!!yyerrstatus) @@ -647,7 +678,6 @@ do \ { \ yychar = (Token); \ yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ @@ -689,19 +719,10 @@ while (YYID (0)) #endif -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ +/* This macro is provided for backward compatibility. */ #ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif @@ -805,17 +826,20 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) #else static void -yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; +yy_stack_print (yybottom, yytop) + yytype_int16 *yybottom; + yytype_int16 *yytop; #endif { YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } YYFPRINTF (stderr, "\n"); } @@ -849,11 +873,11 @@ yy_reduce_print (yyvsp, yyrule) /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { - fprintf (stderr, " $%d = ", yyi + 1); + YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) ); - fprintf (stderr, "\n"); + YYFPRINTF (stderr, "\n"); } } @@ -890,7 +914,6 @@ int yydebug; # define YYMAXDEPTH 10000 #endif - #if YYERROR_VERBOSE @@ -993,115 +1016,142 @@ yytnamerr (char *yyres, const char *yystr) } # endif -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) { - int yyn = yypact[yystate]; + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = 0; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else + /* There are many possibilities here to consider: + - Assume YYFAIL is not used. It's too flawed to consider. See + + for details. YYERROR is fine as it does not invoke this + function. + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } } + + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } + + yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; } #endif /* YYERROR_VERBOSE */ - /*-----------------------------------------------. | Release the memory associated to this symbol. | @@ -1133,10 +1183,9 @@ yydestruct (yymsg, yytype, yyvaluep) break; } } - + /* Prevent warnings from -Wmissing-prototypes. */ - #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); @@ -1152,18 +1201,16 @@ int yyparse (); #endif /* ! YYPARSE_PARAM */ - -/* The look-ahead symbol. */ +/* The lookahead symbol. */ int yychar; -/* The semantic value of the look-ahead symbol. */ +/* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; - /*----------. | yyparse. | `----------*/ @@ -1190,14 +1237,37 @@ yyparse () #endif #endif { - - int yystate; + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYSIZE_T yystacksize; + int yyn; int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; + /* Lookahead token as an internal (translated) token number. */ + int yytoken; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; @@ -1205,51 +1275,28 @@ yyparse () YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; + yytoken = 0; + yyss = yyssa; + yyvs = yyvsa; + yystacksize = YYINITDEPTH; + YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss; yyvsp = yyvs; @@ -1279,7 +1326,6 @@ yyparse () YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; - /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might @@ -1287,7 +1333,6 @@ yyparse () yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); yyss = yyss1; @@ -1310,9 +1355,8 @@ yyparse () (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); @@ -1323,7 +1367,6 @@ yyparse () yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; - YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); @@ -1333,6 +1376,9 @@ yyparse () YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + if (yystate == YYFINAL) + YYACCEPT; + goto yybackup; /*-----------. @@ -1341,16 +1387,16 @@ yyparse () yybackup: /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ + lookahead token if we need one and don't already have one. */ - /* First try to decide what to do without reference to look-ahead token. */ + /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) + if (yypact_value_is_default (yyn)) goto yydefault; - /* Not known => get a look-ahead token if don't already have one. */ + /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -1376,26 +1422,22 @@ yybackup: yyn = yytable[yyn]; if (yyn <= 0) { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; + if (yytable_value_is_error (yyn)) + goto yyerrlab; yyn = -yyn; goto yyreduce; } - if (yyn == YYFINAL) - YYACCEPT; - /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; - /* Shift the look-ahead token. */ + /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the shifted token unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; + /* Discard the shifted token. */ + yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; @@ -1435,46 +1477,64 @@ yyreduce: switch (yyn) { case 2: + +/* Line 1806 of yacc.c */ #line 101 "SDF-parse.y" {if(finish_parse()) YYERROR;} break; case 3: + +/* Line 1806 of yacc.c */ #line 102 "SDF-parse.y" {if(finish_parse()) YYERROR; else YYACCEPT;} break; case 4: + +/* Line 1806 of yacc.c */ #line 103 "SDF-parse.y" {YYERROR;} break; case 7: + +/* Line 1806 of yacc.c */ #line 110 "SDF-parse.y" {if(data_dcl((yyvsp[(1) - (2)].declaration))) YYERROR;} break; case 8: + +/* Line 1806 of yacc.c */ #line 111 "SDF-parse.y" {if(const_dcl((yyvsp[(1) - (4)].declaration), (yyvsp[(3) - (4)].const_list))) YYERROR;} break; case 9: + +/* Line 1806 of yacc.c */ #line 112 "SDF-parse.y" {if(do_value_param((yyvsp[(2) - (5)].valueparam), (yyvsp[(4) - (5)].constant))) YYERROR;} break; case 10: + +/* Line 1806 of yacc.c */ #line 115 "SDF-parse.y" {(yyval.declaration).dcl_list = (yyvsp[(1) - (1)].dcl_list); (yyval.declaration).Nrec = 1;} break; case 11: + +/* Line 1806 of yacc.c */ #line 116 "SDF-parse.y" {(yyval.declaration).dcl_list=(yyvsp[(3) - (5)].dcl_list); (yyval.declaration).Nrec=1;} break; case 12: + +/* Line 1806 of yacc.c */ #line 118 "SDF-parse.y" { if( (yyvsp[(7) - (8)].constant).type != SDF_INT64 ){ @@ -1487,16 +1547,22 @@ yyreduce: break; case 13: + +/* Line 1806 of yacc.c */ #line 127 "SDF-parse.y" { (yyval.declaration).dcl_list = (yyvsp[(3) - (7)].dcl_list); (yyval.declaration).Nrec = 0;} break; case 14: + +/* Line 1806 of yacc.c */ #line 130 "SDF-parse.y" {(yyval.dcl_list) = (yyvsp[(1) - (1)].dcl_list);} break; case 15: + +/* Line 1806 of yacc.c */ #line 132 "SDF-parse.y" { int sz; @@ -1510,16 +1576,22 @@ yyreduce: break; case 16: + +/* Line 1806 of yacc.c */ #line 143 "SDF-parse.y" {curtype = (yyvsp[(1) - (1)].type);} break; case 17: + +/* Line 1806 of yacc.c */ #line 143 "SDF-parse.y" {(yyval.dcl_list) = (yyvsp[(3) - (3)].dcl_list);} break; case 18: + +/* Line 1806 of yacc.c */ #line 147 "SDF-parse.y" { obstack_begin(&(yyval.dcl_list).obs, 16*sizeof((yyvsp[(1) - (1)].one_dcl))); @@ -1529,6 +1601,8 @@ yyreduce: break; case 19: + +/* Line 1806 of yacc.c */ #line 153 "SDF-parse.y" { (yyval.dcl_list) = (yyvsp[(1) - (3)].dcl_list); @@ -1538,11 +1612,15 @@ yyreduce: break; case 20: + +/* Line 1806 of yacc.c */ #line 160 "SDF-parse.y" {(yyval.one_dcl).name = (yyvsp[(1) - (1)].string); (yyval.one_dcl).type = curtype; (yyval.one_dcl).arrcnt = 1;} break; case 21: + +/* Line 1806 of yacc.c */ #line 162 "SDF-parse.y" { if( (yyvsp[(3) - (4)].constant).type != SDF_INT64 ){ @@ -1555,11 +1633,15 @@ yyreduce: break; case 22: + +/* Line 1806 of yacc.c */ #line 170 "SDF-parse.y" {(yyval.one_dcl).name=(yyvsp[(1) - (3)].string); (yyval.one_dcl).type=curtype; (yyval.one_dcl).arrcnt = 0;} break; case 23: + +/* Line 1806 of yacc.c */ #line 174 "SDF-parse.y" { (yyval.const_list).nconst = 1; @@ -1569,11 +1651,15 @@ yyreduce: break; case 24: + +/* Line 1806 of yacc.c */ #line 179 "SDF-parse.y" {(yyval.const_list) = (yyvsp[(2) - (3)].const_list);} break; case 25: + +/* Line 1806 of yacc.c */ #line 183 "SDF-parse.y" { (yyval.const_list).nconst = 1; @@ -1583,6 +1669,8 @@ yyreduce: break; case 26: + +/* Line 1806 of yacc.c */ #line 189 "SDF-parse.y" { (yyval.const_list) = (yyvsp[(1) - (3)].const_list); @@ -1592,10 +1680,22 @@ yyreduce: break; -/* Line 1267 of yacc.c. */ -#line 1597 "y.tab.c" + +/* Line 1806 of yacc.c */ +#line 1686 "y.tab.c" default: break; } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); @@ -1604,7 +1704,6 @@ yyreduce: *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -1624,6 +1723,10 @@ yyreduce: | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { @@ -1631,37 +1734,36 @@ yyerrlab: #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; } +# undef YYSYNTAX_ERROR #endif } @@ -1669,7 +1771,7 @@ yyerrlab: if (yyerrstatus == 3) { - /* If just tried and failed to reuse look-ahead token after an + /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) @@ -1686,7 +1788,7 @@ yyerrlab: } } - /* Else will try to reuse look-ahead token after shifting the error + /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; @@ -1720,7 +1822,7 @@ yyerrlab1: for (;;) { yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) + if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) @@ -1743,9 +1845,6 @@ yyerrlab1: YY_STACK_PRINT (yyss, yyssp); } - if (yyn == YYFINAL) - YYACCEPT; - *++yyvsp = yylval; @@ -1770,7 +1869,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#ifndef yyoverflow +#if !defined(yyoverflow) || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -1781,9 +1880,14 @@ yyexhaustedlab: #endif yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); + if (yychar != YYEMPTY) + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + } /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -1807,6 +1911,8 @@ yyreturn: } + +/* Line 2067 of yacc.c */ #line 196 "SDF-parse.y" static int SDFlineno; @@ -1835,11 +1941,15 @@ main(int argc, char **argv) } #endif -static int SDF_iomode = SDF_SYNC; +static int SDF_iomode = MPMY_RDONLY | MPMY_MULTI; -void SDF_Setiomode(int mode) +void SDFsetiomode(int mode) { - SDF_iomode = mode; + if (mode == SDF_SINGL) { + SDF_iomode = MPMY_RDONLY | MPMY_SINGL; + } else { + SDF_iomode = MPMY_RDONLY | MPMY_MULTI; + } } @@ -1914,7 +2024,7 @@ static int finish_parse(void) /* cur_hdr->datafp = MPMY_Fopen(Dataname, MPMY_RDONLY); */ /* If we come up with a better model for IO, call it here.. */ - cur_hdr->datafp = MPMY_Fopen(Dataname, MPMY_RDONLY | MPMY_MULTI); + cur_hdr->datafp = MPMY_Fopen(Dataname, SDF_iomode); Msgf(("cur_hdr->datafp = %p\n", cur_hdr->datafp)); diff --git a/external/libsdf/libmpmy/GNUmakefile b/external/libsdf/libmpmy/GNUmakefile index 1d4bd32..69ab885 100644 --- a/external/libsdf/libmpmy/GNUmakefile +++ b/external/libsdf/libmpmy/GNUmakefile @@ -68,39 +68,84 @@ endif # DO NOT DELETE THIS LINE -- make depend depends on it. $(objdir)/mpmy_seq$(objsuf): -$(objdir)/mpmy_seq$(objsuf): $(treedir)/include/libsdf/Msgs.h -$(objdir)/mpmy_seq$(objsuf): $(treedir)/include/libsdf/gccextensions.h $(treedir)/include/libsdf/mpmy.h -$(objdir)/mpmy_seq$(objsuf): $(treedir)/include/libsdf/timers.h +$(objdir)/mpmy_seq$(objsuf): +$(objdir)/mpmy_seq$(objsuf): +$(objdir)/mpmy_seq$(objsuf): +$(objdir)/mpmy_seq$(objsuf): $(treedir)/include/libsdf/Msgs.h $(treedir)/include/libsdf/gccextensions.h +$(objdir)/mpmy_seq$(objsuf): $(treedir)/include/libsdf/mpmy.h $(treedir)/include/libsdf/timers.h +$(objdir)/mpmy_seq$(objsuf): $(objdir)/mpmy_seq$(objsuf): $(treedir)/include/libsdf/Assert.h $(treedir)/include/libsdf/error.h -$(objdir)/mpmy_seq$(objsuf): $(treedir)/include/libsdf/mpmy_io.h $(treedir)/include/libsdf/mpmy_time.h +$(objdir)/mpmy_seq$(objsuf): $(treedir)/include/libsdf/mpmy_io.h +$(objdir)/mpmy_seq$(objsuf): +$(objdir)/mpmy_seq$(objsuf): +$(objdir)/mpmy_seq$(objsuf): +$(objdir)/mpmy_seq$(objsuf): +$(objdir)/mpmy_seq$(objsuf): +$(objdir)/mpmy_seq$(objsuf): +$(objdir)/mpmy_seq$(objsuf): +$(objdir)/mpmy_seq$(objsuf): $(treedir)/include/libsdf/mpmy_time.h $(objdir)/mpmy_seq$(objsuf): $(treedir)/include/libsdf/mpmy_abnormal.h timers_hwclock.c -$(objdir)/mpmy_seq$(objsuf): $(treedir)/include/libsdf/Malloc.h -$(objdir)/mpmy_seq$(objsuf): $(treedir)/include/libsdf/chn.h mpmy_io.c +$(objdir)/mpmy_seq$(objsuf): $(treedir)/include/libsdf/Malloc.h $(treedir)/include/libsdf/chn.h +$(objdir)/mpmy_seq$(objsuf): mpmy_io.c $(objdir)/mpmy_seq$(objsuf): $(objdir)/mpmy_seq$(objsuf): $(objdir)/mpmy_seq$(objsuf): $(objdir)/mpmy_seq$(objsuf): -$(objdir)/mpmy_seq$(objsuf): $(treedir)/include/libsdf/protos.h iozero.h -$(objdir)/mpmy_seq$(objsuf): iozero.c io_generic.c mpmy_abnormal.c $(objdir)/mpmy_seq$(objsuf): -$(objdir)/mpmy_seq$(objsuf): $(treedir)/include/libsdf/singlio.h -$(objdir)/mpmy_seq$(objsuf): mpmy_generic.c +$(objdir)/mpmy_seq$(objsuf): +$(objdir)/mpmy_seq$(objsuf): +$(objdir)/mpmy_seq$(objsuf): +$(objdir)/mpmy_seq$(objsuf): +$(objdir)/mpmy_seq$(objsuf): +$(objdir)/mpmy_seq$(objsuf): $(treedir)/include/libsdf/protos.h +$(objdir)/mpmy_seq$(objsuf): iozero.h iozero.c io_generic.c mpmy_abnormal.c +$(objdir)/mpmy_seq$(objsuf): +$(objdir)/mpmy_seq$(objsuf): +$(objdir)/mpmy_seq$(objsuf): +$(objdir)/mpmy_seq$(objsuf): +$(objdir)/mpmy_seq$(objsuf): +$(objdir)/mpmy_seq$(objsuf): +$(objdir)/mpmy_seq$(objsuf): +$(objdir)/mpmy_seq$(objsuf): $(treedir)/include/libsdf/singlio.h mpmy_generic.c $(objdir)/mpmy_mpi$(objsuf): $(treedir)/include/libsdf/mpmy_abnormal.h $(objdir)/mpmy_mpi$(objsuf): $(treedir)/include/libsdf/gccextensions.h $(objdir)/mpmy_mpi$(objsuf): $(treedir)/include/libsdf/Malloc.h $(treedir)/include/libsdf/error.h -$(objdir)/mpmy_mpi$(objsuf): $(treedir)/include/libsdf/chn.h $(treedir)/include/libsdf/Assert.h -$(objdir)/mpmy_mpi$(objsuf): $(treedir)/include/libsdf/mpmy.h $(treedir)/include/libsdf/timers.h +$(objdir)/mpmy_mpi$(objsuf): $(treedir)/include/libsdf/chn.h $(treedir)/include/libsdf/mpmy.h +$(objdir)/mpmy_mpi$(objsuf): $(treedir)/include/libsdf/timers.h $(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): $(treedir)/include/libsdf/Assert.h $(objdir)/mpmy_mpi$(objsuf): $(treedir)/include/libsdf/Msgs.h $(treedir)/include/libsdf/memfile.h $(objdir)/mpmy_mpi$(objsuf): timers_hwclock.c -$(objdir)/mpmy_mpi$(objsuf): $(treedir)/include/libsdf/mpmy_time.h -$(objdir)/mpmy_mpi$(objsuf): mpmy_mpiio.c +$(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): $(treedir)/include/libsdf/mpmy_time.h mpmy_mpiio.c $(objdir)/mpmy_mpi$(objsuf): $(objdir)/mpmy_mpi$(objsuf): $(objdir)/mpmy_mpi$(objsuf): $(objdir)/mpmy_mpi$(objsuf): $(objdir)/mpmy_mpi$(objsuf): -$(objdir)/mpmy_mpi$(objsuf): $(treedir)/include/libsdf/protos.h -$(objdir)/mpmy_mpi$(objsuf): $(treedir)/include/libsdf/mpmy_io.h io_generic.c mpmy_abnormal.c +$(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): $(treedir)/include/libsdf/protos.h $(treedir)/include/libsdf/mpmy_io.h +$(objdir)/mpmy_mpi$(objsuf): io_generic.c mpmy_abnormal.c +$(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): +$(objdir)/mpmy_mpi$(objsuf): $(objdir)/mpmy_mpi$(objsuf): $(treedir)/include/libsdf/singlio.h $(objdir)/mpmy_mpi$(objsuf): mpmy_generic.c