#ifndef __TXX__ #define __TXX__ #ifndef __tplusplus #define tfun #define tval #define tptr * #define tout & #define tdrop(v) #define twait(v,s) (s) #define tct(ts) #define TFUNDEF(type,fun,pars,stas,args,argi,outs,outi,msize) type fun pars #define TFUNIMPL(type,fun,pars,stas,args,argi,outs,outi,msize) type fun pars static long ts_sysconf(int name) { if (name== _SC_CL_SIZE) return 1; if (name== _SC_CL_MPI_RANK) return 0; // :-) return sysconf(name); } #define sysconf ts_sysconf #else // __tplusplus #ifdef DBG #define GLUE2(x,y) x,y /* needed to pass template with ID as signle macro argument */ #endif//DBG // Under TG++, TVar methods are not accessible to the user // Re-implemented as inline function, see ./trt.hh #ifndef __TGPLUSPLUS__ #define tdrop(x) do {(x).drop();} while (0) #endif #define tct(ts) _tc_##ts #ifdef AUTO_C_CALL #define MAYBE_C_CALL(type,fun,purepars) \ ts::conf.autoCcall = true; /* do it here? */ \ ts::Task *_curr = ts::Task::getCurrent(); \ if (_curr && (*_curr)().do_C_call) { \ return fun##Cversion purepars; \ } #else// !AUTO_C_CALL #define MAYBE_C_CALL(type,fun,purepars) #endif// AUTO_C_CALL // Add to factory (New) tct() from definition #define TFUNDEF(type,fun,pars,purepars,stas,args,argi,outs,outi) \ extern ts::TFunCtxt fun##TFunCtxt; \ struct fun##TArgDef { args ts::TFunCtxt* _fid; }; \ struct fun##TFunDef: public ts::TFun, fun##TArgDef { \ outs \ virtual ts::TFrz body() = 0; \ static fun##TFunDef* New(); \ }; \ type fun##Cversion pars; \ static inline ts::TFrz fun pars { \ ts::TSLocker _l; \ MAYBE_C_CALL(type,fun,purepars); \ fun##TFunDef *_tf = fun##TFunDef::New(); \ argi \ _tf->stopAndContParent(); \ _tf = (fun##TFunDef*)fun##TFunDef::tryToReuseMemo(_tf,(fun##TArgDef*)_tf,sizeof(fun##TArgDef)); \ outi \ return _tf->retfrz; \ } // Add tct here #define TFUNIMPL(type,fun,pars,purepars,stas,args,argi,outs,outi) \ ts::TFunCtxt fun##TFunCtxt(#fun);\ struct fun##TArgImpl { args ts::TFunCtxt* _fid; }; \ struct fun##TFunImpl: public ts::TFun, fun##TArgImpl { \ outs stas \ virtual ts::TFrz body(); \ virtual ts::SData* clone(); \ }; \ ts::SData* fun##TFunImpl::clone() { \ size_t extra = ts::Task::get_extra(); \ ts::SData* p = \ (ts::SData*)(new(extra) fun##TFunImpl(*this)); \ if (extra > 0) \ memcpy((char*)p + sizeof(fun##TFunImpl),(char*)this + sizeof(fun##TFunImpl),extra); \ return p; \ } \ fun##TFunDef* fun##TFunDef::New() { \ size_t extra = ts::Task::get_extra(); \ fun##TFunDef* p = (fun##TFunDef*)(new(extra) fun##TFunImpl); \ p->_fid = &fun##TFunCtxt; \ ts::Task::after_ctor(p); \ return p; \ } \ ts::TFrz fun##TFunImpl::body() #endif //__tplusplus #endif //__TXX__ # 1 "lazy.cpp" # 1 "" # 1 "" # 1 "../../opentss/trt" 1 # 13 "../../opentss/trt" # 1 "/usr/include/pthread.h" 1 3 # 18 "/usr/include/pthread.h" 3 # 1 "/usr/include/features.h" 1 3 # 291 "/usr/include/features.h" 3 # 1 "/usr/include/sys/cdefs.h" 1 3 # 292 "/usr/include/features.h" 2 3 # 314 "/usr/include/features.h" 3 # 1 "/usr/include/gnu/stubs.h" 1 3 # 315 "/usr/include/features.h" 2 3 # 19 "/usr/include/pthread.h" 2 3 # 1 "/usr/include/sched.h" 1 3 # 26 "/usr/include/sched.h" 3 # 1 "/usr/include/bits/types.h" 1 3 # 28 "/usr/include/bits/types.h" 3 # 1 "/usr/include/bits/wordsize.h" 1 3 # 29 "/usr/include/bits/types.h" 2 3 # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h" 1 3 # 213 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h" 3 typedef unsigned int size_t; # 32 "/usr/include/bits/types.h" 2 3 typedef unsigned char __u_char; typedef unsigned short int __u_short; typedef unsigned int __u_int; typedef unsigned long int __u_long; typedef signed char __int8_t; typedef unsigned char __uint8_t; typedef signed short int __int16_t; typedef unsigned short int __uint16_t; typedef signed int __int32_t; typedef unsigned int __uint32_t; __extension__ typedef signed long long int __int64_t; __extension__ typedef unsigned long long int __uint64_t; __extension__ typedef long long int __quad_t; __extension__ typedef unsigned long long int __u_quad_t; # 128 "/usr/include/bits/types.h" 3 # 1 "/usr/include/bits/typesizes.h" 1 3 # 129 "/usr/include/bits/types.h" 2 3 typedef unsigned long long int __dev_t; typedef unsigned int __uid_t; typedef unsigned int __gid_t; typedef unsigned long int __ino_t; typedef unsigned long long int __ino64_t; typedef unsigned int __mode_t; typedef unsigned int __nlink_t; typedef long int __off_t; typedef long long int __off64_t; typedef int __pid_t; typedef struct { int __val[2]; } __fsid_t; typedef long int __clock_t; typedef unsigned long int __rlim_t; typedef unsigned long long int __rlim64_t; typedef unsigned int __id_t; typedef long int __time_t; typedef unsigned int __useconds_t; typedef long int __suseconds_t; typedef int __daddr_t; typedef long int __swblk_t; typedef int __key_t; typedef int __clockid_t; typedef int __timer_t; typedef long int __blksize_t; typedef long int __blkcnt_t; typedef long long int __blkcnt64_t; typedef unsigned long int __fsblkcnt_t; typedef unsigned long long int __fsblkcnt64_t; typedef unsigned long int __fsfilcnt_t; typedef unsigned long long int __fsfilcnt64_t; typedef int __ssize_t; typedef __off64_t __loff_t; typedef __quad_t *__qaddr_t; typedef char *__caddr_t; typedef int __intptr_t; typedef unsigned int __socklen_t; # 27 "/usr/include/sched.h" 2 3 # 1 "/usr/include/time.h" 1 3 # 118 "/usr/include/time.h" 3 struct timespec { __time_t tv_sec; long int tv_nsec; }; # 30 "/usr/include/sched.h" 2 3 # 1 "/usr/include/bits/sched.h" 1 3 # 62 "/usr/include/bits/sched.h" 3 struct sched_param { int __sched_priority; }; extern "C" { extern int clone (int (*__fn) (void *__arg), void *__child_stack, int __flags, void *__arg) throw (); } struct __sched_param { int __sched_priority; }; # 33 "/usr/include/sched.h" 2 3 extern "C" { extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param) throw (); extern int sched_getparam (__pid_t __pid, struct sched_param *__param) throw (); extern int sched_setscheduler (__pid_t __pid, int __policy, __const struct sched_param *__param) throw (); extern int sched_getscheduler (__pid_t __pid) throw (); extern int sched_yield (void) throw (); extern int sched_get_priority_max (int __algorithm) throw (); extern int sched_get_priority_min (int __algorithm) throw (); extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) throw (); extern int sched_setaffinity (__pid_t __pid, unsigned int __len, unsigned long int *__mask) throw (); extern int sched_getaffinity (__pid_t __pid, unsigned int __len, unsigned long int *__mask) throw (); } # 21 "/usr/include/pthread.h" 2 3 # 1 "/usr/include/time.h" 1 3 # 30 "/usr/include/time.h" 3 extern "C" { # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h" 1 3 # 39 "/usr/include/time.h" 2 3 # 1 "/usr/include/bits/time.h" 1 3 # 43 "/usr/include/time.h" 2 3 # 58 "/usr/include/time.h" 3 typedef __clock_t clock_t; # 74 "/usr/include/time.h" 3 typedef __time_t time_t; # 92 "/usr/include/time.h" 3 typedef __clockid_t clockid_t; # 104 "/usr/include/time.h" 3 typedef __timer_t timer_t; # 129 "/usr/include/time.h" 3 struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; long int tm_gmtoff; __const char *tm_zone; }; struct itimerspec { struct timespec it_interval; struct timespec it_value; }; struct sigevent; typedef __pid_t pid_t; extern clock_t clock (void) throw (); extern time_t time (time_t *__timer) throw (); extern double difftime (time_t __time1, time_t __time0) throw () __attribute__ ((__const__)); extern time_t mktime (struct tm *__tp) throw (); extern size_t strftime (char *__restrict __s, size_t __maxsize, __const char *__restrict __format, __const struct tm *__restrict __tp) throw (); extern char *strptime (__const char *__restrict __s, __const char *__restrict __fmt, struct tm *__tp) throw (); # 1 "/usr/include/xlocale.h" 1 3 # 28 "/usr/include/xlocale.h" 3 typedef struct __locale_struct { struct locale_data *__locales[13]; const unsigned short int *__ctype_b; const int *__ctype_tolower; const int *__ctype_toupper; const char *__names[13]; } *__locale_t; # 214 "/usr/include/time.h" 2 3 extern size_t strftime_l (char *__restrict __s, size_t __maxsize, __const char *__restrict __format, __const struct tm *__restrict __tp, __locale_t __loc) throw (); extern char *strptime_l (__const char *__restrict __s, __const char *__restrict __fmt, struct tm *__tp, __locale_t __loc) throw (); extern struct tm *gmtime (__const time_t *__timer) throw (); extern struct tm *localtime (__const time_t *__timer) throw (); extern struct tm *gmtime_r (__const time_t *__restrict __timer, struct tm *__restrict __tp) throw (); extern struct tm *localtime_r (__const time_t *__restrict __timer, struct tm *__restrict __tp) throw (); extern char *asctime (__const struct tm *__tp) throw (); extern char *ctime (__const time_t *__timer) throw (); extern char *asctime_r (__const struct tm *__restrict __tp, char *__restrict __buf) throw (); extern char *ctime_r (__const time_t *__restrict __timer, char *__restrict __buf) throw (); extern char *__tzname[2]; extern int __daylight; extern long int __timezone; extern char *tzname[2]; extern void tzset (void) throw (); extern int daylight; extern long int timezone; extern int stime (__const time_t *__when) throw (); # 309 "/usr/include/time.h" 3 extern time_t timegm (struct tm *__tp) throw (); extern time_t timelocal (struct tm *__tp) throw (); extern int dysize (int __year) throw () __attribute__ ((__const__)); extern int nanosleep (__const struct timespec *__requested_time, struct timespec *__remaining) throw (); extern int clock_getres (clockid_t __clock_id, struct timespec *__res) throw (); extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) throw (); extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp) throw (); extern int clock_nanosleep (clockid_t __clock_id, int __flags, __const struct timespec *__req, struct timespec *__rem) throw (); extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) throw (); extern int timer_create (clockid_t __clock_id, struct sigevent *__restrict __evp, timer_t *__restrict __timerid) throw (); extern int timer_delete (timer_t __timerid) throw (); extern int timer_settime (timer_t __timerid, int __flags, __const struct itimerspec *__restrict __value, struct itimerspec *__restrict __ovalue) throw (); extern int timer_gettime (timer_t __timerid, struct itimerspec *__value) throw (); extern int timer_getoverrun (timer_t __timerid) throw (); # 380 "/usr/include/time.h" 3 extern int getdate_err; extern struct tm *getdate (__const char *__string) throw (); # 395 "/usr/include/time.h" 3 extern int getdate_r (__const char *__restrict __string, struct tm *__restrict __resbufp) throw (); } # 22 "/usr/include/pthread.h" 2 3 # 1 "/usr/include/signal.h" 1 3 # 31 "/usr/include/signal.h" 3 extern "C" { # 1 "/usr/include/bits/sigset.h" 1 3 # 23 "/usr/include/bits/sigset.h" 3 typedef int __sig_atomic_t; typedef struct { unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))]; } __sigset_t; # 34 "/usr/include/signal.h" 2 3 # 50 "/usr/include/signal.h" 3 typedef __sigset_t sigset_t; # 379 "/usr/include/signal.h" 3 } # 25 "/usr/include/pthread.h" 2 3 # 1 "/usr/include/bits/pthreadtypes.h" 1 3 # 23 "/usr/include/bits/pthreadtypes.h" 3 # 1 "/usr/include/bits/sched.h" 1 3 # 24 "/usr/include/bits/pthreadtypes.h" 2 3 struct _pthread_fastlock { long int __status; int __spinlock; }; typedef struct _pthread_descr_struct *_pthread_descr; typedef struct __pthread_attr_s { int __detachstate; int __schedpolicy; struct __sched_param __schedparam; int __inheritsched; int __scope; size_t __guardsize; int __stackaddr_set; void *__stackaddr; size_t __stacksize; } pthread_attr_t; __extension__ typedef long long __pthread_cond_align_t; typedef struct { struct _pthread_fastlock __c_lock; _pthread_descr __c_waiting; char __padding[48 - sizeof (struct _pthread_fastlock) - sizeof (_pthread_descr) - sizeof (__pthread_cond_align_t)]; __pthread_cond_align_t __align; } pthread_cond_t; typedef struct { int __dummy; } pthread_condattr_t; typedef unsigned int pthread_key_t; typedef struct { int __m_reserved; int __m_count; _pthread_descr __m_owner; int __m_kind; struct _pthread_fastlock __m_lock; } pthread_mutex_t; typedef struct { int __mutexkind; } pthread_mutexattr_t; typedef int pthread_once_t; typedef struct _pthread_rwlock_t { struct _pthread_fastlock __rw_lock; int __rw_readers; _pthread_descr __rw_writer; _pthread_descr __rw_read_waiting; _pthread_descr __rw_write_waiting; int __rw_kind; int __rw_pshared; } pthread_rwlock_t; typedef struct { int __lockkind; int __pshared; } pthread_rwlockattr_t; typedef volatile int pthread_spinlock_t; typedef struct { struct _pthread_fastlock __ba_lock; int __ba_required; int __ba_present; _pthread_descr __ba_waiting; } pthread_barrier_t; typedef struct { int __pshared; } pthread_barrierattr_t; typedef unsigned long int pthread_t; # 26 "/usr/include/pthread.h" 2 3 # 1 "/usr/include/bits/initspin.h" 1 3 # 27 "/usr/include/pthread.h" 2 3 extern "C" { # 59 "/usr/include/pthread.h" 3 enum { PTHREAD_CREATE_JOINABLE, PTHREAD_CREATE_DETACHED }; enum { PTHREAD_INHERIT_SCHED, PTHREAD_EXPLICIT_SCHED }; enum { PTHREAD_SCOPE_SYSTEM, PTHREAD_SCOPE_PROCESS }; enum { PTHREAD_MUTEX_TIMED_NP, PTHREAD_MUTEX_RECURSIVE_NP, PTHREAD_MUTEX_ERRORCHECK_NP, PTHREAD_MUTEX_ADAPTIVE_NP , PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP, PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_ADAPTIVE_NP }; enum { PTHREAD_PROCESS_PRIVATE, PTHREAD_PROCESS_SHARED }; enum { PTHREAD_RWLOCK_PREFER_READER_NP, PTHREAD_RWLOCK_PREFER_WRITER_NP, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_WRITER_NP }; # 131 "/usr/include/pthread.h" 3 struct _pthread_cleanup_buffer { void (*__routine) (void *); void *__arg; int __canceltype; struct _pthread_cleanup_buffer *__prev; }; enum { PTHREAD_CANCEL_ENABLE, PTHREAD_CANCEL_DISABLE }; enum { PTHREAD_CANCEL_DEFERRED, PTHREAD_CANCEL_ASYNCHRONOUS }; # 163 "/usr/include/pthread.h" 3 extern int pthread_create (pthread_t *__restrict __threadp, __const pthread_attr_t *__restrict __attr, void *(*__start_routine) (void *), void *__restrict __arg) throw (); extern pthread_t pthread_self (void) throw (); extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) throw (); extern void pthread_exit (void *__retval) throw () __attribute__ ((__noreturn__)); extern int pthread_join (pthread_t __th, void **__thread_return) throw (); extern int pthread_detach (pthread_t __th) throw (); extern int pthread_attr_init (pthread_attr_t *__attr) throw (); extern int pthread_attr_destroy (pthread_attr_t *__attr) throw (); extern int pthread_attr_setdetachstate (pthread_attr_t *__attr, int __detachstate) throw (); extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr, int *__detachstate) throw (); extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr, __const struct sched_param *__restrict __param) throw (); extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict __attr, struct sched_param *__restrict __param) throw (); extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy) throw (); extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict __attr, int *__restrict __policy) throw (); extern int pthread_attr_setinheritsched (pthread_attr_t *__attr, int __inherit) throw (); extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict __attr, int *__restrict __inherit) throw (); extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope) throw (); extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr, int *__restrict __scope) throw (); extern int pthread_attr_setguardsize (pthread_attr_t *__attr, size_t __guardsize) throw (); extern int pthread_attr_getguardsize (__const pthread_attr_t *__restrict __attr, size_t *__restrict __guardsize) throw (); extern int pthread_attr_setstackaddr (pthread_attr_t *__attr, void *__stackaddr) throw (); extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict __attr, void **__restrict __stackaddr) throw (); extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr, size_t __stacksize) throw (); extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr, void **__restrict __stackaddr, size_t *__restrict __stacksize) throw (); extern int pthread_attr_setstacksize (pthread_attr_t *__attr, size_t __stacksize) throw (); extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict __attr, size_t *__restrict __stacksize) throw (); extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) throw (); extern int pthread_setschedparam (pthread_t __target_thread, int __policy, __const struct sched_param *__param) throw (); extern int pthread_getschedparam (pthread_t __target_thread, int *__restrict __policy, struct sched_param *__restrict __param) throw (); extern int pthread_getconcurrency (void) throw (); extern int pthread_setconcurrency (int __level) throw (); extern int pthread_yield (void) throw (); extern int pthread_mutex_init (pthread_mutex_t *__restrict __mutex, __const pthread_mutexattr_t *__restrict __mutex_attr) throw (); extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) throw (); extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) throw (); extern int pthread_mutex_lock (pthread_mutex_t *__mutex) throw (); extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex, __const struct timespec *__restrict __abstime) throw (); extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) throw (); extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) throw (); extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) throw (); extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t * __restrict __attr, int *__restrict __pshared) throw (); extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr, int __pshared) throw (); extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind) throw (); extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict __attr, int *__restrict __kind) throw (); extern int pthread_cond_init (pthread_cond_t *__restrict __cond, __const pthread_condattr_t *__restrict __cond_attr) throw (); extern int pthread_cond_destroy (pthread_cond_t *__cond) throw (); extern int pthread_cond_signal (pthread_cond_t *__cond) throw (); extern int pthread_cond_broadcast (pthread_cond_t *__cond) throw (); extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex) throw (); extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex, __const struct timespec *__restrict __abstime) throw (); extern int pthread_condattr_init (pthread_condattr_t *__attr) throw (); extern int pthread_condattr_destroy (pthread_condattr_t *__attr) throw (); extern int pthread_condattr_getpshared (__const pthread_condattr_t * __restrict __attr, int *__restrict __pshared) throw (); extern int pthread_condattr_setpshared (pthread_condattr_t *__attr, int __pshared) throw (); extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock, __const pthread_rwlockattr_t *__restrict __attr) throw (); extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) throw (); extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) throw (); extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) throw (); extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, __const struct timespec *__restrict __abstime) throw (); extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) throw (); extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) throw (); extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, __const struct timespec *__restrict __abstime) throw (); extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) throw (); extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) throw (); extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) throw (); extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t * __restrict __attr, int *__restrict __pshared) throw (); extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr, int __pshared) throw (); extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t *__attr, int *__pref) throw (); extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr, int __pref) throw (); # 509 "/usr/include/pthread.h" 3 extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared) throw (); extern int pthread_spin_destroy (pthread_spinlock_t *__lock) throw (); extern int pthread_spin_lock (pthread_spinlock_t *__lock) throw (); extern int pthread_spin_trylock (pthread_spinlock_t *__lock) throw (); extern int pthread_spin_unlock (pthread_spinlock_t *__lock) throw (); extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier, __const pthread_barrierattr_t *__restrict __attr, unsigned int __count) throw (); extern int pthread_barrier_destroy (pthread_barrier_t *__barrier) throw (); extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr) throw (); extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr) throw (); extern int pthread_barrierattr_getpshared (__const pthread_barrierattr_t * __restrict __attr, int *__restrict __pshared) throw (); extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr, int __pshared) throw (); extern int pthread_barrier_wait (pthread_barrier_t *__barrier) throw (); # 556 "/usr/include/pthread.h" 3 extern int pthread_key_create (pthread_key_t *__key, void (*__destr_function) (void *)) throw (); extern int pthread_key_delete (pthread_key_t __key) throw (); extern int pthread_setspecific (pthread_key_t __key, __const void *__pointer) throw (); extern void *pthread_getspecific (pthread_key_t __key) throw (); # 576 "/usr/include/pthread.h" 3 extern int pthread_once (pthread_once_t *__once_control, void (*__init_routine) (void)) throw (); extern int pthread_setcancelstate (int __state, int *__oldstate) throw (); extern int pthread_setcanceltype (int __type, int *__oldtype) throw (); extern int pthread_cancel (pthread_t __cancelthread) throw (); extern void pthread_testcancel (void) throw (); # 610 "/usr/include/pthread.h" 3 extern void _pthread_cleanup_push (struct _pthread_cleanup_buffer *__buffer, void (*__routine) (void *), void *__arg) throw (); extern void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *__buffer, int __execute) throw (); # 631 "/usr/include/pthread.h" 3 extern void _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *__buffer, void (*__routine) (void *), void *__arg) throw (); # 642 "/usr/include/pthread.h" 3 extern void _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *__buffer, int __execute) throw (); extern int pthread_getcpuclockid (pthread_t __thread_id, clockid_t *__clock_id) throw (); # 1 "/usr/include/bits/sigthread.h" 1 3 # 31 "/usr/include/bits/sigthread.h" 3 extern int pthread_sigmask (int __how, __const __sigset_t *__restrict __newmask, __sigset_t *__restrict __oldmask)throw (); extern int pthread_kill (pthread_t __threadid, int __signo) throw (); # 656 "/usr/include/pthread.h" 2 3 # 671 "/usr/include/pthread.h" 3 extern int pthread_atfork (void (*__prepare) (void), void (*__parent) (void), void (*__child) (void)) throw (); extern void pthread_kill_other_threads_np (void) throw (); } # 14 "../../opentss/trt" 2 # 1 "/usr/include/unistd.h" 1 3 # 28 "/usr/include/unistd.h" 3 extern "C" { # 175 "/usr/include/unistd.h" 3 # 1 "/usr/include/bits/posix_opt.h" 1 3 # 176 "/usr/include/unistd.h" 2 3 # 1 "/usr/include/bits/environments.h" 1 3 # 23 "/usr/include/bits/environments.h" 3 # 1 "/usr/include/bits/wordsize.h" 1 3 # 24 "/usr/include/bits/environments.h" 2 3 # 180 "/usr/include/unistd.h" 2 3 # 193 "/usr/include/unistd.h" 3 typedef __ssize_t ssize_t; # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h" 1 3 # 200 "/usr/include/unistd.h" 2 3 typedef __gid_t gid_t; typedef __uid_t uid_t; typedef __off_t off_t; typedef __off64_t off64_t; typedef __useconds_t useconds_t; # 240 "/usr/include/unistd.h" 3 typedef __intptr_t intptr_t; typedef __socklen_t socklen_t; # 260 "/usr/include/unistd.h" 3 extern int access (__const char *__name, int __type) throw (); extern int euidaccess (__const char *__name, int __type) throw (); # 290 "/usr/include/unistd.h" 3 extern __off_t lseek (int __fd, __off_t __offset, int __whence) throw (); # 302 "/usr/include/unistd.h" 3 extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence) throw (); extern int close (int __fd) throw (); extern ssize_t read (int __fd, void *__buf, size_t __nbytes) throw (); extern ssize_t write (int __fd, __const void *__buf, size_t __n) throw (); extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset) throw (); extern ssize_t pwrite (int __fd, __const void *__buf, size_t __n, __off_t __offset) throw (); # 340 "/usr/include/unistd.h" 3 extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) throw (); extern ssize_t pwrite64 (int __fd, __const void *__buf, size_t __n, __off64_t __offset) throw (); extern int pipe (int __pipedes[2]) throw (); # 362 "/usr/include/unistd.h" 3 extern unsigned int alarm (unsigned int __seconds) throw (); # 371 "/usr/include/unistd.h" 3 extern unsigned int sleep (unsigned int __seconds) throw (); extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval) throw (); extern int usleep (__useconds_t __useconds) throw (); extern int pause (void) throw (); extern int chown (__const char *__file, __uid_t __owner, __gid_t __group) throw (); extern int fchown (int __fd, __uid_t __owner, __gid_t __group) throw (); extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group) throw (); extern int chdir (__const char *__path) throw (); extern int fchdir (int __fd) throw (); # 423 "/usr/include/unistd.h" 3 extern char *getcwd (char *__buf, size_t __size) throw (); extern char *get_current_dir_name (void) throw (); extern char *getwd (char *__buf) throw (); extern int dup (int __fd) throw (); extern int dup2 (int __fd, int __fd2) throw (); extern char **__environ; extern char **environ; extern int execve (__const char *__path, char *__const __argv[], char *__const __envp[]) throw (); extern int fexecve (int __fd, char *__const __argv[], char *__const __envp[]) throw (); extern int execv (__const char *__path, char *__const __argv[]) throw (); extern int execle (__const char *__path, __const char *__arg, ...) throw (); extern int execl (__const char *__path, __const char *__arg, ...) throw (); extern int execvp (__const char *__file, char *__const __argv[]) throw (); extern int execlp (__const char *__file, __const char *__arg, ...) throw (); extern int nice (int __inc) throw (); extern void _exit (int __status) __attribute__ ((__noreturn__)); # 1 "/usr/include/bits/confname.h" 1 3 # 25 "/usr/include/bits/confname.h" 3 enum { _PC_LINK_MAX, _PC_MAX_CANON, _PC_MAX_INPUT, _PC_NAME_MAX, _PC_PATH_MAX, _PC_PIPE_BUF, _PC_CHOWN_RESTRICTED, _PC_NO_TRUNC, _PC_VDISABLE, _PC_SYNC_IO, _PC_ASYNC_IO, _PC_PRIO_IO, _PC_SOCK_MAXBUF, _PC_FILESIZEBITS, _PC_REC_INCR_XFER_SIZE, _PC_REC_MAX_XFER_SIZE, _PC_REC_MIN_XFER_SIZE, _PC_REC_XFER_ALIGN, _PC_ALLOC_SIZE_MIN, _PC_SYMLINK_MAX, _PC_2_SYMLINKS }; enum { _SC_ARG_MAX, _SC_CHILD_MAX, _SC_CLK_TCK, _SC_NGROUPS_MAX, _SC_OPEN_MAX, _SC_STREAM_MAX, _SC_TZNAME_MAX, _SC_JOB_CONTROL, _SC_SAVED_IDS, _SC_REALTIME_SIGNALS, _SC_PRIORITY_SCHEDULING, _SC_TIMERS, _SC_ASYNCHRONOUS_IO, _SC_PRIORITIZED_IO, _SC_SYNCHRONIZED_IO, _SC_FSYNC, _SC_MAPPED_FILES, _SC_MEMLOCK, _SC_MEMLOCK_RANGE, _SC_MEMORY_PROTECTION, _SC_MESSAGE_PASSING, _SC_SEMAPHORES, _SC_SHARED_MEMORY_OBJECTS, _SC_AIO_LISTIO_MAX, _SC_AIO_MAX, _SC_AIO_PRIO_DELTA_MAX, _SC_DELAYTIMER_MAX, _SC_MQ_OPEN_MAX, _SC_MQ_PRIO_MAX, _SC_VERSION, _SC_PAGESIZE, _SC_RTSIG_MAX, _SC_SEM_NSEMS_MAX, _SC_SEM_VALUE_MAX, _SC_SIGQUEUE_MAX, _SC_TIMER_MAX, _SC_BC_BASE_MAX, _SC_BC_DIM_MAX, _SC_BC_SCALE_MAX, _SC_BC_STRING_MAX, _SC_COLL_WEIGHTS_MAX, _SC_EQUIV_CLASS_MAX, _SC_EXPR_NEST_MAX, _SC_LINE_MAX, _SC_RE_DUP_MAX, _SC_CHARCLASS_NAME_MAX, _SC_2_VERSION, _SC_2_C_BIND, _SC_2_C_DEV, _SC_2_FORT_DEV, _SC_2_FORT_RUN, _SC_2_SW_DEV, _SC_2_LOCALEDEF, _SC_PII, _SC_PII_XTI, _SC_PII_SOCKET, _SC_PII_INTERNET, _SC_PII_OSI, _SC_POLL, _SC_SELECT, _SC_UIO_MAXIOV, _SC_IOV_MAX = _SC_UIO_MAXIOV, _SC_PII_INTERNET_STREAM, _SC_PII_INTERNET_DGRAM, _SC_PII_OSI_COTS, _SC_PII_OSI_CLTS, _SC_PII_OSI_M, _SC_T_IOV_MAX, _SC_THREADS, _SC_THREAD_SAFE_FUNCTIONS, _SC_GETGR_R_SIZE_MAX, _SC_GETPW_R_SIZE_MAX, _SC_LOGIN_NAME_MAX, _SC_TTY_NAME_MAX, _SC_THREAD_DESTRUCTOR_ITERATIONS, _SC_THREAD_KEYS_MAX, _SC_THREAD_STACK_MIN, _SC_THREAD_THREADS_MAX, _SC_THREAD_ATTR_STACKADDR, _SC_THREAD_ATTR_STACKSIZE, _SC_THREAD_PRIORITY_SCHEDULING, _SC_THREAD_PRIO_INHERIT, _SC_THREAD_PRIO_PROTECT, _SC_THREAD_PROCESS_SHARED, _SC_NPROCESSORS_CONF, _SC_NPROCESSORS_ONLN, _SC_PHYS_PAGES, _SC_AVPHYS_PAGES, _SC_ATEXIT_MAX, _SC_PASS_MAX, _SC_XOPEN_VERSION, _SC_XOPEN_XCU_VERSION, _SC_XOPEN_UNIX, _SC_XOPEN_CRYPT, _SC_XOPEN_ENH_I18N, _SC_XOPEN_SHM, _SC_2_CHAR_TERM, _SC_2_C_VERSION, _SC_2_UPE, _SC_XOPEN_XPG2, _SC_XOPEN_XPG3, _SC_XOPEN_XPG4, _SC_CHAR_BIT, _SC_CHAR_MAX, _SC_CHAR_MIN, _SC_INT_MAX, _SC_INT_MIN, _SC_LONG_BIT, _SC_WORD_BIT, _SC_MB_LEN_MAX, _SC_NZERO, _SC_SSIZE_MAX, _SC_SCHAR_MAX, _SC_SCHAR_MIN, _SC_SHRT_MAX, _SC_SHRT_MIN, _SC_UCHAR_MAX, _SC_UINT_MAX, _SC_ULONG_MAX, _SC_USHRT_MAX, _SC_NL_ARGMAX, _SC_NL_LANGMAX, _SC_NL_MSGMAX, _SC_NL_NMAX, _SC_NL_SETMAX, _SC_NL_TEXTMAX, _SC_XBS5_ILP32_OFF32, _SC_XBS5_ILP32_OFFBIG, _SC_XBS5_LP64_OFF64, _SC_XBS5_LPBIG_OFFBIG, _SC_XOPEN_LEGACY, _SC_XOPEN_REALTIME, _SC_XOPEN_REALTIME_THREADS, _SC_ADVISORY_INFO, _SC_BARRIERS, _SC_BASE, _SC_C_LANG_SUPPORT, _SC_C_LANG_SUPPORT_R, _SC_CLOCK_SELECTION, _SC_CPUTIME, _SC_THREAD_CPUTIME, _SC_DEVICE_IO, _SC_DEVICE_SPECIFIC, _SC_DEVICE_SPECIFIC_R, _SC_FD_MGMT, _SC_FIFO, _SC_PIPE, _SC_FILE_ATTRIBUTES, _SC_FILE_LOCKING, _SC_FILE_SYSTEM, _SC_MONOTONIC_CLOCK, _SC_MULTI_PROCESS, _SC_SINGLE_PROCESS, _SC_NETWORKING, _SC_READER_WRITER_LOCKS, _SC_SPIN_LOCKS, _SC_REGEXP, _SC_REGEX_VERSION, _SC_SHELL, _SC_SIGNALS, _SC_SPAWN, _SC_SPORADIC_SERVER, _SC_THREAD_SPORADIC_SERVER, _SC_SYSTEM_DATABASE, _SC_SYSTEM_DATABASE_R, _SC_TIMEOUTS, _SC_TYPED_MEMORY_OBJECTS, _SC_USER_GROUPS, _SC_USER_GROUPS_R, _SC_2_PBS, _SC_2_PBS_ACCOUNTING, _SC_2_PBS_LOCATE, _SC_2_PBS_MESSAGE, _SC_2_PBS_TRACK, _SC_SYMLOOP_MAX, _SC_STREAMS, _SC_2_PBS_CHECKPOINT, _SC_V6_ILP32_OFF32, _SC_V6_ILP32_OFFBIG, _SC_V6_LP64_OFF64, _SC_V6_LPBIG_OFFBIG, _SC_HOST_NAME_MAX, _SC_TRACE, _SC_TRACE_EVENT_FILTER, _SC_TRACE_INHERIT, _SC_TRACE_LOG }; enum { _CS_PATH, _CS_V6_WIDTH_RESTRICTED_ENVS, _CS_GNU_LIBC_VERSION, _CS_GNU_LIBPTHREAD_VERSION, _CS_LFS_CFLAGS = 1000, _CS_LFS_LDFLAGS, _CS_LFS_LIBS, _CS_LFS_LINTFLAGS, _CS_LFS64_CFLAGS, _CS_LFS64_LDFLAGS, _CS_LFS64_LIBS, _CS_LFS64_LINTFLAGS, _CS_XBS5_ILP32_OFF32_CFLAGS = 1100, _CS_XBS5_ILP32_OFF32_LDFLAGS, _CS_XBS5_ILP32_OFF32_LIBS, _CS_XBS5_ILP32_OFF32_LINTFLAGS, _CS_XBS5_ILP32_OFFBIG_CFLAGS, _CS_XBS5_ILP32_OFFBIG_LDFLAGS, _CS_XBS5_ILP32_OFFBIG_LIBS, _CS_XBS5_ILP32_OFFBIG_LINTFLAGS, _CS_XBS5_LP64_OFF64_CFLAGS, _CS_XBS5_LP64_OFF64_LDFLAGS, _CS_XBS5_LP64_OFF64_LIBS, _CS_XBS5_LP64_OFF64_LINTFLAGS, _CS_XBS5_LPBIG_OFFBIG_CFLAGS, _CS_XBS5_LPBIG_OFFBIG_LDFLAGS, _CS_XBS5_LPBIG_OFFBIG_LIBS, _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS, _CS_POSIX_V6_ILP32_OFF32_CFLAGS, _CS_POSIX_V6_ILP32_OFF32_LDFLAGS, _CS_POSIX_V6_ILP32_OFF32_LIBS, _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS, _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS, _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS, _CS_POSIX_V6_ILP32_OFFBIG_LIBS, _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS, _CS_POSIX_V6_LP64_OFF64_CFLAGS, _CS_POSIX_V6_LP64_OFF64_LDFLAGS, _CS_POSIX_V6_LP64_OFF64_LIBS, _CS_POSIX_V6_LP64_OFF64_LINTFLAGS, _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS, _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, _CS_POSIX_V6_LPBIG_OFFBIG_LIBS, _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS }; # 501 "/usr/include/unistd.h" 2 3 extern long int pathconf (__const char *__path, int __name) throw (); extern long int fpathconf (int __fd, int __name) throw (); extern long int sysconf (int __name) throw () __attribute__ ((__const__)); extern size_t confstr (int __name, char *__buf, size_t __len) throw (); extern __pid_t getpid (void) throw (); extern __pid_t getppid (void) throw (); extern __pid_t getpgrp (void) throw (); # 536 "/usr/include/unistd.h" 3 extern __pid_t __getpgid (__pid_t __pid) throw (); extern __pid_t getpgid (__pid_t __pid) throw (); extern int setpgid (__pid_t __pid, __pid_t __pgid) throw (); # 562 "/usr/include/unistd.h" 3 extern int setpgrp (void) throw (); # 580 "/usr/include/unistd.h" 3 extern __pid_t setsid (void) throw (); extern __pid_t getsid (__pid_t __pid) throw (); extern __uid_t getuid (void) throw (); extern __uid_t geteuid (void) throw (); extern __gid_t getgid (void) throw (); extern __gid_t getegid (void) throw (); extern int getgroups (int __size, __gid_t __list[]) throw (); extern int group_member (__gid_t __gid) throw (); extern int setuid (__uid_t __uid) throw (); extern int setreuid (__uid_t __ruid, __uid_t __euid) throw (); extern int seteuid (__uid_t __uid) throw (); extern int setgid (__gid_t __gid) throw (); extern int setregid (__gid_t __rgid, __gid_t __egid) throw (); extern int setegid (__gid_t __gid) throw (); extern int getresuid (__uid_t *__euid, __uid_t *__ruid, __uid_t *__suid); extern int getresgid (__gid_t *__egid, __gid_t *__rgid, __gid_t *__sgid); extern int setresuid (__uid_t __euid, __uid_t __ruid, __uid_t __suid); extern int setresgid (__gid_t __egid, __gid_t __rgid, __gid_t __sgid); extern __pid_t fork (void) throw (); extern __pid_t vfork (void) throw (); extern char *ttyname (int __fd) throw (); extern int ttyname_r (int __fd, char *__buf, size_t __buflen) throw (); extern int isatty (int __fd) throw (); extern int ttyslot (void) throw (); extern int link (__const char *__from, __const char *__to) throw (); extern int symlink (__const char *__from, __const char *__to) throw (); extern int readlink (__const char *__restrict __path, char *__restrict __buf, size_t __len) throw (); extern int unlink (__const char *__name) throw (); extern int rmdir (__const char *__path) throw (); extern __pid_t tcgetpgrp (int __fd) throw (); extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) throw (); extern char *getlogin (void) throw (); extern int getlogin_r (char *__name, size_t __name_len) throw (); extern int setlogin (__const char *__name) throw (); # 744 "/usr/include/unistd.h" 3 # 1 "/usr/include/getopt.h" 1 3 # 38 "/usr/include/getopt.h" 3 extern "C" { # 47 "/usr/include/getopt.h" 3 extern char *optarg; # 61 "/usr/include/getopt.h" 3 extern int optind; extern int opterr; extern int optopt; # 145 "/usr/include/getopt.h" 3 extern int getopt (int ___argc, char *const *___argv, const char *__shortopts); # 175 "/usr/include/getopt.h" 3 } # 745 "/usr/include/unistd.h" 2 3 extern int gethostname (char *__name, size_t __len) throw (); extern int sethostname (__const char *__name, size_t __len) throw (); extern int sethostid (long int __id) throw (); extern int getdomainname (char *__name, size_t __len) throw (); extern int setdomainname (__const char *__name, size_t __len) throw (); extern int vhangup (void) throw (); extern int revoke (__const char *__file) throw (); extern int profil (unsigned short int *__sample_buffer, size_t __size, size_t __offset, unsigned int __scale) throw (); extern int acct (__const char *__name) throw (); extern char *getusershell (void) throw (); extern void endusershell (void) throw (); extern void setusershell (void) throw (); extern int daemon (int __nochdir, int __noclose) throw (); extern int chroot (__const char *__path) throw (); extern char *getpass (__const char *__prompt) throw (); extern int fsync (int __fd) throw (); extern long int gethostid (void) throw (); extern void sync (void) throw (); extern int getpagesize (void) throw () __attribute__ ((__const__)); extern int truncate (__const char *__file, __off_t __length) throw (); # 854 "/usr/include/unistd.h" 3 extern int truncate64 (__const char *__file, __off64_t __length) throw (); extern int ftruncate (int __fd, __off_t __length) throw (); # 869 "/usr/include/unistd.h" 3 extern int ftruncate64 (int __fd, __off64_t __length) throw (); extern int getdtablesize (void) throw (); # 884 "/usr/include/unistd.h" 3 extern int brk (void *__addr) throw (); extern void *sbrk (intptr_t __delta) throw (); # 905 "/usr/include/unistd.h" 3 extern long int syscall (long int __sysno, ...) throw (); # 925 "/usr/include/unistd.h" 3 extern int lockf (int __fd, int __cmd, __off_t __len) throw (); # 935 "/usr/include/unistd.h" 3 extern int lockf64 (int __fd, int __cmd, __off64_t __len) throw (); # 956 "/usr/include/unistd.h" 3 extern int fdatasync (int __fildes) throw (); extern char *crypt (__const char *__key, __const char *__salt) throw (); extern void encrypt (char *__block, int __edflag) throw (); extern void swab (__const void *__restrict __from, void *__restrict __to, ssize_t __n) throw (); extern char *ctermid (char *__s) throw (); # 1001 "/usr/include/unistd.h" 3 extern int pthread_atfork (void (*__prepare) (void), void (*__parent) (void), void (*__child) (void)) throw (); } # 15 "../../opentss/trt" 2 # 1 "/usr/include/stdlib.h" 1 3 # 33 "/usr/include/stdlib.h" 3 # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h" 1 3 # 34 "/usr/include/stdlib.h" 2 3 extern "C" { # 1 "/usr/include/bits/waitflags.h" 1 3 # 43 "/usr/include/stdlib.h" 2 3 # 1 "/usr/include/bits/waitstatus.h" 1 3 # 63 "/usr/include/bits/waitstatus.h" 3 # 1 "/usr/include/endian.h" 1 3 # 37 "/usr/include/endian.h" 3 # 1 "/usr/include/bits/endian.h" 1 3 # 38 "/usr/include/endian.h" 2 3 # 64 "/usr/include/bits/waitstatus.h" 2 3 union wait { int w_status; struct { unsigned int __w_termsig:7; unsigned int __w_coredump:1; unsigned int __w_retcode:8; unsigned int:16; } __wait_terminated; struct { unsigned int __w_stopval:8; unsigned int __w_stopsig:8; unsigned int:16; } __wait_stopped; }; # 44 "/usr/include/stdlib.h" 2 3 # 93 "/usr/include/stdlib.h" 3 typedef struct { int quot; int rem; } div_t; typedef struct { long int quot; long int rem; } ldiv_t; __extension__ typedef struct { long long int quot; long long int rem; } lldiv_t; # 137 "/usr/include/stdlib.h" 3 extern size_t __ctype_get_mb_cur_max (void) throw (); extern double atof (__const char *__nptr) throw () __attribute__ ((__pure__)); extern int atoi (__const char *__nptr) throw () __attribute__ ((__pure__)); extern long int atol (__const char *__nptr) throw () __attribute__ ((__pure__)); __extension__ extern long long int atoll (__const char *__nptr) throw () __attribute__ ((__pure__)); extern double strtod (__const char *__restrict __nptr, char **__restrict __endptr) throw (); extern float strtof (__const char *__restrict __nptr, char **__restrict __endptr) throw (); extern long double strtold (__const char *__restrict __nptr, char **__restrict __endptr) throw (); extern long int strtol (__const char *__restrict __nptr, char **__restrict __endptr, int __base) throw (); extern unsigned long int strtoul (__const char *__restrict __nptr, char **__restrict __endptr, int __base) throw (); __extension__ extern long long int strtoq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) throw (); __extension__ extern unsigned long long int strtouq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) throw (); __extension__ extern long long int strtoll (__const char *__restrict __nptr, char **__restrict __endptr, int __base) throw (); __extension__ extern unsigned long long int strtoull (__const char *__restrict __nptr, char **__restrict __endptr, int __base) throw (); # 229 "/usr/include/stdlib.h" 3 extern long int strtol_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) throw (); extern unsigned long int strtoul_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) throw (); __extension__ extern long long int strtoll_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) throw (); __extension__ extern unsigned long long int strtoull_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) throw (); extern double strtod_l (__const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) throw (); extern float strtof_l (__const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) throw (); extern long double strtold_l (__const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) throw (); extern double __strtod_internal (__const char *__restrict __nptr, char **__restrict __endptr, int __group) throw (); extern float __strtof_internal (__const char *__restrict __nptr, char **__restrict __endptr, int __group) throw (); extern long double __strtold_internal (__const char *__restrict __nptr, char **__restrict __endptr, int __group) throw (); extern long int __strtol_internal (__const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) throw (); extern unsigned long int __strtoul_internal (__const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) throw (); __extension__ extern long long int __strtoll_internal (__const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) throw (); __extension__ extern unsigned long long int __strtoull_internal (__const char * __restrict __nptr, char **__restrict __endptr, int __base, int __group) throw (); # 408 "/usr/include/stdlib.h" 3 extern char *l64a (long int __n) throw (); extern long int a64l (__const char *__s) throw () __attribute__ ((__pure__)); # 1 "/usr/include/sys/types.h" 1 3 # 29 "/usr/include/sys/types.h" 3 extern "C" { typedef __u_char u_char; typedef __u_short u_short; typedef __u_int u_int; typedef __u_long u_long; typedef __quad_t quad_t; typedef __u_quad_t u_quad_t; typedef __fsid_t fsid_t; typedef __loff_t loff_t; typedef __ino_t ino_t; typedef __ino64_t ino64_t; typedef __dev_t dev_t; # 72 "/usr/include/sys/types.h" 3 typedef __mode_t mode_t; typedef __nlink_t nlink_t; # 105 "/usr/include/sys/types.h" 3 typedef __id_t id_t; # 116 "/usr/include/sys/types.h" 3 typedef __daddr_t daddr_t; typedef __caddr_t caddr_t; typedef __key_t key_t; # 141 "/usr/include/sys/types.h" 3 typedef __suseconds_t suseconds_t; # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h" 1 3 # 148 "/usr/include/sys/types.h" 2 3 typedef unsigned long int ulong; typedef unsigned short int ushort; typedef unsigned int uint; # 191 "/usr/include/sys/types.h" 3 typedef int int8_t __attribute__ ((__mode__ (__QI__))); typedef int int16_t __attribute__ ((__mode__ (__HI__))); typedef int int32_t __attribute__ ((__mode__ (__SI__))); typedef int int64_t __attribute__ ((__mode__ (__DI__))); typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__))); typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__))); typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__))); typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__))); typedef int register_t __attribute__ ((__mode__ (__word__))); # 216 "/usr/include/sys/types.h" 3 # 1 "/usr/include/sys/select.h" 1 3 # 31 "/usr/include/sys/select.h" 3 # 1 "/usr/include/bits/select.h" 1 3 # 32 "/usr/include/sys/select.h" 2 3 # 1 "/usr/include/bits/sigset.h" 1 3 # 35 "/usr/include/sys/select.h" 2 3 # 46 "/usr/include/sys/select.h" 3 # 1 "/usr/include/bits/time.h" 1 3 # 69 "/usr/include/bits/time.h" 3 struct timeval { __time_t tv_sec; __suseconds_t tv_usec; }; # 47 "/usr/include/sys/select.h" 2 3 # 55 "/usr/include/sys/select.h" 3 typedef long int __fd_mask; # 67 "/usr/include/sys/select.h" 3 typedef struct { __fd_mask fds_bits[1024 / (8 * sizeof (__fd_mask))]; } fd_set; typedef __fd_mask fd_mask; # 99 "/usr/include/sys/select.h" 3 extern "C" { extern int select (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, struct timeval *__restrict __timeout) throw (); extern int pselect (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, const struct timespec *__restrict __timeout, const __sigset_t *__restrict __sigmask) throw (); } # 217 "/usr/include/sys/types.h" 2 3 # 1 "/usr/include/sys/sysmacros.h" 1 3 # 220 "/usr/include/sys/types.h" 2 3 typedef __blksize_t blksize_t; typedef __blkcnt_t blkcnt_t; typedef __fsblkcnt_t fsblkcnt_t; typedef __fsfilcnt_t fsfilcnt_t; # 258 "/usr/include/sys/types.h" 3 typedef __blkcnt64_t blkcnt64_t; typedef __fsblkcnt64_t fsblkcnt64_t; typedef __fsfilcnt64_t fsfilcnt64_t; # 1 "/usr/include/bits/pthreadtypes.h" 1 3 # 267 "/usr/include/sys/types.h" 2 3 } # 417 "/usr/include/stdlib.h" 2 3 extern long int random (void) throw (); extern void srandom (unsigned int __seed) throw (); extern char *initstate (unsigned int __seed, char *__statebuf, size_t __statelen) throw (); extern char *setstate (char *__statebuf) throw (); struct random_data { int32_t *fptr; int32_t *rptr; int32_t *state; int rand_type; int rand_deg; int rand_sep; int32_t *end_ptr; }; extern int random_r (struct random_data *__restrict __buf, int32_t *__restrict __result) throw (); extern int srandom_r (unsigned int __seed, struct random_data *__buf) throw (); extern int initstate_r (unsigned int __seed, char *__restrict __statebuf, size_t __statelen, struct random_data *__restrict __buf) throw (); extern int setstate_r (char *__restrict __statebuf, struct random_data *__restrict __buf) throw (); extern int rand (void) throw (); extern void srand (unsigned int __seed) throw (); extern int rand_r (unsigned int *__seed) throw (); extern double drand48 (void) throw (); extern double erand48 (unsigned short int __xsubi[3]) throw (); extern long int lrand48 (void) throw (); extern long int nrand48 (unsigned short int __xsubi[3]) throw (); extern long int mrand48 (void) throw (); extern long int jrand48 (unsigned short int __xsubi[3]) throw (); extern void srand48 (long int __seedval) throw (); extern unsigned short int *seed48 (unsigned short int __seed16v[3]) throw (); extern void lcong48 (unsigned short int __param[7]) throw (); struct drand48_data { unsigned short int __x[3]; unsigned short int __old_x[3]; unsigned short int __c; unsigned short int __init; unsigned long long int __a; }; extern int drand48_r (struct drand48_data *__restrict __buffer, double *__restrict __result) throw (); extern int erand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, double *__restrict __result) throw (); extern int lrand48_r (struct drand48_data *__restrict __buffer, long int *__restrict __result) throw (); extern int nrand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) throw (); extern int mrand48_r (struct drand48_data *__restrict __buffer, long int *__restrict __result) throw (); extern int jrand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) throw (); extern int srand48_r (long int __seedval, struct drand48_data *__buffer) throw (); extern int seed48_r (unsigned short int __seed16v[3], struct drand48_data *__buffer) throw (); extern int lcong48_r (unsigned short int __param[7], struct drand48_data *__buffer) throw (); extern void *malloc (size_t __size) throw () __attribute__ ((__malloc__)); extern void *calloc (size_t __nmemb, size_t __size) throw () __attribute__ ((__malloc__)); extern void *realloc (void *__ptr, size_t __size) throw () __attribute__ ((__malloc__)); extern void free (void *__ptr) throw (); extern void cfree (void *__ptr) throw (); # 1 "/usr/include/alloca.h" 1 3 # 25 "/usr/include/alloca.h" 3 # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h" 1 3 # 26 "/usr/include/alloca.h" 2 3 extern "C" { extern void *alloca (size_t __size) throw (); } # 579 "/usr/include/stdlib.h" 2 3 extern void *valloc (size_t __size) throw () __attribute__ ((__malloc__)); extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size) throw () __attribute__ ((__malloc__)); extern void abort (void) throw () __attribute__ ((__noreturn__)); extern int atexit (void (*__func) (void)) throw (); extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg) throw (); extern void exit (int __status) throw () __attribute__ ((__noreturn__)); extern void _Exit (int __status) throw () __attribute__ ((__noreturn__)); extern char *getenv (__const char *__name) throw (); extern char *__secure_getenv (__const char *__name) throw (); extern int putenv (char *__string) throw (); extern int setenv (__const char *__name, __const char *__value, int __replace) throw (); extern int unsetenv (__const char *__name) throw (); extern int clearenv (void) throw (); # 663 "/usr/include/stdlib.h" 3 extern char *mktemp (char *__template) throw (); extern int mkstemp (char *__template) throw (); # 680 "/usr/include/stdlib.h" 3 extern int mkstemp64 (char *__template) throw (); # 690 "/usr/include/stdlib.h" 3 extern char *mkdtemp (char *__template) throw (); extern int system (__const char *__command) throw (); extern char *canonicalize_file_name (__const char *__name) throw (); # 714 "/usr/include/stdlib.h" 3 extern char *realpath (__const char *__restrict __name, char *__restrict __resolved) throw (); typedef int (*__compar_fn_t) (__const void *, __const void *); typedef __compar_fn_t comparison_fn_t; extern void *bsearch (__const void *__key, __const void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar); extern void qsort (void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar); extern int abs (int __x) throw () __attribute__ ((__const__)); extern long int labs (long int __x) throw () __attribute__ ((__const__)); __extension__ extern long long int llabs (long long int __x) throw () __attribute__ ((__const__)); extern div_t div (int __numer, int __denom) throw () __attribute__ ((__const__)); extern ldiv_t ldiv (long int __numer, long int __denom) throw () __attribute__ ((__const__)); __extension__ extern lldiv_t lldiv (long long int __numer, long long int __denom) throw () __attribute__ ((__const__)); # 778 "/usr/include/stdlib.h" 3 extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) throw (); extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) throw (); extern char *gcvt (double __value, int __ndigit, char *__buf) throw (); extern char *qecvt (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) throw (); extern char *qfcvt (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) throw (); extern char *qgcvt (long double __value, int __ndigit, char *__buf) throw (); extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) throw (); extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) throw (); extern int qecvt_r (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) throw (); extern int qfcvt_r (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) throw (); extern int mblen (__const char *__s, size_t __n) throw (); extern int mbtowc (wchar_t *__restrict __pwc, __const char *__restrict __s, size_t __n) throw (); extern int wctomb (char *__s, wchar_t __wchar) throw (); extern size_t mbstowcs (wchar_t *__restrict __pwcs, __const char *__restrict __s, size_t __n) throw (); extern size_t wcstombs (char *__restrict __s, __const wchar_t *__restrict __pwcs, size_t __n) throw (); extern int rpmatch (__const char *__response) throw (); # 860 "/usr/include/stdlib.h" 3 extern int getsubopt (char **__restrict __optionp, char *__const *__restrict __tokens, char **__restrict __valuep) throw (); extern void setkey (__const char *__key) throw (); extern int posix_openpt (int __oflag) throw (); extern int grantpt (int __fd) throw (); extern int unlockpt (int __fd) throw (); extern char *ptsname (int __fd) throw (); extern int ptsname_r (int __fd, char *__buf, size_t __buflen) throw (); extern int getpt (void) throw (); extern int getloadavg (double __loadavg[], int __nelem) throw (); } # 17 "../../opentss/trt" 2 # 1 "/usr/include/string.h" 1 3 # 28 "/usr/include/string.h" 3 extern "C" { # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h" 1 3 # 34 "/usr/include/string.h" 2 3 extern void *memcpy (void *__restrict __dest, __const void *__restrict __src, size_t __n) throw (); extern void *memmove (void *__dest, __const void *__src, size_t __n) throw (); extern void *memccpy (void *__restrict __dest, __const void *__restrict __src, int __c, size_t __n) throw (); extern void *memset (void *__s, int __c, size_t __n) throw (); extern int memcmp (__const void *__s1, __const void *__s2, size_t __n) throw () __attribute__ ((__pure__)); extern void *memchr (__const void *__s, int __c, size_t __n) throw () __attribute__ ((__pure__)); extern void *rawmemchr (__const void *__s, int __c) throw () __attribute__ ((__pure__)); extern void *memrchr (__const void *__s, int __c, size_t __n) throw () __attribute__ ((__pure__)); extern char *strcpy (char *__restrict __dest, __const char *__restrict __src) throw (); extern char *strncpy (char *__restrict __dest, __const char *__restrict __src, size_t __n) throw (); extern char *strcat (char *__restrict __dest, __const char *__restrict __src) throw (); extern char *strncat (char *__restrict __dest, __const char *__restrict __src, size_t __n) throw (); extern int strcmp (__const char *__s1, __const char *__s2) throw () __attribute__ ((__pure__)); extern int strncmp (__const char *__s1, __const char *__s2, size_t __n) throw () __attribute__ ((__pure__)); extern int strcoll (__const char *__s1, __const char *__s2) throw () __attribute__ ((__pure__)); extern size_t strxfrm (char *__restrict __dest, __const char *__restrict __src, size_t __n) throw (); # 117 "/usr/include/string.h" 3 extern int strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l) throw () __attribute__ ((__pure__)); extern size_t strxfrm_l (char *__dest, __const char *__src, size_t __n, __locale_t __l) throw (); extern char *strdup (__const char *__s) throw () __attribute__ ((__malloc__)); extern char *strndup (__const char *__string, size_t __n) throw () __attribute__ ((__malloc__)); # 160 "/usr/include/string.h" 3 extern char *strchr (__const char *__s, int __c) throw () __attribute__ ((__pure__)); extern char *strrchr (__const char *__s, int __c) throw () __attribute__ ((__pure__)); extern char *strchrnul (__const char *__s, int __c) throw () __attribute__ ((__pure__)); extern size_t strcspn (__const char *__s, __const char *__reject) throw () __attribute__ ((__pure__)); extern size_t strspn (__const char *__s, __const char *__accept) throw () __attribute__ ((__pure__)); extern char *strpbrk (__const char *__s, __const char *__accept) throw () __attribute__ ((__pure__)); extern char *strstr (__const char *__haystack, __const char *__needle) throw () __attribute__ ((__pure__)); extern char *strtok (char *__restrict __s, __const char *__restrict __delim) throw (); extern char *__strtok_r (char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) throw (); extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) throw (); extern char *strcasestr (__const char *__haystack, __const char *__needle) throw () __attribute__ ((__pure__)); extern void *memmem (__const void *__haystack, size_t __haystacklen, __const void *__needle, size_t __needlelen) throw () __attribute__ ((__pure__)); extern void *__mempcpy (void *__restrict __dest, __const void *__restrict __src, size_t __n) throw (); extern void *mempcpy (void *__restrict __dest, __const void *__restrict __src, size_t __n) throw (); extern size_t strlen (__const char *__s) throw () __attribute__ ((__pure__)); extern size_t strnlen (__const char *__string, size_t __maxlen) throw () __attribute__ ((__pure__)); extern char *strerror (int __errnum) throw (); extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) throw (); extern void __bzero (void *__s, size_t __n) throw (); extern void bcopy (__const void *__src, void *__dest, size_t __n) throw (); extern void bzero (void *__s, size_t __n) throw (); extern int bcmp (__const void *__s1, __const void *__s2, size_t __n) throw () __attribute__ ((__pure__)); extern char *index (__const char *__s, int __c) throw () __attribute__ ((__pure__)); extern char *rindex (__const char *__s, int __c) throw () __attribute__ ((__pure__)); extern int ffs (int __i) throw () __attribute__ ((__const__)); extern int ffsl (long int __l) throw () __attribute__ ((__const__)); __extension__ extern int ffsll (long long int __ll) throw () __attribute__ ((__const__)); extern int strcasecmp (__const char *__s1, __const char *__s2) throw () __attribute__ ((__pure__)); extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) throw () __attribute__ ((__pure__)); extern int strcasecmp_l (__const char *__s1, __const char *__s2, __locale_t __loc) throw () __attribute__ ((__pure__)); extern int strncasecmp_l (__const char *__s1, __const char *__s2, size_t __n, __locale_t __loc) throw () __attribute__ ((__pure__)); extern char *strsep (char **__restrict __stringp, __const char *__restrict __delim) throw (); extern int strverscmp (__const char *__s1, __const char *__s2) throw () __attribute__ ((__pure__)); extern char *strsignal (int __sig) throw (); extern char *__stpcpy (char *__restrict __dest, __const char *__restrict __src) throw (); extern char *stpcpy (char *__restrict __dest, __const char *__restrict __src) throw (); extern char *__stpncpy (char *__restrict __dest, __const char *__restrict __src, size_t __n) throw (); extern char *stpncpy (char *__restrict __dest, __const char *__restrict __src, size_t __n) throw (); extern char *strfry (char *__string) throw (); extern void *memfrob (void *__s, size_t __n) throw (); extern char *basename (__const char *__filename) throw (); # 379 "/usr/include/string.h" 3 } # 18 "../../opentss/trt" 2 # 1 "/usr/include/stdio.h" 1 3 # 30 "/usr/include/stdio.h" 3 extern "C" { # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h" 1 3 # 35 "/usr/include/stdio.h" 2 3 # 44 "/usr/include/stdio.h" 3 typedef struct _IO_FILE FILE; # 62 "/usr/include/stdio.h" 3 typedef struct _IO_FILE __FILE; # 72 "/usr/include/stdio.h" 3 # 1 "/usr/include/libio.h" 1 3 # 32 "/usr/include/libio.h" 3 # 1 "/usr/include/_G_config.h" 1 3 # 14 "/usr/include/_G_config.h" 3 # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h" 1 3 # 354 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h" 3 typedef unsigned int wint_t; # 15 "/usr/include/_G_config.h" 2 3 # 24 "/usr/include/_G_config.h" 3 # 1 "/usr/include/wchar.h" 1 3 # 48 "/usr/include/wchar.h" 3 # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h" 1 3 # 49 "/usr/include/wchar.h" 2 3 # 1 "/usr/include/bits/wchar.h" 1 3 # 51 "/usr/include/wchar.h" 2 3 # 63 "/usr/include/wchar.h" 3 typedef struct { int __count; union { wint_t __wch; char __wchb[4]; } __value; } __mbstate_t; # 25 "/usr/include/_G_config.h" 2 3 typedef struct { __off_t __pos; __mbstate_t __state; } _G_fpos_t; typedef struct { __off64_t __pos; __mbstate_t __state; } _G_fpos64_t; # 44 "/usr/include/_G_config.h" 3 # 1 "/usr/include/gconv.h" 1 3 # 28 "/usr/include/gconv.h" 3 # 1 "/usr/include/wchar.h" 1 3 # 48 "/usr/include/wchar.h" 3 # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h" 1 3 # 49 "/usr/include/wchar.h" 2 3 # 63 "/usr/include/wchar.h" 3 # 29 "/usr/include/gconv.h" 2 3 # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h" 1 3 # 32 "/usr/include/gconv.h" 2 3 enum { __GCONV_OK = 0, __GCONV_NOCONV, __GCONV_NODB, __GCONV_NOMEM, __GCONV_EMPTY_INPUT, __GCONV_FULL_OUTPUT, __GCONV_ILLEGAL_INPUT, __GCONV_INCOMPLETE_INPUT, __GCONV_ILLEGAL_DESCRIPTOR, __GCONV_INTERNAL_ERROR }; enum { __GCONV_IS_LAST = 0x0001, __GCONV_IGNORE_ERRORS = 0x0002 }; struct __gconv_step; struct __gconv_step_data; struct __gconv_loaded_object; struct __gconv_trans_data; typedef int (*__gconv_fct) (struct __gconv_step *, struct __gconv_step_data *, __const unsigned char **, __const unsigned char *, unsigned char **, size_t *, int, int); typedef wint_t (*__gconv_btowc_fct) (struct __gconv_step *, unsigned char); typedef int (*__gconv_init_fct) (struct __gconv_step *); typedef void (*__gconv_end_fct) (struct __gconv_step *); typedef int (*__gconv_trans_fct) (struct __gconv_step *, struct __gconv_step_data *, void *, __const unsigned char *, __const unsigned char **, __const unsigned char *, unsigned char **, size_t *); typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *, __const unsigned char *, unsigned char *, unsigned char *); typedef int (*__gconv_trans_query_fct) (__const char *, __const char ***, size_t *); typedef int (*__gconv_trans_init_fct) (void **, const char *); typedef void (*__gconv_trans_end_fct) (void *); struct __gconv_trans_data { __gconv_trans_fct __trans_fct; __gconv_trans_context_fct __trans_context_fct; __gconv_trans_end_fct __trans_end_fct; void *__data; struct __gconv_trans_data *__next; }; struct __gconv_step { struct __gconv_loaded_object *__shlib_handle; __const char *__modname; int __counter; char *__from_name; char *__to_name; __gconv_fct __fct; __gconv_btowc_fct __btowc_fct; __gconv_init_fct __init_fct; __gconv_end_fct __end_fct; int __min_needed_from; int __max_needed_from; int __min_needed_to; int __max_needed_to; int __stateful; void *__data; }; struct __gconv_step_data { unsigned char *__outbuf; unsigned char *__outbufend; int __flags; int __invocation_counter; int __internal_use; __mbstate_t *__statep; __mbstate_t __state; struct __gconv_trans_data *__trans; }; typedef struct __gconv_info { size_t __nsteps; struct __gconv_step *__steps; __extension__ struct __gconv_step_data __data []; } *__gconv_t; # 45 "/usr/include/_G_config.h" 2 3 typedef union { struct __gconv_info __cd; struct { struct __gconv_info __cd; struct __gconv_step_data __data; } __combined; } _G_iconv_t; typedef int _G_int16_t __attribute__ ((__mode__ (__HI__))); typedef int _G_int32_t __attribute__ ((__mode__ (__SI__))); typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__))); typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__))); # 33 "/usr/include/libio.h" 2 3 # 53 "/usr/include/libio.h" 3 # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h" 1 3 # 43 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h" 3 typedef __builtin_va_list __gnuc_va_list; # 54 "/usr/include/libio.h" 2 3 # 162 "/usr/include/libio.h" 3 struct _IO_jump_t; struct _IO_FILE; # 172 "/usr/include/libio.h" 3 typedef void _IO_lock_t; struct _IO_marker { struct _IO_marker *_next; struct _IO_FILE *_sbuf; int _pos; # 195 "/usr/include/libio.h" 3 }; enum __codecvt_result { __codecvt_ok, __codecvt_partial, __codecvt_error, __codecvt_noconv }; # 263 "/usr/include/libio.h" 3 struct _IO_FILE { int _flags; char* _IO_read_ptr; char* _IO_read_end; char* _IO_read_base; char* _IO_write_base; char* _IO_write_ptr; char* _IO_write_end; char* _IO_buf_base; char* _IO_buf_end; char *_IO_save_base; char *_IO_backup_base; char *_IO_save_end; struct _IO_marker *_markers; struct _IO_FILE *_chain; int _fileno; int _flags2; __off_t _old_offset; unsigned short _cur_column; signed char _vtable_offset; char _shortbuf[1]; _IO_lock_t *_lock; # 311 "/usr/include/libio.h" 3 __off64_t _offset; void *__pad1; void *__pad2; int _mode; char _unused2[15 * sizeof (int) - 2 * sizeof (void *)]; }; struct _IO_FILE_plus; extern struct _IO_FILE_plus _IO_2_1_stdin_; extern struct _IO_FILE_plus _IO_2_1_stdout_; extern struct _IO_FILE_plus _IO_2_1_stderr_; # 350 "/usr/include/libio.h" 3 typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes); typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf, size_t __n); typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w); typedef int __io_close_fn (void *__cookie); typedef __io_read_fn cookie_read_function_t; typedef __io_write_fn cookie_write_function_t; typedef __io_seek_fn cookie_seek_function_t; typedef __io_close_fn cookie_close_function_t; typedef struct { __io_read_fn *read; __io_write_fn *write; __io_seek_fn *seek; __io_close_fn *close; } _IO_cookie_io_functions_t; typedef _IO_cookie_io_functions_t cookie_io_functions_t; struct _IO_cookie_file; extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write, void *__cookie, _IO_cookie_io_functions_t __fns); extern "C" { extern int __underflow (_IO_FILE *) throw (); extern int __uflow (_IO_FILE *) throw (); extern int __overflow (_IO_FILE *, int) throw (); extern wint_t __wunderflow (_IO_FILE *) throw (); extern wint_t __wuflow (_IO_FILE *) throw (); extern wint_t __woverflow (_IO_FILE *, wint_t) throw (); # 432 "/usr/include/libio.h" 3 extern int _IO_getc (_IO_FILE *__fp) throw (); extern int _IO_putc (int __c, _IO_FILE *__fp) throw (); extern int _IO_feof (_IO_FILE *__fp) throw (); extern int _IO_ferror (_IO_FILE *__fp) throw (); extern int _IO_peekc_locked (_IO_FILE *__fp) throw (); extern void _IO_flockfile (_IO_FILE *) throw (); extern void _IO_funlockfile (_IO_FILE *) throw (); extern int _IO_ftrylockfile (_IO_FILE *) throw (); # 462 "/usr/include/libio.h" 3 extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict, __gnuc_va_list, int *__restrict) throw (); extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict, __gnuc_va_list) throw (); extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t) throw (); extern size_t _IO_sgetn (_IO_FILE *, void *, size_t) throw (); extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int) throw (); extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int) throw (); extern void _IO_free_backup_area (_IO_FILE *) throw (); # 520 "/usr/include/libio.h" 3 } # 73 "/usr/include/stdio.h" 2 3 typedef __gnuc_va_list va_list; # 86 "/usr/include/stdio.h" 3 typedef _G_fpos_t fpos_t; typedef _G_fpos64_t fpos64_t; # 138 "/usr/include/stdio.h" 3 # 1 "/usr/include/bits/stdio_lim.h" 1 3 # 139 "/usr/include/stdio.h" 2 3 extern struct _IO_FILE *stdin; extern struct _IO_FILE *stdout; extern struct _IO_FILE *stderr; extern int remove (__const char *__filename) throw (); extern int rename (__const char *__old, __const char *__new) throw (); extern FILE *tmpfile (void) throw (); # 173 "/usr/include/stdio.h" 3 extern char *tmpnam (char *__s) throw (); extern FILE *tmpfile64 (void) throw (); extern char *tmpnam_r (char *__s) throw (); # 195 "/usr/include/stdio.h" 3 extern char *tempnam (__const char *__dir, __const char *__pfx) throw () __attribute__ ((__malloc__)); extern int fclose (FILE *__stream) throw (); extern int fflush (FILE *__stream) throw (); extern int fflush_unlocked (FILE *__stream) throw (); extern int fcloseall (void) throw (); extern FILE *fopen (__const char *__restrict __filename, __const char *__restrict __modes) throw (); extern FILE *freopen (__const char *__restrict __filename, __const char *__restrict __modes, FILE *__restrict __stream) throw (); # 241 "/usr/include/stdio.h" 3 extern FILE *fopen64 (__const char *__restrict __filename, __const char *__restrict __modes) throw (); extern FILE *freopen64 (__const char *__restrict __filename, __const char *__restrict __modes, FILE *__restrict __stream) throw (); extern FILE *fdopen (int __fd, __const char *__modes) throw (); extern FILE *fopencookie (void *__restrict __magic_cookie, __const char *__restrict __modes, _IO_cookie_io_functions_t __io_funcs) throw (); extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes) throw (); extern FILE *open_memstream (char **__restrict __bufloc, size_t *__restrict __sizeloc) throw (); extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) throw (); extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, int __modes, size_t __n) throw (); extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, size_t __size) throw (); extern void setlinebuf (FILE *__stream) throw (); extern int fprintf (FILE *__restrict __stream, __const char *__restrict __format, ...) throw (); extern int printf (__const char *__restrict __format, ...) throw (); extern int sprintf (char *__restrict __s, __const char *__restrict __format, ...) throw (); extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) throw (); extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg) throw (); extern int vsprintf (char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) throw (); extern int snprintf (char *__restrict __s, size_t __maxlen, __const char *__restrict __format, ...) throw () __attribute__ ((__format__ (__printf__, 3, 4))); extern int vsnprintf (char *__restrict __s, size_t __maxlen, __const char *__restrict __format, __gnuc_va_list __arg) throw () __attribute__ ((__format__ (__printf__, 3, 0))); extern int vasprintf (char **__restrict __ptr, __const char *__restrict __f, __gnuc_va_list __arg) throw () __attribute__ ((__format__ (__printf__, 2, 0))); extern int __asprintf (char **__restrict __ptr, __const char *__restrict __fmt, ...) throw () __attribute__ ((__format__ (__printf__, 2, 3))); extern int asprintf (char **__restrict __ptr, __const char *__restrict __fmt, ...) throw () __attribute__ ((__format__ (__printf__, 2, 3))); extern int vdprintf (int __fd, __const char *__restrict __fmt, __gnuc_va_list __arg) throw () __attribute__ ((__format__ (__printf__, 2, 0))); extern int dprintf (int __fd, __const char *__restrict __fmt, ...) throw () __attribute__ ((__format__ (__printf__, 2, 3))); extern int fscanf (FILE *__restrict __stream, __const char *__restrict __format, ...) throw (); extern int scanf (__const char *__restrict __format, ...) throw (); extern int sscanf (__const char *__restrict __s, __const char *__restrict __format, ...) throw (); extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) throw () __attribute__ ((__format__ (__scanf__, 2, 0))); extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg) throw () __attribute__ ((__format__ (__scanf__, 1, 0))); extern int vsscanf (__const char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) throw () __attribute__ ((__format__ (__scanf__, 2, 0))); extern int fgetc (FILE *__stream) throw (); extern int getc (FILE *__stream) throw (); extern int getchar (void) throw (); extern int getc_unlocked (FILE *__stream) throw (); extern int getchar_unlocked (void) throw (); extern int fgetc_unlocked (FILE *__stream) throw (); extern int fputc (int __c, FILE *__stream) throw (); extern int putc (int __c, FILE *__stream) throw (); extern int putchar (int __c) throw (); extern int fputc_unlocked (int __c, FILE *__stream) throw (); extern int putc_unlocked (int __c, FILE *__stream) throw (); extern int putchar_unlocked (int __c) throw (); extern int getw (FILE *__stream) throw (); extern int putw (int __w, FILE *__stream) throw (); extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) throw (); extern char *gets (char *__s) throw (); extern char *fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream) throw (); # 463 "/usr/include/stdio.h" 3 extern __ssize_t __getdelim (char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) throw (); extern __ssize_t getdelim (char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) throw (); extern __ssize_t getline (char **__restrict __lineptr, size_t *__restrict __n, FILE *__restrict __stream) throw (); extern int fputs (__const char *__restrict __s, FILE *__restrict __stream) throw (); extern int puts (__const char *__s) throw (); extern int ungetc (int __c, FILE *__stream) throw (); extern size_t fread (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) throw (); extern size_t fwrite (__const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __s) throw (); extern int fputs_unlocked (__const char *__restrict __s, FILE *__restrict __stream) throw (); extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) throw (); extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) throw (); extern int fseek (FILE *__stream, long int __off, int __whence) throw (); extern long int ftell (FILE *__stream) throw (); extern void rewind (FILE *__stream) throw (); # 530 "/usr/include/stdio.h" 3 extern int fseeko (FILE *__stream, __off_t __off, int __whence) throw (); extern __off_t ftello (FILE *__stream) throw (); # 546 "/usr/include/stdio.h" 3 extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) throw (); extern int fsetpos (FILE *__stream, __const fpos_t *__pos) throw (); # 565 "/usr/include/stdio.h" 3 extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence) throw (); extern __off64_t ftello64 (FILE *__stream) throw (); extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos) throw (); extern int fsetpos64 (FILE *__stream, __const fpos64_t *__pos) throw (); extern void clearerr (FILE *__stream) throw (); extern int feof (FILE *__stream) throw (); extern int ferror (FILE *__stream) throw (); extern void clearerr_unlocked (FILE *__stream) throw (); extern int feof_unlocked (FILE *__stream) throw (); extern int ferror_unlocked (FILE *__stream) throw (); extern void perror (__const char *__s) throw (); # 1 "/usr/include/bits/sys_errlist.h" 1 3 # 27 "/usr/include/bits/sys_errlist.h" 3 extern int sys_nerr; extern __const char *__const sys_errlist[]; extern int _sys_nerr; extern __const char *__const _sys_errlist[]; # 602 "/usr/include/stdio.h" 2 3 extern int fileno (FILE *__stream) throw (); extern int fileno_unlocked (FILE *__stream) throw (); extern FILE *popen (__const char *__command, __const char *__modes) throw (); extern int pclose (FILE *__stream) throw (); extern char *ctermid (char *__s) throw (); extern char *cuserid (char *__s) throw (); struct obstack; extern int obstack_printf (struct obstack *__restrict __obstack, __const char *__restrict __format, ...) throw () __attribute__ ((__format__ (__printf__, 2, 3))); extern int obstack_vprintf (struct obstack *__restrict __obstack, __const char *__restrict __format, __gnuc_va_list __args) throw () __attribute__ ((__format__ (__printf__, 2, 0))); extern void flockfile (FILE *__stream) throw (); extern int ftrylockfile (FILE *__stream) throw (); extern void funlockfile (FILE *__stream) throw (); # 679 "/usr/include/stdio.h" 3 } # 19 "../../opentss/trt" 2 # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stdarg.h" 1 3 # 20 "../../opentss/trt" 2 # 1 "/usr/include/signal.h" 1 3 # 31 "/usr/include/signal.h" 3 extern "C" { # 1 "/usr/include/bits/sigset.h" 1 3 # 103 "/usr/include/bits/sigset.h" 3 extern int __sigismember (__const __sigset_t *, int); extern int __sigaddset (__sigset_t *, int); extern int __sigdelset (__sigset_t *, int); # 34 "/usr/include/signal.h" 2 3 typedef __sig_atomic_t sig_atomic_t; # 58 "/usr/include/signal.h" 3 # 1 "/usr/include/bits/signum.h" 1 3 # 59 "/usr/include/signal.h" 2 3 # 73 "/usr/include/signal.h" 3 typedef void (*__sighandler_t) (int); extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler) throw (); extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler) throw (); extern __sighandler_t signal (int __sig, __sighandler_t __handler) throw (); # 102 "/usr/include/signal.h" 3 extern __sighandler_t bsd_signal (int __sig, __sighandler_t __handler) throw (); extern int kill (__pid_t __pid, int __sig) throw (); extern int killpg (__pid_t __pgrp, int __sig) throw (); extern int raise (int __sig) throw (); extern __sighandler_t ssignal (int __sig, __sighandler_t __handler) throw (); extern int gsignal (int __sig) throw (); extern void psignal (int __sig, __const char *__s) throw (); # 146 "/usr/include/signal.h" 3 extern int __sigpause (int __sig_or_mask, int __is_sig) throw (); extern int sigpause (int __mask) throw (); # 174 "/usr/include/signal.h" 3 extern int sigblock (int __mask) throw (); extern int sigsetmask (int __mask) throw (); extern int siggetmask (void) throw (); # 189 "/usr/include/signal.h" 3 typedef __sighandler_t sighandler_t; typedef __sighandler_t sig_t; # 205 "/usr/include/signal.h" 3 # 1 "/usr/include/bits/siginfo.h" 1 3 # 25 "/usr/include/bits/siginfo.h" 3 # 1 "/usr/include/bits/wordsize.h" 1 3 # 26 "/usr/include/bits/siginfo.h" 2 3 typedef union sigval { int sival_int; void *sival_ptr; } sigval_t; # 51 "/usr/include/bits/siginfo.h" 3 typedef struct siginfo { int si_signo; int si_errno; int si_code; union { int _pad[((128 / sizeof (int)) - 3)]; struct { __pid_t si_pid; __uid_t si_uid; } _kill; struct { int si_tid; int si_overrun; sigval_t si_sigval; } _timer; struct { __pid_t si_pid; __uid_t si_uid; sigval_t si_sigval; } _rt; struct { __pid_t si_pid; __uid_t si_uid; int si_status; __clock_t si_utime; __clock_t si_stime; } _sigchld; struct { void *si_addr; } _sigfault; struct { long int si_band; int si_fd; } _sigpoll; } _sifields; } siginfo_t; # 129 "/usr/include/bits/siginfo.h" 3 enum { SI_ASYNCNL = -6, SI_SIGIO, SI_ASYNCIO, SI_MESGQ, SI_TIMER, SI_QUEUE, SI_USER, SI_KERNEL = 0x80 }; enum { ILL_ILLOPC = 1, ILL_ILLOPN, ILL_ILLADR, ILL_ILLTRP, ILL_PRVOPC, ILL_PRVREG, ILL_COPROC, ILL_BADSTK }; enum { FPE_INTDIV = 1, FPE_INTOVF, FPE_FLTDIV, FPE_FLTOVF, FPE_FLTUND, FPE_FLTRES, FPE_FLTINV, FPE_FLTSUB }; enum { SEGV_MAPERR = 1, SEGV_ACCERR }; enum { BUS_ADRALN = 1, BUS_ADRERR, BUS_OBJERR }; enum { TRAP_BRKPT = 1, TRAP_TRACE }; enum { CLD_EXITED = 1, CLD_KILLED, CLD_DUMPED, CLD_TRAPPED, CLD_STOPPED, CLD_CONTINUED }; enum { POLL_IN = 1, POLL_OUT, POLL_MSG, POLL_ERR, POLL_PRI, POLL_HUP }; # 271 "/usr/include/bits/siginfo.h" 3 typedef struct sigevent { sigval_t sigev_value; int sigev_signo; int sigev_notify; union { int _pad[((64 / sizeof (int)) - 3)]; __pid_t _tid; struct { void (*_function) (sigval_t); void *_attribute; } _sigev_thread; } _sigev_un; } sigevent_t; enum { SIGEV_SIGNAL = 0, SIGEV_NONE, SIGEV_THREAD, SIGEV_THREAD_ID = 4 }; # 206 "/usr/include/signal.h" 2 3 extern int sigemptyset (sigset_t *__set) throw (); extern int sigfillset (sigset_t *__set) throw (); extern int sigaddset (sigset_t *__set, int __signo) throw (); extern int sigdelset (sigset_t *__set, int __signo) throw (); extern int sigismember (__const sigset_t *__set, int __signo) throw (); extern int sigisemptyset (__const sigset_t *__set) throw (); extern int sigandset (sigset_t *__set, __const sigset_t *__left, __const sigset_t *__right) throw (); extern int sigorset (sigset_t *__set, __const sigset_t *__left, __const sigset_t *__right) throw (); # 1 "/usr/include/bits/sigaction.h" 1 3 # 25 "/usr/include/bits/sigaction.h" 3 struct sigaction { union { __sighandler_t sa_handler; void (*sa_sigaction) (int, siginfo_t *, void *); } __sigaction_handler; __sigset_t sa_mask; int sa_flags; void (*sa_restorer) (void); }; # 239 "/usr/include/signal.h" 2 3 extern int sigprocmask (int __how, __const sigset_t *__restrict __set, sigset_t *__restrict __oset) throw (); extern int sigsuspend (__const sigset_t *__set) throw (); extern int sigaction (int __sig, __const struct sigaction *__restrict __act, struct sigaction *__restrict __oact) throw (); extern int sigpending (sigset_t *__set) throw (); extern int sigwait (__const sigset_t *__restrict __set, int *__restrict __sig) throw (); extern int sigwaitinfo (__const sigset_t *__restrict __set, siginfo_t *__restrict __info) throw (); extern int sigtimedwait (__const sigset_t *__restrict __set, siginfo_t *__restrict __info, __const struct timespec *__restrict __timeout) throw (); extern int sigqueue (__pid_t __pid, int __sig, __const union sigval __val) throw (); # 284 "/usr/include/signal.h" 3 extern __const char *__const _sys_siglist[64]; extern __const char *__const sys_siglist[64]; struct sigvec { __sighandler_t sv_handler; int sv_mask; int sv_flags; }; # 308 "/usr/include/signal.h" 3 extern int sigvec (int __sig, __const struct sigvec *__vec, struct sigvec *__ovec) throw (); # 1 "/usr/include/bits/sigcontext.h" 1 3 # 28 "/usr/include/bits/sigcontext.h" 3 # 1 "/usr/include/asm/sigcontext.h" 1 3 # 18 "/usr/include/asm/sigcontext.h" 3 struct _fpreg { unsigned short significand[4]; unsigned short exponent; }; struct _fpxreg { unsigned short significand[4]; unsigned short exponent; unsigned short padding[3]; }; struct _xmmreg { unsigned long element[4]; }; struct _fpstate { unsigned long cw; unsigned long sw; unsigned long tag; unsigned long ipoff; unsigned long cssel; unsigned long dataoff; unsigned long datasel; struct _fpreg _st[8]; unsigned short status; unsigned short magic; unsigned long _fxsr_env[6]; unsigned long mxcsr; unsigned long reserved; struct _fpxreg _fxsr_st[8]; struct _xmmreg _xmm[8]; unsigned long padding[56]; }; struct sigcontext { unsigned short gs, __gsh; unsigned short fs, __fsh; unsigned short es, __esh; unsigned short ds, __dsh; unsigned long edi; unsigned long esi; unsigned long ebp; unsigned long esp; unsigned long ebx; unsigned long edx; unsigned long ecx; unsigned long eax; unsigned long trapno; unsigned long err; unsigned long eip; unsigned short cs, __csh; unsigned long eflags; unsigned long esp_at_signal; unsigned short ss, __ssh; struct _fpstate * fpstate; unsigned long oldmask; unsigned long cr2; }; # 29 "/usr/include/bits/sigcontext.h" 2 3 # 314 "/usr/include/signal.h" 2 3 extern int sigreturn (struct sigcontext *__scp) throw (); # 326 "/usr/include/signal.h" 3 extern int siginterrupt (int __sig, int __interrupt) throw (); # 1 "/usr/include/bits/sigstack.h" 1 3 # 26 "/usr/include/bits/sigstack.h" 3 struct sigstack { void *ss_sp; int ss_onstack; }; enum { SS_ONSTACK = 1, SS_DISABLE }; # 50 "/usr/include/bits/sigstack.h" 3 typedef struct sigaltstack { void *ss_sp; int ss_flags; size_t ss_size; } stack_t; # 329 "/usr/include/signal.h" 2 3 # 1 "/usr/include/sys/ucontext.h" 1 3 # 27 "/usr/include/sys/ucontext.h" 3 # 1 "/usr/include/bits/sigcontext.h" 1 3 # 28 "/usr/include/sys/ucontext.h" 2 3 typedef int greg_t; typedef greg_t gregset_t[19]; enum { REG_GS = 0, REG_FS, REG_ES, REG_DS, REG_EDI, REG_ESI, REG_EBP, REG_ESP, REG_EBX, REG_EDX, REG_ECX, REG_EAX, REG_TRAPNO, REG_ERR, REG_EIP, REG_CS, REG_EFL, REG_UESP, REG_SS }; struct _libc_fpreg { unsigned short int significand[4]; unsigned short int exponent; }; struct _libc_fpstate { unsigned long int cw; unsigned long int sw; unsigned long int tag; unsigned long int ipoff; unsigned long int cssel; unsigned long int dataoff; unsigned long int datasel; struct _libc_fpreg _st[8]; unsigned long int status; }; typedef struct _libc_fpstate *fpregset_t; typedef struct { gregset_t gregs; fpregset_t fpregs; unsigned long int oldmask; unsigned long int cr2; } mcontext_t; typedef struct ucontext { unsigned long int uc_flags; struct ucontext *uc_link; stack_t uc_stack; mcontext_t uc_mcontext; __sigset_t uc_sigmask; struct _libc_fpstate __fpregs_mem; } ucontext_t; # 332 "/usr/include/signal.h" 2 3 extern int sigstack (struct sigstack *__ss, struct sigstack *__oss) throw (); extern int sigaltstack (__const struct sigaltstack *__restrict __ss, struct sigaltstack *__restrict __oss) throw (); extern int sighold (int __sig) throw (); extern int sigrelse (int __sig) throw (); extern int sigignore (int __sig) throw (); extern __sighandler_t sigset (int __sig, __sighandler_t __disp) throw (); # 1 "/usr/include/bits/pthreadtypes.h" 1 3 # 366 "/usr/include/signal.h" 2 3 extern int __libc_current_sigrtmin (void) throw (); extern int __libc_current_sigrtmax (void) throw (); } # 21 "../../opentss/trt" 2 # 1 "/usr/include/malloc.h" 1 3 # 46 "/usr/include/malloc.h" 3 # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h" 1 3 # 151 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h" 3 typedef int ptrdiff_t; # 47 "/usr/include/malloc.h" 2 3 # 106 "/usr/include/malloc.h" 3 extern "C" { extern void * malloc (size_t __size) throw () __attribute__ ((__malloc__)); extern void * calloc (size_t __nmemb, size_t __size) throw () __attribute__ ((__malloc__)); extern void * realloc (void * __ptr, size_t __size) throw () __attribute__ ((__malloc__)); extern void free (void * __ptr) throw (); extern void cfree (void * __ptr) throw (); extern void * memalign (size_t __alignment, size_t __size) throw (); extern void * valloc (size_t __size) throw () __attribute__ ((__malloc__)); extern void * pvalloc (size_t __size) throw () __attribute__ ((__malloc__)); extern void * (*__morecore) (ptrdiff_t __size); extern void * __default_morecore (ptrdiff_t __size) throw () __attribute__ ((__malloc__)); struct mallinfo { int arena; int ordblks; int smblks; int hblks; int hblkhd; int usmblks; int fsmblks; int uordblks; int fordblks; int keepcost; }; extern struct mallinfo mallinfo (void) throw (); # 187 "/usr/include/malloc.h" 3 extern int mallopt (int __param, int __val) throw (); extern int malloc_trim (size_t __pad) throw (); extern size_t malloc_usable_size (void * __ptr) throw (); extern void malloc_stats (void) throw (); extern void * malloc_get_state (void) throw (); extern int malloc_set_state (void * __ptr) throw (); extern void (*__malloc_initialize_hook) (void); extern void (*__free_hook) (void * __ptr, __const void *); extern void * (*__malloc_hook) (size_t __size, __const void *); extern void * (*__realloc_hook) (void * __ptr, size_t __size, __const void *); extern void * (*__memalign_hook) (size_t __alignment, size_t __size, __const void *); extern void (*__after_morecore_hook) (void); extern void __malloc_check_init (void) throw (); }; # 22 "../../opentss/trt" 2 # 1 "/usr/include/sys/time.h" 1 3 # 29 "/usr/include/sys/time.h" 3 # 1 "/usr/include/bits/time.h" 1 3 # 30 "/usr/include/sys/time.h" 2 3 # 39 "/usr/include/sys/time.h" 3 extern "C" { # 57 "/usr/include/sys/time.h" 3 struct timezone { int tz_minuteswest; int tz_dsttime; }; typedef struct timezone *__restrict __timezone_ptr_t; # 73 "/usr/include/sys/time.h" 3 extern int gettimeofday (struct timeval *__restrict __tv, __timezone_ptr_t __tz) throw (); extern int settimeofday (__const struct timeval *__tv, __const struct timezone *__tz) throw (); extern int adjtime (__const struct timeval *__delta, struct timeval *__olddelta) throw (); enum __itimer_which { ITIMER_REAL = 0, ITIMER_VIRTUAL = 1, ITIMER_PROF = 2 }; struct itimerval { struct timeval it_interval; struct timeval it_value; }; typedef int __itimer_which_t; extern int getitimer (__itimer_which_t __which, struct itimerval *__value) throw (); extern int setitimer (__itimer_which_t __which, __const struct itimerval *__restrict __new, struct itimerval *__restrict __old) throw (); extern int utimes (__const char *__file, __const struct timeval __tvp[2]) throw (); extern int lutimes (__const char *__file, __const struct timeval __tvp[2]) throw (); extern int futimes (int fd, __const struct timeval __tvp[2]) throw (); # 182 "/usr/include/sys/time.h" 3 } # 23 "../../opentss/trt" 2 # 1 "/usr/include/sys/resource.h" 1 3 # 25 "/usr/include/sys/resource.h" 3 # 1 "/usr/include/bits/resource.h" 1 3 # 32 "/usr/include/bits/resource.h" 3 enum __rlimit_resource { RLIMIT_CPU = 0, RLIMIT_FSIZE = 1, RLIMIT_DATA = 2, RLIMIT_STACK = 3, RLIMIT_CORE = 4, RLIMIT_RSS = 5, RLIMIT_NOFILE = 7, RLIMIT_OFILE = RLIMIT_NOFILE, RLIMIT_AS = 9, RLIMIT_NPROC = 6, RLIMIT_MEMLOCK = 8, RLIMIT_LOCKS = 10, RLIMIT_NLIMITS = 11, RLIM_NLIMITS = RLIMIT_NLIMITS }; # 107 "/usr/include/bits/resource.h" 3 typedef __rlim_t rlim_t; typedef __rlim64_t rlim64_t; struct rlimit { rlim_t rlim_cur; rlim_t rlim_max; }; struct rlimit64 { rlim64_t rlim_cur; rlim64_t rlim_max; }; enum __rusage_who { RUSAGE_SELF = 0, RUSAGE_CHILDREN = -1, RUSAGE_BOTH = -2 }; # 1 "/usr/include/bits/time.h" 1 3 # 151 "/usr/include/bits/resource.h" 2 3 struct rusage { struct timeval ru_utime; struct timeval ru_stime; long int ru_maxrss; long int ru_ixrss; long int ru_idrss; long int ru_isrss; long int ru_minflt; long int ru_majflt; long int ru_nswap; long int ru_inblock; long int ru_oublock; long int ru_msgsnd; long int ru_msgrcv; long int ru_nsignals; long int ru_nvcsw; long int ru_nivcsw; }; enum __priority_which { PRIO_PROCESS = 0, PRIO_PGRP = 1, PRIO_USER = 2 }; # 26 "/usr/include/sys/resource.h" 2 3 extern "C" { # 43 "/usr/include/sys/resource.h" 3 typedef int __rlimit_resource_t; typedef int __rusage_who_t; typedef int __priority_which_t; extern int getrlimit (__rlimit_resource_t __resource, struct rlimit *__rlimits) throw (); # 63 "/usr/include/sys/resource.h" 3 extern int getrlimit64 (__rlimit_resource_t __resource, struct rlimit64 *__rlimits) throw (); extern int setrlimit (__rlimit_resource_t __resource, __const struct rlimit *__rlimits) throw (); # 83 "/usr/include/sys/resource.h" 3 extern int setrlimit64 (__rlimit_resource_t __resource, __const struct rlimit64 *__rlimits) throw (); extern int getrusage (__rusage_who_t __who, struct rusage *__usage) throw (); extern int getpriority (__priority_which_t __which, id_t __who) throw (); extern int setpriority (__priority_which_t __which, id_t __who, int __prio) throw (); } # 24 "../../opentss/trt" 2 # 1 "/usr/include/sys/mman.h" 1 3 # 26 "/usr/include/sys/mman.h" 3 # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h" 1 3 # 27 "/usr/include/sys/mman.h" 2 3 # 42 "/usr/include/sys/mman.h" 3 # 1 "/usr/include/bits/mman.h" 1 3 # 43 "/usr/include/sys/mman.h" 2 3 extern "C" { # 58 "/usr/include/sys/mman.h" 3 extern void *mmap (void *__addr, size_t __len, int __prot, int __flags, int __fd, __off_t __offset) throw (); # 71 "/usr/include/sys/mman.h" 3 extern void *mmap64 (void *__addr, size_t __len, int __prot, int __flags, int __fd, __off64_t __offset) throw (); extern int munmap (void *__addr, size_t __len) throw (); extern int mprotect (void *__addr, size_t __len, int __prot) throw (); extern int msync (void *__addr, size_t __len, int __flags) throw (); extern int madvise (void *__addr, size_t __len, int __advice) throw (); extern int posix_madvise (void *__addr, size_t __len, int __advice) throw (); extern int mlock (__const void *__addr, size_t __len) throw (); extern int munlock (__const void *__addr, size_t __len) throw (); extern int mlockall (int __flags) throw (); extern int munlockall (void) throw (); extern void *mremap (void *__addr, size_t __old_len, size_t __new_len, int __may_move) throw (); extern int mincore (void *__start, size_t __len, unsigned char *__vec) throw (); extern int remap_file_pages (void *__start, size_t __size, int __prot, size_t __pgoff, int __flags) throw (); extern int shm_open (__const char *__name, int __oflag, mode_t __mode); extern int shm_unlink (__const char *__name); } # 26 "../../opentss/trt" 2 # 1 "/usr/include/sys/stat.h" 1 3 # 103 "/usr/include/sys/stat.h" 3 extern "C" { # 1 "/usr/include/bits/stat.h" 1 3 # 36 "/usr/include/bits/stat.h" 3 struct stat { __dev_t st_dev; unsigned short int __pad1; __ino_t st_ino; __mode_t st_mode; __nlink_t st_nlink; __uid_t st_uid; __gid_t st_gid; __dev_t st_rdev; unsigned short int __pad2; __off_t st_size; __blksize_t st_blksize; __blkcnt_t st_blocks; # 70 "/usr/include/bits/stat.h" 3 struct timespec st_atim; struct timespec st_mtim; struct timespec st_ctim; # 85 "/usr/include/bits/stat.h" 3 unsigned long int __unused4; unsigned long int __unused5; }; struct stat64 { __dev_t st_dev; unsigned int __pad1; __ino_t __st_ino; __mode_t st_mode; __nlink_t st_nlink; __uid_t st_uid; __gid_t st_gid; __dev_t st_rdev; unsigned int __pad2; __off64_t st_size; __blksize_t st_blksize; __blkcnt64_t st_blocks; struct timespec st_atim; struct timespec st_mtim; struct timespec st_ctim; # 127 "/usr/include/bits/stat.h" 3 __ino64_t st_ino; }; # 106 "/usr/include/sys/stat.h" 2 3 # 207 "/usr/include/sys/stat.h" 3 extern int stat (__const char *__restrict __file, struct stat *__restrict __buf) throw (); extern int fstat (int __fd, struct stat *__buf) throw (); # 226 "/usr/include/sys/stat.h" 3 extern int stat64 (__const char *__restrict __file, struct stat64 *__restrict __buf) throw (); extern int fstat64 (int __fd, struct stat64 *__buf) throw (); extern int lstat (__const char *__restrict __file, struct stat *__restrict __buf) throw (); # 248 "/usr/include/sys/stat.h" 3 extern int lstat64 (__const char *__restrict __file, struct stat64 *__restrict __buf) throw (); extern int chmod (__const char *__file, __mode_t __mode) throw (); extern int lchmod (__const char *__file, __mode_t __mode) throw (); extern int fchmod (int __fd, __mode_t __mode) throw (); extern __mode_t umask (__mode_t __mask) throw (); extern __mode_t getumask (void) throw (); extern int mkdir (__const char *__path, __mode_t __mode) throw (); extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev) throw (); extern int mkfifo (__const char *__path, __mode_t __mode) throw (); # 319 "/usr/include/sys/stat.h" 3 extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf) throw (); extern int __xstat (int __ver, __const char *__filename, struct stat *__stat_buf) throw (); extern int __lxstat (int __ver, __const char *__filename, struct stat *__stat_buf) throw (); # 343 "/usr/include/sys/stat.h" 3 extern int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf) throw (); extern int __xstat64 (int __ver, __const char *__filename, struct stat64 *__stat_buf) throw (); extern int __lxstat64 (int __ver, __const char *__filename, struct stat64 *__stat_buf) throw (); extern int __xmknod (int __ver, __const char *__path, __mode_t __mode, __dev_t *__dev) throw (); extern __inline__ int stat (__const char *__path, struct stat *__statbuf) throw () { return __xstat (3, __path, __statbuf); } extern __inline__ int lstat (__const char *__path, struct stat *__statbuf) throw () { return __lxstat (3, __path, __statbuf); } extern __inline__ int fstat (int __fd, struct stat *__statbuf) throw () { return __fxstat (3, __fd, __statbuf); } extern __inline__ int mknod (__const char *__path, __mode_t __mode, __dev_t __dev) throw () { return __xmknod (1, __path, __mode, &__dev); } extern __inline__ int stat64 (__const char *__path, struct stat64 *__statbuf) throw () { return __xstat64 (3, __path, __statbuf); } extern __inline__ int lstat64 (__const char *__path, struct stat64 *__statbuf) throw () { return __lxstat64 (3, __path, __statbuf); } extern __inline__ int fstat64 (int __fd, struct stat64 *__statbuf) throw () { return __fxstat64 (3, __fd, __statbuf); } } # 28 "../../opentss/trt" 2 # 1 "/usr/include/fcntl.h" 1 3 # 29 "/usr/include/fcntl.h" 3 extern "C" { # 1 "/usr/include/bits/fcntl.h" 1 3 # 136 "/usr/include/bits/fcntl.h" 3 struct flock { short int l_type; short int l_whence; __off_t l_start; __off_t l_len; __pid_t l_pid; }; struct flock64 { short int l_type; short int l_whence; __off64_t l_start; __off64_t l_len; __pid_t l_pid; }; # 34 "/usr/include/fcntl.h" 2 3 # 60 "/usr/include/fcntl.h" 3 extern int fcntl (int __fd, int __cmd, ...) throw (); extern int open (__const char *__file, int __oflag, ...) throw (); # 76 "/usr/include/fcntl.h" 3 extern int open64 (__const char *__file, int __oflag, ...) throw (); extern int creat (__const char *__file, __mode_t __mode) throw (); # 93 "/usr/include/fcntl.h" 3 extern int creat64 (__const char *__file, __mode_t __mode) throw (); # 130 "/usr/include/fcntl.h" 3 extern int posix_fadvise (int __fd, __off_t __offset, size_t __len, int __advise) throw (); # 142 "/usr/include/fcntl.h" 3 extern int posix_fadvise64 (int __fd, __off64_t __offset, size_t __len, int __advise) throw (); extern int posix_fallocate (int __fd, __off_t __offset, size_t __len) throw (); # 160 "/usr/include/fcntl.h" 3 extern int posix_fallocate64 (int __fd, __off64_t __offset, size_t __len) throw (); } # 29 "../../opentss/trt" 2 # 1 "/usr/include/regex.h" 1 3 # 27 "/usr/include/regex.h" 3 extern "C" { # 43 "/usr/include/regex.h" 3 typedef long int s_reg_t; typedef unsigned long int active_reg_t; typedef unsigned long int reg_syntax_t; # 175 "/usr/include/regex.h" 3 extern reg_syntax_t re_syntax_options; # 293 "/usr/include/regex.h" 3 typedef enum { REG_ENOSYS = -1, REG_NOERROR = 0, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE, REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN, REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND, REG_ESIZE, REG_ERPAREN } reg_errcode_t; # 333 "/usr/include/regex.h" 3 struct re_pattern_buffer { unsigned char *buffer; unsigned long int allocated; unsigned long int used; reg_syntax_t syntax; char *fastmap; char * translate; size_t re_nsub; unsigned can_be_null : 1; # 378 "/usr/include/regex.h" 3 unsigned regs_allocated : 2; unsigned fastmap_accurate : 1; unsigned no_sub : 1; unsigned not_bol : 1; unsigned not_eol : 1; unsigned newline_anchor : 1; }; typedef struct re_pattern_buffer regex_t; typedef int regoff_t; struct re_registers { unsigned num_regs; regoff_t *start; regoff_t *end; }; # 428 "/usr/include/regex.h" 3 typedef struct { regoff_t rm_so; regoff_t rm_eo; } regmatch_t; # 454 "/usr/include/regex.h" 3 extern reg_syntax_t re_set_syntax (reg_syntax_t syntax); extern const char *re_compile_pattern (const char *pattern, size_t length, struct re_pattern_buffer *buffer); extern int re_compile_fastmap (struct re_pattern_buffer *buffer); extern int re_search (struct re_pattern_buffer *buffer, const char *string, int length, int start, int range, struct re_registers *regs); extern int re_search_2 (struct re_pattern_buffer *buffer, const char *string1, int length1, const char *string2, int length2, int start, int range, struct re_registers *regs, int stop); extern int re_match (struct re_pattern_buffer *buffer, const char *string, int length, int start, struct re_registers *regs); extern int re_match_2 (struct re_pattern_buffer *buffer, const char *string1, int length1, const char *string2, int length2, int start, struct re_registers *regs, int stop); # 514 "/usr/include/regex.h" 3 extern void re_set_registers (struct re_pattern_buffer *buffer, struct re_registers *regs, unsigned num_regs, regoff_t *starts, regoff_t *ends); # 547 "/usr/include/regex.h" 3 extern int regcomp (regex_t *__restrict __preg, const char *__restrict __pattern, int __cflags); extern int regexec (const regex_t *__restrict __preg, const char *__restrict __string, size_t __nmatch, regmatch_t __pmatch[], int __eflags); extern size_t regerror (int __errcode, const regex_t *__preg, char *__errbuf, size_t __errbuf_size); extern void regfree (regex_t *__preg); } # 30 "../../opentss/trt" 2 # 1 "/usr/include/c++/3.2.2/new" 1 3 # 41 "/usr/include/c++/3.2.2/new" 3 # 1 "/usr/include/c++/3.2.2/cstddef" 1 3 # 47 "/usr/include/c++/3.2.2/cstddef" 3 # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h" 1 3 # 49 "/usr/include/c++/3.2.2/cstddef" 2 3 namespace std { using ::ptrdiff_t; using ::size_t; } # 42 "/usr/include/c++/3.2.2/new" 2 3 # 1 "/usr/include/c++/3.2.2/exception" 1 3 # 40 "/usr/include/c++/3.2.2/exception" 3 extern "C++" { namespace std { class exception { public: exception() throw() { } virtual ~exception() throw(); virtual const char* what() const throw(); }; class bad_exception : public exception { public: bad_exception() throw() { } virtual ~bad_exception() throw(); }; typedef void (*terminate_handler) (); typedef void (*unexpected_handler) (); terminate_handler set_terminate(terminate_handler) throw(); void terminate() __attribute__ ((__noreturn__)); unexpected_handler set_unexpected(unexpected_handler) throw(); void unexpected() __attribute__ ((__noreturn__)); # 98 "/usr/include/c++/3.2.2/exception" 3 bool uncaught_exception() throw(); } namespace __gnu_cxx { # 111 "/usr/include/c++/3.2.2/exception" 3 void __verbose_terminate_handler (); } } # 43 "/usr/include/c++/3.2.2/new" 2 3 extern "C++" { namespace std { class bad_alloc : public exception { public: bad_alloc() throw() { } virtual ~bad_alloc() throw(); }; struct nothrow_t { }; extern const nothrow_t nothrow; typedef void (*new_handler)(); new_handler set_new_handler(new_handler) throw(); } # 79 "/usr/include/c++/3.2.2/new" 3 void* operator new(std::size_t) throw (std::bad_alloc); void* operator new[](std::size_t) throw (std::bad_alloc); void operator delete(void*) throw(); void operator delete[](void*) throw(); void* operator new(std::size_t, const std::nothrow_t&) throw(); void* operator new[](std::size_t, const std::nothrow_t&) throw(); void operator delete(void*, const std::nothrow_t&) throw(); void operator delete[](void*, const std::nothrow_t&) throw(); inline void* operator new(std::size_t, void* __p) throw() { return __p; } inline void* operator new[](std::size_t, void* __p) throw() { return __p; } inline void operator delete (void*, void*) throw() { }; inline void operator delete[](void*, void*) throw() { }; } # 31 "../../opentss/trt" 2 # 1 "/usr/include/c++/3.2.2/typeinfo" 1 3 # 40 "/usr/include/c++/3.2.2/typeinfo" 3 extern "C++" { namespace __cxxabiv1 { class __class_type_info; } # 55 "/usr/include/c++/3.2.2/typeinfo" 3 namespace std { class type_info { public: virtual ~type_info(); private: type_info& operator=(const type_info&); type_info(const type_info&); protected: const char *__name; protected: explicit type_info(const char *__n): __name(__n) { } public: const char* name() const { return __name; } # 98 "/usr/include/c++/3.2.2/typeinfo" 3 bool before(const type_info& __arg) const { return __name < __arg.__name; } bool operator==(const type_info& __arg) const { return __name == __arg.__name; } bool operator!=(const type_info& __arg) const { return !operator==(__arg); } public: virtual bool __is_pointer_p() const; virtual bool __is_function_p() const; virtual bool __do_catch(const type_info *__thr_type, void **__thr_obj, unsigned __outer) const; virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target, void **__obj_ptr) const; }; class bad_cast : public exception { public: bad_cast() throw() { } virtual ~bad_cast() throw(); }; class bad_typeid : public exception { public: bad_typeid () throw() { } virtual ~bad_typeid() throw(); }; } } # 33 "../../opentss/trt" 2 # 1 "../../dmpi/dmpi.h" 1 # 13 "../../dmpi/dmpi.h" # 1 "/usr/include/dlfcn.h" 1 3 # 25 "/usr/include/dlfcn.h" 3 # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h" 1 3 # 26 "/usr/include/dlfcn.h" 2 3 # 1 "/usr/include/bits/dlfcn.h" 1 3 # 57 "/usr/include/bits/dlfcn.h" 3 extern "C" { extern void _dl_mcount_wrapper_check (void *__selfpc) throw (); } # 29 "/usr/include/dlfcn.h" 2 3 # 45 "/usr/include/dlfcn.h" 3 extern "C" { extern void *dlopen (__const char *__file, int __mode) throw (); extern int dlclose (void *__handle) throw (); extern void *dlsym (void *__restrict __handle, __const char *__restrict __name) throw (); extern void *dlvsym (void *__restrict __handle, __const char *__restrict __name, __const char *__restrict __version) throw (); extern char *dlerror (void) throw (); typedef struct { __const char *dli_fname; void *dli_fbase; __const char *dli_sname; void *dli_saddr; } Dl_info; extern int dladdr (__const void *__address, Dl_info *__info) throw (); extern int dladdr1 (__const void *__address, Dl_info *__info, void **__extra_info, int __flags) throw (); enum { RTLD_DL_SYMENT = 1, RTLD_DL_LINKMAP = 2 }; extern int dlinfo (void *__restrict __handle, int __request, void *__restrict __arg); enum { RTLD_DI_LINKMAP = 2, RTLD_DI_SERINFO = 4, RTLD_DI_SERINFOSIZE = 5, RTLD_DI_ORIGIN = 6, RTLD_DI_LMID = 1, RTLD_DI_CONFIGADDR = 3 }; typedef struct { char *dls_name; unsigned int dls_flags; } Dl_serpath; typedef struct { size_t dls_size; unsigned int dls_cnt; Dl_serpath dls_serpath[1]; } Dl_serinfo; } # 14 "../../dmpi/dmpi.h" 2 # 1 "/usr/include/netdb.h" 1 3 # 28 "/usr/include/netdb.h" 3 # 1 "/usr/include/netinet/in.h" 1 3 # 23 "/usr/include/netinet/in.h" 3 # 1 "/usr/include/stdint.h" 1 3 # 28 "/usr/include/stdint.h" 3 # 1 "/usr/include/bits/wordsize.h" 1 3 # 29 "/usr/include/stdint.h" 2 3 # 49 "/usr/include/stdint.h" 3 typedef unsigned char uint8_t; typedef unsigned short int uint16_t; typedef unsigned int uint32_t; __extension__ typedef unsigned long long int uint64_t; typedef signed char int_least8_t; typedef short int int_least16_t; typedef int int_least32_t; __extension__ typedef long long int int_least64_t; typedef unsigned char uint_least8_t; typedef unsigned short int uint_least16_t; typedef unsigned int uint_least32_t; __extension__ typedef unsigned long long int uint_least64_t; typedef signed char int_fast8_t; typedef int int_fast16_t; typedef int int_fast32_t; __extension__ typedef long long int int_fast64_t; typedef unsigned char uint_fast8_t; typedef unsigned int uint_fast16_t; typedef unsigned int uint_fast32_t; __extension__ typedef unsigned long long int uint_fast64_t; # 129 "/usr/include/stdint.h" 3 typedef unsigned int uintptr_t; # 138 "/usr/include/stdint.h" 3 __extension__ typedef long long int intmax_t; __extension__ typedef unsigned long long int uintmax_t; # 24 "/usr/include/netinet/in.h" 2 3 extern "C" { enum { IPPROTO_IP = 0, IPPROTO_HOPOPTS = 0, IPPROTO_ICMP = 1, IPPROTO_IGMP = 2, IPPROTO_IPIP = 4, IPPROTO_TCP = 6, IPPROTO_EGP = 8, IPPROTO_PUP = 12, IPPROTO_UDP = 17, IPPROTO_IDP = 22, IPPROTO_TP = 29, IPPROTO_IPV6 = 41, IPPROTO_ROUTING = 43, IPPROTO_FRAGMENT = 44, IPPROTO_RSVP = 46, IPPROTO_GRE = 47, IPPROTO_ESP = 50, IPPROTO_AH = 51, IPPROTO_ICMPV6 = 58, IPPROTO_NONE = 59, IPPROTO_DSTOPTS = 60, IPPROTO_MTP = 92, IPPROTO_ENCAP = 98, IPPROTO_PIM = 103, IPPROTO_COMP = 108, IPPROTO_SCTP = 132, IPPROTO_RAW = 255, IPPROTO_MAX }; typedef uint16_t in_port_t; enum { IPPORT_ECHO = 7, IPPORT_DISCARD = 9, IPPORT_SYSTAT = 11, IPPORT_DAYTIME = 13, IPPORT_NETSTAT = 15, IPPORT_FTP = 21, IPPORT_TELNET = 23, IPPORT_SMTP = 25, IPPORT_TIMESERVER = 37, IPPORT_NAMESERVER = 42, IPPORT_WHOIS = 43, IPPORT_MTP = 57, IPPORT_TFTP = 69, IPPORT_RJE = 77, IPPORT_FINGER = 79, IPPORT_TTYLINK = 87, IPPORT_SUPDUP = 95, IPPORT_EXECSERVER = 512, IPPORT_LOGINSERVER = 513, IPPORT_CMDSERVER = 514, IPPORT_EFSSERVER = 520, IPPORT_BIFFUDP = 512, IPPORT_WHOSERVER = 513, IPPORT_ROUTESERVER = 520, IPPORT_RESERVED = 1024, IPPORT_USERRESERVED = 5000 }; typedef uint32_t in_addr_t; struct in_addr { in_addr_t s_addr; }; # 192 "/usr/include/netinet/in.h" 3 struct in6_addr { union { uint8_t u6_addr8[16]; uint16_t u6_addr16[8]; uint32_t u6_addr32[4]; } in6_u; }; extern const struct in6_addr in6addr_any; extern const struct in6_addr in6addr_loopback; # 1 "/usr/include/bits/socket.h" 1 3 # 29 "/usr/include/bits/socket.h" 3 # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h" 1 3 # 30 "/usr/include/bits/socket.h" 2 3 # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h" 1 3 # 11 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h" 3 # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h" 1 3 # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h" 1 3 # 132 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h" 3 # 1 "/usr/include/limits.h" 1 3 # 144 "/usr/include/limits.h" 3 # 1 "/usr/include/bits/posix1_lim.h" 1 3 # 126 "/usr/include/bits/posix1_lim.h" 3 # 1 "/usr/include/bits/local_lim.h" 1 3 # 36 "/usr/include/bits/local_lim.h" 3 # 1 "/usr/include/linux/limits.h" 1 3 # 37 "/usr/include/bits/local_lim.h" 2 3 # 127 "/usr/include/bits/posix1_lim.h" 2 3 # 145 "/usr/include/limits.h" 2 3 # 1 "/usr/include/bits/posix2_lim.h" 1 3 # 149 "/usr/include/limits.h" 2 3 # 1 "/usr/include/bits/xopen_lim.h" 1 3 # 34 "/usr/include/bits/xopen_lim.h" 3 # 1 "/usr/include/bits/stdio_lim.h" 1 3 # 35 "/usr/include/bits/xopen_lim.h" 2 3 # 136 "/usr/include/bits/xopen_lim.h" 3 # 1 "/usr/include/bits/wordsize.h" 1 3 # 137 "/usr/include/bits/xopen_lim.h" 2 3 # 153 "/usr/include/limits.h" 2 3 # 133 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h" 2 3 # 8 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/syslimits.h" 2 3 # 12 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/limits.h" 2 3 # 32 "/usr/include/bits/socket.h" 2 3 # 41 "/usr/include/bits/socket.h" 3 enum __socket_type { SOCK_STREAM = 1, SOCK_DGRAM = 2, SOCK_RAW = 3, SOCK_RDM = 4, SOCK_SEQPACKET = 5, SOCK_PACKET = 10 }; # 142 "/usr/include/bits/socket.h" 3 # 1 "/usr/include/bits/sockaddr.h" 1 3 # 29 "/usr/include/bits/sockaddr.h" 3 typedef unsigned short int sa_family_t; # 143 "/usr/include/bits/socket.h" 2 3 struct sockaddr { sa_family_t sa_family; char sa_data[14]; }; # 162 "/usr/include/bits/socket.h" 3 struct sockaddr_storage { sa_family_t ss_family; __uint32_t __ss_align; char __ss_padding[(128 - (2 * sizeof (__uint32_t)))]; }; enum { MSG_OOB = 0x01, MSG_PEEK = 0x02, MSG_DONTROUTE = 0x04, MSG_TRYHARD = MSG_DONTROUTE, MSG_CTRUNC = 0x08, MSG_PROXY = 0x10, MSG_TRUNC = 0x20, MSG_DONTWAIT = 0x40, MSG_EOR = 0x80, MSG_WAITALL = 0x100, MSG_FIN = 0x200, MSG_SYN = 0x400, MSG_CONFIRM = 0x800, MSG_RST = 0x1000, MSG_ERRQUEUE = 0x2000, MSG_NOSIGNAL = 0x4000, MSG_MORE = 0x8000 }; struct msghdr { void *msg_name; socklen_t msg_namelen; struct iovec *msg_iov; size_t msg_iovlen; void *msg_control; size_t msg_controllen; int msg_flags; }; struct cmsghdr { size_t cmsg_len; int cmsg_level; int cmsg_type; __extension__ unsigned char __cmsg_data []; }; # 257 "/usr/include/bits/socket.h" 3 extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) throw (); # 284 "/usr/include/bits/socket.h" 3 enum { SCM_RIGHTS = 0x01, SCM_CREDENTIALS = 0x02, __SCM_CONNECT = 0x03 }; struct ucred { pid_t pid; uid_t uid; gid_t gid; }; # 1 "/usr/include/asm/socket.h" 1 3 # 1 "/usr/include/asm/sockios.h" 1 3 # 5 "/usr/include/asm/socket.h" 2 3 # 306 "/usr/include/bits/socket.h" 2 3 struct linger { int l_onoff; int l_linger; }; # 215 "/usr/include/netinet/in.h" 2 3 struct sockaddr_in { sa_family_t sin_family; in_port_t sin_port; struct in_addr sin_addr; unsigned char sin_zero[sizeof (struct sockaddr) - (sizeof (unsigned short int)) - sizeof (in_port_t) - sizeof (struct in_addr)]; }; struct sockaddr_in6 { sa_family_t sin6_family; in_port_t sin6_port; uint32_t sin6_flowinfo; struct in6_addr sin6_addr; uint32_t sin6_scope_id; }; struct ipv6_mreq { struct in6_addr ipv6mr_multiaddr; unsigned int ipv6mr_interface; }; # 1 "/usr/include/bits/in.h" 1 3 # 66 "/usr/include/bits/in.h" 3 struct ip_opts { struct in_addr ip_dst; char ip_opts[40]; }; struct ip_mreq { struct in_addr imr_multiaddr; struct in_addr imr_interface; }; struct ip_mreqn { struct in_addr imr_multiaddr; struct in_addr imr_address; int imr_ifindex; }; struct in_pktinfo { int ipi_ifindex; struct in_addr ipi_spec_dst; struct in_addr ipi_addr; }; # 253 "/usr/include/netinet/in.h" 2 3 # 261 "/usr/include/netinet/in.h" 3 extern uint32_t ntohl (uint32_t __netlong) throw () __attribute__ ((__const__)); extern uint16_t ntohs (uint16_t __netshort) throw () __attribute__ ((__const__)); extern uint32_t htonl (uint32_t __hostlong) throw () __attribute__ ((__const__)); extern uint16_t htons (uint16_t __hostshort) throw () __attribute__ ((__const__)); # 1 "/usr/include/bits/byteswap.h" 1 3 # 273 "/usr/include/netinet/in.h" 2 3 # 335 "/usr/include/netinet/in.h" 3 extern int bindresvport (int __sockfd, struct sockaddr_in *__sock_in) throw (); extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in) throw (); # 363 "/usr/include/netinet/in.h" 3 struct in6_pktinfo { struct in6_addr ipi6_addr; unsigned int ipi6_ifindex; }; } # 29 "/usr/include/netdb.h" 2 3 # 1 "/usr/include/rpc/netdb.h" 1 3 # 42 "/usr/include/rpc/netdb.h" 3 # 1 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/include/stddef.h" 1 3 # 43 "/usr/include/rpc/netdb.h" 2 3 extern "C" { struct rpcent { char *r_name; char **r_aliases; int r_number; }; extern void setrpcent (int __stayopen) throw (); extern void endrpcent (void) throw (); extern struct rpcent *getrpcbyname (__const char *__name) throw (); extern struct rpcent *getrpcbynumber (int __number) throw (); extern struct rpcent *getrpcent (void) throw (); extern int getrpcbyname_r (__const char *__name, struct rpcent *__result_buf, char *__buffer, size_t __buflen, struct rpcent **__result) throw (); extern int getrpcbynumber_r (int __number, struct rpcent *__result_buf, char *__buffer, size_t __buflen, struct rpcent **__result) throw (); extern int getrpcent_r (struct rpcent *__result_buf, char *__buffer, size_t __buflen, struct rpcent **__result) throw (); } # 34 "/usr/include/netdb.h" 2 3 # 1 "/usr/include/bits/siginfo.h" 1 3 # 25 "/usr/include/bits/siginfo.h" 3 # 1 "/usr/include/bits/wordsize.h" 1 3 # 26 "/usr/include/bits/siginfo.h" 2 3 # 39 "/usr/include/netdb.h" 2 3 # 1 "/usr/include/bits/netdb.h" 1 3 # 27 "/usr/include/bits/netdb.h" 3 struct netent { char *n_name; char **n_aliases; int n_addrtype; uint32_t n_net; }; # 44 "/usr/include/netdb.h" 2 3 # 54 "/usr/include/netdb.h" 3 extern "C" { extern int *__h_errno_location (void) throw () __attribute__ ((__const__)); # 88 "/usr/include/netdb.h" 3 extern void herror (__const char *__str) throw (); extern __const char *hstrerror (int __err_num) throw (); struct hostent { char *h_name; char **h_aliases; int h_addrtype; int h_length; char **h_addr_list; }; extern void sethostent (int __stay_open) throw (); extern void endhostent (void) throw (); extern struct hostent *gethostent (void) throw (); extern struct hostent *gethostbyaddr (__const void *__addr, __socklen_t __len, int __type) throw (); extern struct hostent *gethostbyname (__const char *__name) throw (); extern struct hostent *gethostbyname2 (__const char *__name, int __af) throw (); extern int gethostent_r (struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop) throw (); extern int gethostbyaddr_r (__const void *__restrict __addr, __socklen_t __len, int __type, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop) throw (); extern int gethostbyname_r (__const char *__restrict __name, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop) throw (); extern int gethostbyname2_r (__const char *__restrict __name, int __af, struct hostent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct hostent **__restrict __result, int *__restrict __h_errnop) throw (); extern void setnetent (int __stay_open) throw (); extern void endnetent (void) throw (); extern struct netent *getnetent (void) throw (); extern struct netent *getnetbyaddr (uint32_t __net, int __type) throw (); extern struct netent *getnetbyname (__const char *__name) throw (); extern int getnetent_r (struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop) throw (); extern int getnetbyaddr_r (uint32_t __net, int __type, struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop) throw (); extern int getnetbyname_r (__const char *__restrict __name, struct netent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct netent **__restrict __result, int *__restrict __h_errnop) throw (); struct servent { char *s_name; char **s_aliases; int s_port; char *s_proto; }; extern void setservent (int __stay_open) throw (); extern void endservent (void) throw (); extern struct servent *getservent (void) throw (); extern struct servent *getservbyname (__const char *__name, __const char *__proto) throw (); extern struct servent *getservbyport (int __port, __const char *__proto) throw (); extern int getservent_r (struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result) throw (); extern int getservbyname_r (__const char *__restrict __name, __const char *__restrict __proto, struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result) throw (); extern int getservbyport_r (int __port, __const char *__restrict __proto, struct servent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct servent **__restrict __result) throw (); struct protoent { char *p_name; char **p_aliases; int p_proto; }; extern void setprotoent (int __stay_open) throw (); extern void endprotoent (void) throw (); extern struct protoent *getprotoent (void) throw (); extern struct protoent *getprotobyname (__const char *__name) throw (); extern struct protoent *getprotobynumber (int __proto) throw (); extern int getprotoent_r (struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result) throw (); extern int getprotobyname_r (__const char *__restrict __name, struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result) throw (); extern int getprotobynumber_r (int __proto, struct protoent *__restrict __result_buf, char *__restrict __buf, size_t __buflen, struct protoent **__restrict __result) throw (); extern int setnetgrent (__const char *__netgroup) throw (); extern void endnetgrent (void) throw (); extern int getnetgrent (char **__restrict __hostp, char **__restrict __userp, char **__restrict __domainp) throw (); extern int innetgr (__const char *__netgroup, __const char *__host, __const char *__user, __const char *domain) throw (); extern int getnetgrent_r (char **__restrict __hostp, char **__restrict __userp, char **__restrict __domainp, char *__restrict __buffer, size_t __buflen) throw (); # 334 "/usr/include/netdb.h" 3 extern int rcmd (char **__restrict __ahost, unsigned short int __rport, __const char *__restrict __locuser, __const char *__restrict __remuser, __const char *__restrict __cmd, int *__restrict __fd2p) throw (); extern int rcmd_af (char **__restrict __ahost, unsigned short int __rport, __const char *__restrict __locuser, __const char *__restrict __remuser, __const char *__restrict __cmd, int *__restrict __fd2p, sa_family_t __af) throw (); extern int rexec (char **__restrict __ahost, int __rport, __const char *__restrict __name, __const char *__restrict __pass, __const char *__restrict __cmd, int *__restrict __fd2p) throw (); extern int rexec_af (char **__restrict __ahost, int __rport, __const char *__restrict __name, __const char *__restrict __pass, __const char *__restrict __cmd, int *__restrict __fd2p, sa_family_t __af) throw (); extern int ruserok (__const char *__rhost, int __suser, __const char *__remuser, __const char *__locuser) throw (); extern int ruserok_af (__const char *__rhost, int __suser, __const char *__remuser, __const char *__locuser, sa_family_t __af) throw (); extern int rresvport (int *__alport) throw (); extern int rresvport_af (int *__alport, sa_family_t __af) throw (); struct addrinfo { int ai_flags; int ai_family; int ai_socktype; int ai_protocol; socklen_t ai_addrlen; struct sockaddr *ai_addr; char *ai_canonname; struct addrinfo *ai_next; }; struct gaicb { const char *ar_name; const char *ar_service; const struct addrinfo *ar_request; struct addrinfo *ar_result; int __return; int __unused[5]; }; # 459 "/usr/include/netdb.h" 3 extern int getaddrinfo (__const char *__restrict __name, __const char *__restrict __service, __const struct addrinfo *__restrict __req, struct addrinfo **__restrict __pai) throw (); extern void freeaddrinfo (struct addrinfo *__ai) throw (); extern __const char *gai_strerror (int __ecode) throw (); extern int getnameinfo (__const struct sockaddr *__restrict __sa, socklen_t __salen, char *__restrict __host, socklen_t __hostlen, char *__restrict __serv, socklen_t __servlen, unsigned int __flags) throw (); extern int getaddrinfo_a (int __mode, struct gaicb *__list[], int __ent, struct sigevent *__restrict __sig) throw (); extern int gai_suspend (__const struct gaicb *__const __list[], int __ent, __const struct timespec *__timeout) throw (); extern int gai_error (struct gaicb *__req) throw (); extern int gai_cancel (struct gaicb *__gaicbp) throw (); } # 15 "../../dmpi/dmpi.h" 2 # 26 "../../dmpi/dmpi.h" struct mpi_portal_status { int MPI_SOURCE; int MPI_TAG; int MPI_ERROR; unsigned char real_status[64]; }; struct mpi_portal_request { unsigned char real_request[64]; }; # 54 "../../dmpi/dmpi.h" struct mpi_portal_t { int version; const char *revision; const char *name; const char *build_info; int (*_MPI_Init)(int *pargc, char ***pargv); int (*_MPI_Error_string)(int errcode, char *msg, int *plen); int (*_MPI_Barrier)(int comm); int (*_MPI_Comm_rank)(int comm, int *rank); int (*_MPI_Comm_size)(int comm, int *psize); int (*_MPI_Finalize)(void); int (*_MPI_Get_count)(struct mpi_portal_status *stat, int dtype, int *count); int (*_MPI_Iprobe)(int src,int tag,int comm,int *flag, struct mpi_portal_status *stat); int (*_MPI_Recv)(void *buf, int count, int dtype, int src, int tag, int comm, struct mpi_portal_status *stat); int (*_MPI_Send)(void *buf, int count, int dtype, int dest, int tag, int comm); int (*_MPI_Isend)(void *buf, int count, int dtype,int dest, int tag, int comm, struct mpi_portal_request *req); int (*_MPI_Test)(struct mpi_portal_request *req, int *flag, struct mpi_portal_status *stat); int (*_MPI_Wait)(struct mpi_portal_request *req, struct mpi_portal_status *stat); double (*_MPI_Wtime)(void); int (*_DMPI_Levels)(void); int (*_DMPI_Id)(int level, int rank); int (*_DMPI_Async_init)(void); void (*_DMPI_Async_done)(void); int *(*_DMPI_Async_in_handler)(void); int (*_DMPI_Async_enable)(void); int (*_DMPI_Async_disable)(void); int (*_DMPI_Async_ping)(int); int (*_DMPI_Async_set_handler)(void (*handler)(void)); }; extern char dmpi_so[1024]; extern int dmpi_meta; # 102 "../../dmpi/dmpi.h" extern struct mpi_portal_t *mpi_portal; # 145 "../../dmpi/dmpi.h" extern "C" { extern int MPI_Init (int *a, char ***b); } # 34 "../../opentss/trt" 2 # 68 "../../opentss/trt" namespace ts { extern int myRank; }; # 79 "../../opentss/trt" extern "C" { char *__cxa_demangle (const char *__mangled_name, char *__output_buffer, size_t *__length, int *__status); } namespace ts { # 107 "../../opentss/trt" typedef struct { volatile int counter; } atomic_t; # 134 "../../opentss/trt" static __inline__ void atomic_add(int i, atomic_t *v) { __asm__ __volatile__( "" "addl %1,%0" :"=m" (v->counter) :"ir" (i), "m" (v->counter)); } # 149 "../../opentss/trt" static __inline__ void atomic_sub(int i, atomic_t *v) { __asm__ __volatile__( "" "subl %1,%0" :"=m" (v->counter) :"ir" (i), "m" (v->counter)); } # 166 "../../opentss/trt" static __inline__ int atomic_sub_and_test(int i, atomic_t *v) { unsigned char c; __asm__ __volatile__( "" "subl %2,%0; sete %1" :"=m" (v->counter), "=qm" (c) :"ir" (i), "m" (v->counter) : "memory"); return c; } static __inline__ void atomic_inc(atomic_t *v) { __asm__ __volatile__( "" "incl %0" :"=m" (v->counter) :"m" (v->counter)); } static __inline__ void atomic_dec(atomic_t *v) { __asm__ __volatile__( "" "decl %0" :"=m" (v->counter) :"m" (v->counter)); } # 212 "../../opentss/trt" static __inline__ int atomic_dec_and_test(atomic_t *v) { unsigned char c; __asm__ __volatile__( "" "decl %0; sete %1" :"=m" (v->counter), "=qm" (c) :"m" (v->counter) : "memory"); return c != 0; } # 230 "../../opentss/trt" static __inline__ int atomic_inc_and_test(atomic_t *v) { unsigned char c; __asm__ __volatile__( "" "incl %0; sete %1" :"=m" (v->counter), "=qm" (c) :"m" (v->counter) : "memory"); return c != 0; } # 249 "../../opentss/trt" static __inline__ int atomic_add_negative(int i, atomic_t *v) { unsigned char c; __asm__ __volatile__( "" "addl %2,%0; sets %1" :"=m" (v->counter), "=qm" (c) :"ir" (i), "m" (v->counter) : "memory"); return c; } # 271 "../../opentss/trt" struct thr_struct { pthread_t th; unsigned long stack_top; unsigned long stack_bottom; }; extern int _thread_ncpu; int get_cputhread_stack_size(); # 287 "../../opentss/trt" static inline int thread_ncpu() { return 1; } static inline int thread_self() { return 0; } # 301 "../../opentss/trt" static inline bool tsLocked() { return true; } extern int thread_initialized; template class ThreadLocal { private: type data[1]; public: ThreadLocal() {} ThreadLocal(const type& val) { for (int i = 0; i < thread_ncpu(); i++) data[i] = val; } inline type& operator[] (int th_idx) { return data[th_idx]; } inline const type& operator[] (int th_idx) const { return data[th_idx]; } inline type& operator() () { return (*this)[thread_self()]; } inline const type& operator() () const { return (*this)[thread_self()]; } }; unsigned long get_thread_stack_top(); unsigned long get_thread_stack_bottom(); class Atomic { private: atomic_t cnt; public: Atomic(int _cnt) { *this = _cnt; } inline operator int () const { return ((&cnt)->counter); } inline void operator = (int _cnt) { (((&cnt)->counter) = (_cnt)); } inline void operator++ () { atomic_inc(&cnt); } inline bool operator-- () { return !atomic_dec_and_test(&cnt); } }; class Spinlock : Atomic { public: Spinlock() : Atomic(1) {} inline void lock() { while (1) { if ((int)(*this) != 1) continue; if (!--(*this)) return; ++(*this); } } inline bool try_lock() { return (--(*this)) ? (++(*this),false) : true; } inline void unlock() { ++(*this); } class Locker { public: Spinlock *sl; Locker(Spinlock *_sl) : sl(_sl) { sl->lock(); } ~Locker() { sl->unlock(); } }; }; # 483 "../../opentss/trt" class TSLock { public: inline void lock() { } inline void unlock() { } inline void save(int &state) { } inline void restore(const int &state) { } inline int get_level() { return 1; } }; extern TSLock tsLock; class TSLocker { }; class TSLockCleaner { }; char *demangle(const char* name); const char *fileInfo(const char *file, const char *pat1, const char *pat2, const char *patTerm); int cpuCount(); void fault(); class ACnt { public: Atomic cnt; ACnt() : cnt(0) {} inline bool operator-- () { return --cnt ? true : (onZero(),false); } inline void operator++ () { ++cnt; } virtual void onZero() {} }; class ARef { private: inline void ctor(ACnt *_a) { a = _a; if (a) ++(*a); } inline void dtor() { if (a) { --(*a); a = __null; } } inline void cdtor(ACnt *_a) { ACnt *p = a; a = _a; if (a) ++(*a); if (p) --(*p); } protected: ACnt *a; public: inline ARef (ACnt* a = __null) { ctor(a); } inline ARef (const ARef &ar) { ctor(ar.a); } inline ACnt* operator= (ACnt *_a) { if (a != _a) { cdtor(_a); } return a; } inline ACnt* operator= (ARef& ar) { if (a != ar.a) { cdtor(ar.a); } return a; } inline ~ARef() { dtor(); } }; # 556 "../../opentss/trt" class String { struct StrLevel { typeof(char[0x40000]) buf; char* p; void rewind() { p = buf; } int left() { return buf + sizeof(buf) - p; } }; static StrLevel lvls[8]; static StrLevel *openl, *curl; char* p; public: static void rewind() { curl = __null; } String() { open(); } String(const char *format, ...) { open(); va_list args; __builtin_stdarg_start((args),format); p += vsnprintf(p,curl->left(),format,args); __builtin_va_end (args); } char *open() { if (curl == __null) curl=openl=lvls-1; if (++curl > openl) { (++openl)->rewind(); {if (!(openl < lvls + 8)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "openl < lvls + levels" ,__PRETTY_FUNCTION__,"../../opentss/trt",580); ((int*)0)[0]=0;}}; } return (p = curl->p); } inline char operator* () { return *p; } inline operator char* () { return p; } inline char* operator ++() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",586); ((int*)0)[0]=0;}}; return ++p; } inline char* operator ++(int) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",587); ((int*)0)[0]=0;}}; return p++; } size_t printf (const char *format, ...) { va_list args; __builtin_stdarg_start((args),format); size_t n = vsnprintf(p,curl->left(),format,args); p += n; __builtin_va_end (args); return n; } char *close(int reserve = 0) { char *ret = curl->p; *p++ = 0; curl->p = p + reserve; {if (!(curl->left() > 0)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "curl->left() > 0" ,__PRETTY_FUNCTION__,"../../opentss/trt",599); ((int*)0)[0]=0;}}; curl--; p = __null; return ret; } ~String() { if (p) close(); } }; typedef String VizStr; enum Color { Black, Red, Green, Yellow, Blue, Magenta, Cyan, White }; inline Color bright (Color c) { return (Color)(c | 8); } class UserInterface : Spinlock { public: bool colorCapable; virtual int write (Color color, const char *what) { VizStr s; char colorFormat[] = "\033[0;30m%s\033[0;39m"; colorFormat[2] += color >>3; colorFormat[5] += color & 7; int l = s.printf(colorCapable ? colorFormat : "%s", what); char *p = s.close(); Locker x(this); return ::write(2,p,l); } UserInterface(); virtual ~UserInterface() {} virtual const char* ask (const char* prompt) { VizStr s("\n\n * INPUT AWAITED * \n\n %s", prompt); Locker x(this); write(Yellow, s.close()); char *p = s.open(); int l = ::read(0, p, 1024); {if (!(l >= 0)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "l >= 0" ,__PRETTY_FUNCTION__,"../../opentss/trt",638); ((int*)0)[0]=0;}}; p[l] = 0; return s.close(1024); } }; extern UserInterface* ui; extern int myRank, superSize, mainRank,realsuperSize; # 653 "../../opentss/trt" class Viz { public: class Vid { public: char text[12]; Vid() { text[0] = 0; } void operator= (const char *_text) { *this = *(Vid*)_text; } } vid; virtual const char* viz() { VizStr v("%s%s%.*s @%p", demangle(typeid(*this).name()), vid.text[0] ? "/":"", sizeof(vid),vid.text, this); return v.close(); } static regex_t rx; static void setVizOption(const char *opt) { if (regcomp (&rx, opt, 1)) { do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("Regexp `%s' compilation failed!\n", opt); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); } }; class DefaultVizOption { public: DefaultVizOption(const char *opt) { setVizOption(opt); } }; static void vpp( int , const char * msg, const char *module, const char * pretty_function, const char * function) { VizStr hidstr("module=%s,method=%s",module,pretty_function); if ( (0==regexec(&rx,hidstr.close(),0,__null,0)) || (0==regexec(&rx,msg,0,__null,0)) ) { VizStr out ("[%d|%s|%s> %s\n",myRank,module,function,msg); ui->write(((Color)((myRank%4)+Green)),out.close()); }; }; }; class Ring { Ring *prev,*next; public: inline void ok() { } inline void ct() { prev = next = this; } inline Ring() { ct(); } inline bool ringEmpty() { return next == this; } inline Ring* first() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",702); ((int*)0)[0]=0;}}; return ringEmpty() ? __null : next; } inline Ring* last() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",703); ((int*)0)[0]=0;}}; return ringEmpty() ? __null : prev; } inline Ring* popFront() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",705); ((int*)0)[0]=0;}}; Ring* e = ringEmpty() ? __null : next->remove(); ok(); return e; } inline Ring* getFront() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",711); ((int*)0)[0]=0;}}; Ring* e = ringEmpty() ? __null : next; ok(); return e; } inline Ring* popBack() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",717); ((int*)0)[0]=0;}}; Ring* e = ringEmpty() ? __null : prev->remove(); ok(); return e; } inline Ring* getBack() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",723); ((int*)0)[0]=0;}}; Ring* e = ringEmpty() ? __null : prev; ok(); return e; } inline void pushFront(Ring& t) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",729); ((int*)0)[0]=0;}}; if (!t.ringEmpty()) t.remove(); t.prev = this; t.next = next; next->prev = &t; next = &t; ok(); } inline void pushBack(Ring& t) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",740); ((int*)0)[0]=0;}}; if (!t.ringEmpty()) t.remove(); t.next = this; t.prev = prev; prev->next = &t; prev = &t; ok(); } Ring* remove() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",751); ((int*)0)[0]=0;}}; prev->next = next; next->prev = prev; next = prev = this; ok(); return this; } ~Ring() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",761); ((int*)0)[0]=0;}}; if (!ringEmpty()) remove(); } }; void idleWait(); class Service { int index; public: static Service* service[5]; static ThreadLocal exitFlag; static Atomic threadExited; static int exitError; Service(const char *name,int prio) : index(prio) { {if (!(service[index] == __null)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "service[index] == NULL" ,__PRETTY_FUNCTION__,"../../opentss/trt",778); ((int*)0)[0]=0;}}; service[index] = this; ; } virtual ~Service() { service[index] = __null; } static void exitThread() { exitFlag() = true; } static void exitServices(int error) { exitError=error; for (int i = 0; i < thread_ncpu(); i++) { exitFlag[i] = true; } }; static void doAllWork() { while (!exitFlag()) { int i; for (i = 0; i < 5; i++) if (service[i] && service[i]->work()) break; if (i == 5) idleWait(); } } virtual bool work() = 0; }; class Delay { public: Delay *next; Delay():next(__null) {} void operator()(Delay*& p) { if (p == ((Delay*)-1)) delete this; else { next = p; p = this; } } static void force(Delay*& me) { if (me == __null || me == ((Delay*)-1)) return; force(me->next); delete me; me = ((Delay*)-1); } virtual ~Delay() {} }; class GlobalConfig { public: bool showMsgs; bool generateCallGraph; bool showFeatures; bool enableAsync; int ncpu; bool autoCcall; GlobalConfig(): showMsgs(false),generateCallGraph(false),showFeatures(false), enableAsync(false), ncpu(1), autoCcall(false) { } }; extern GlobalConfig conf; class FinalizeException {}; class SContext { public: int nodePrio; SContext(): nodePrio(0) {} }; class SchedContext { public: }; class TContext : public SContext, public SchedContext { public: int prio; int mflops; int mbytes; int pflags; int fflags; int atRank; double cpuUsage; int extraSize; int stackSizeLg; bool memoize; TContext() : prio(0), mflops(-15), mbytes(-10), pflags(0), fflags(0), atRank(-1), cpuUsage(1.), extraSize(0), stackSizeLg(15),memoize(false) {} }; extern ThreadLocal _tc; static inline TContext& tc() { return _tc(); } class mrefMagneticTrigger { int saved; public: mrefMagneticTrigger(int n) : saved(tc().pflags & 2) { {if (!((n==0) || (n==1))) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "(n==0) || (n==1)" ,__PRETTY_FUNCTION__,"../../opentss/trt",873); ((int*)0)[0]=0;}}; if (n) tc().pflags |= 2; else tc().pflags &= ~2; } ~mrefMagneticTrigger() { if (saved) { tc().pflags |= 2; } else { tc().pflags &= ~2; } } }; class mrefGlueTrigger { int saved; public: mrefGlueTrigger(int n) : saved(tc().pflags & 1) { {if (!((n==0) || (n==1))) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "(n==0) || (n==1)" ,__PRETTY_FUNCTION__,"../../opentss/trt",892); ((int*)0)[0]=0;}}; if (n) tc().pflags |= 1; else tc().pflags &= ~1; } ~mrefGlueTrigger() { if (saved) { tc().pflags |= 1; } else { tc().pflags &= ~1; } } }; class cpuUsageTrigger { double savedCpuUsage; public: cpuUsageTrigger(double n) : savedCpuUsage(tc().cpuUsage) { tc().cpuUsage = n; } ~cpuUsageTrigger() { tc().cpuUsage = savedCpuUsage; } }; class atRankTrigger { int savedAtRank; public: atRankTrigger(int n) : savedAtRank(tc().atRank) { tc().atRank = n; } ~atRankTrigger() { tc().atRank = savedAtRank; } }; class extraSizeTrigger { int savedExtraSize; public: extraSizeTrigger(int n) : savedExtraSize(tc().extraSize) { tc().extraSize = n; } ~extraSizeTrigger() { tc().extraSize = savedExtraSize; } }; class priorityTrigger { int savedPriority; public: priorityTrigger(int n) : savedPriority(tc().prio) { tc().prio = n; } ~priorityTrigger() { tc().prio = savedPriority; } }; class stackSizeTrigger { int savedStackSizeLg; public: stackSizeTrigger(int lg) : savedStackSizeLg(tc().stackSizeLg) { tc().stackSizeLg = lg; } ~stackSizeTrigger() { tc().stackSizeLg = savedStackSizeLg; } }; class memoizeTrigger { bool savedState; public: memoizeTrigger(bool state) : savedState(tc().memoize) { tc().memoize = state; } ~memoizeTrigger() { tc().memoize = savedState; } }; class WTimer { private: double frequency; inline void getCpuInfo() { const char* buf = fileInfo("/proc/cpuinfo","cpu MHz",": ","\n"); if (!buf) frequency=0; else frequency=1/(double)(atof(buf)*1000000); } public: WTimer() { getCpuInfo(); } double wTime() { return tickTime()*frequency; } unsigned long long sec2Tick(double time) { return (unsigned long long)(time/frequency); } double tick2Sec(unsigned long long time) { return time*frequency; } inline unsigned long long tickTime() { unsigned long long tmp; asm volatile ( "rdtsc\n\t" : "=A" (tmp) ); # 991 "../../opentss/trt" return tmp; } }; unsigned long long tickTime(); double tick2Sec(unsigned long long); double wTime(); class Prof { public: long long total; long long startAt; void reset() { total = 0; startAt = 0; } inline Prof() : total(0),startAt(0) { ; } void start() { startAt = tickTime(); } long long stop() { long long timeLeft; if (!startAt) { timeLeft = 0; } else { timeLeft = tickTime() - startAt; total += timeLeft; } startAt = 0; return timeLeft; } long long stopStart() { long long timeLeft; long long tmp; if (!startAt) { startAt = tickTime(); return 0; } tmp = tickTime(); timeLeft = tmp - startAt; total += timeLeft; startAt = tmp; return timeLeft; } virtual const char *codeId() { return ""; } class Timer { public: Prof *p; Timer(Prof& _p) : p(&_p) { p->start(); } long finish() { return p->stop(); } ~Timer() { finish(); } }; }; struct StatisticValues { long long time; long msg_count; long msg_size; long evt_count; long async_msg_count; StatisticValues& operator+=(const StatisticValues& b) { time += b.time; msg_count += b.msg_count; async_msg_count += b.async_msg_count; msg_size += b.msg_size; evt_count += b.evt_count; return *this; } void reset() { msg_count = 0; async_msg_count = 0; msg_size = 0; evt_count = 0; time = 0; } StatisticValues() { reset(); } static ThreadLocal currentValues; }; class Task; class TaskStatistic : public StatisticValues { public: static ThreadLocal prof; TaskStatistic* upStat; long long statId; TaskStatistic(TaskStatistic* upStat_, long long sysTaskId_) : upStat(upStat_), statId(sysTaskId_) {} void enter(TaskStatistic *from) { if (statId<=-10) upStat = from; prof().start(); evt_count++; } void addStatistic() { StatisticValues& cur = currentValues(); TaskStatistic* curp = this; while (curp) { *curp += cur; curp = curp->upStat; } cur.reset(); } void leave() { int me = thread_self(); {if (!(me || true)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "me || true" ,__PRETTY_FUNCTION__,"../../opentss/trt",1092); ((int*)0)[0]=0;}}; currentValues[me].time += prof[me].stop(); addStatistic(); } void switchStatistic(TaskStatistic* t) { int me = thread_self(); {if (!(me || true)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "me || true" ,__PRETTY_FUNCTION__,"../../opentss/trt",1099); ((int*)0)[0]=0;}}; currentValues[me].time += prof[me].stopStart(); addStatistic(); if (t->statId<=-10) t->upStat = this; t->evt_count++; } class Holder { Task* saved_current; public: Holder(Task* t); ~Holder(); }; }; extern Task mpiTask; struct Statistic { public: bool alive; long long tasksActivated; long long tasksExported; long long msgsSent; long long msgsAsyncSent; long long msgsSize; double total_time; double tasks_time; double idle_time; double sched_time; double mpi_time; int visit_count; Statistic() : alive(true), tasksActivated(0), tasksExported(0), msgsSent(0), msgsAsyncSent(0), mpi_time(0.), visit_count(0) {} }; extern Statistic *myStat; class CmdLine { public: static int *mainArgc; static char** *mainArgv; static int extArgc; static char** extArgv; static Delay *delay; CmdLine(int* argc, char** *argv) { mainArgc = argc; mainArgv = argv; extArgc = 0; extArgv = (char **) malloc(*argc * sizeof(int)); ProcessCmdLine(); Delay::force(delay); } ~CmdLine() { for (int i = 0; i < extArgc; i ++) free(extArgv[i]); free(extArgv); } void ProcessCmdLine() { int i; int tct_count=0; bool tct_prev=false; for (i=1; i<*mainArgc ; i++) { if (tct_prev) { ProcessTCTOption((*mainArgv)[i]); tct_prev=false; tct_count++; } else if ( strcmp("-tct", (*mainArgv)[i] )==0) { tct_count++; tct_prev=true; } else { (*mainArgv)[i-tct_count]=(*mainArgv)[i]; } } *mainArgc -= tct_count; } void ProcessTCTOption(char *option) { int opt_len; opt_len=strlen(option); {if (!(opt_len<512)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "opt_len<512" ,__PRETTY_FUNCTION__,"../../opentss/trt",1178); ((int*)0)[0]=0;}}; if ((strncmp("DP(\"",option,4)==0) && (strncmp("\")",option+opt_len-2,2)==0)) { char opt[1024]={0,}; memcpy(opt,option+4,opt_len-6); Viz::setVizOption(opt); } else if (strcmp(option,"callGraph")==0) { conf.generateCallGraph = true; } else if (strcmp(option,"showMsgs")==0) { conf.showMsgs = true; } else if (strcmp(option,"showFeatures")==0) { conf.showFeatures = true; } else if (strcmp(option,"enableAsync")==0) { conf.enableAsync = true; } else if (strcmp(option,"disableAsync")==0) { conf.enableAsync = false; } else if (strcmp(option,"enableSMP")==0) { conf.ncpu = cpuCount(); } else if (strncmp(option,"ncpu=",5)==0) { conf.ncpu = atoi(option + 5); {if (!(conf.ncpu >= 1)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "conf.ncpu >= 1" ,__PRETTY_FUNCTION__,"../../opentss/trt",1201); ((int*)0)[0]=0;}}; {if (!(conf.ncpu <= 1)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "conf.ncpu <= MAXCPU" ,__PRETTY_FUNCTION__,"../../opentss/trt",1202); ((int*)0)[0]=0;}}; } else { extArgv[extArgc] = strdup(option); extArgc ++; } } }; typedef void* (*entry_t)(int cmd, void *arg); extern "C" { void registerFeature(const char *name, const char *comment, entry_t entry); entry_t featureEntry(const char *name); } class Feature { Feature *next; entry_t entry; const char *name; const char *comment; const char *status; bool internal; static Feature *all; public: Feature(const char *_name, const char *_comment, bool _internal = true, entry_t _entry = __null) : next(all), entry(_entry), name(_name), comment(_comment), status(__null), internal(_internal) { all = this; } inline const char* error() { return (status && !strncmp(status,"ERROR",5)) ? status+5 : __null; } static entry_t getEntry(const char *name) { Feature *f; for (f = all; f; f = f->next) if (!f->error() && !strcmp(f->name,name)) return f->entry; return __null; } void doInitialize() { if (verbose()) do { { VizStr msgstr(" %s (%s)", name, comment); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); if (entry) status = (const char*)(*entry)(0, __null); if (status && verbose()) { if (error()) do { { VizStr msgstr(": %s [disabled]", error()); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); else do { { VizStr msgstr(": %s", status); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } if (verbose()) do { { VizStr msgstr("\n"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); if (internal && error()) do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("Internal feature failed\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); } static void initialize(const char *msg, bool internal) { if (verbose()) do { { VizStr msgstr("%s\n", msg); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); Feature *f; for (f = all; f; f = f->next) if (f->internal == internal) f->doInitialize(); } static void initialize() { initialize("Internal features: ", true); initialize("External features: ", false); } static bool verbose() { return conf.showFeatures; } }; class Freezer { static ThreadLocal count; public: static inline bool isOn() { {if (!(count() >= 0)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "count() >= 0" ,__PRETTY_FUNCTION__,"../../opentss/trt",1258); ((int*)0)[0]=0;}}; return count() > 0; } inline Freezer() { count()++; ; } inline ~Freezer() { count()--; ; {if (!(count() >= 0)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "count() >= 0" ,__PRETTY_FUNCTION__,"../../opentss/trt",1266); ((int*)0)[0]=0;}}; } class TemporaryOff { int saved_count; public: TemporaryOff() : saved_count(count()) { count() = 0; } ~TemporaryOff() { count() = saved_count; } }; }; class SystemMemoryAllocator { public: void* alloc(size_t size) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",1279); ((int*)0)[0]=0;}}; return ::malloc(size); } void free(void* data) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",1280); ((int*)0)[0]=0;}}; ::free(data); } }; extern SystemMemoryAllocator memoryAllocator; template class DataAllocator { public: virtual T* alloc(size_t size = sizeof(T)) { {if (!(size >= sizeof(T))) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "size >= sizeof(T)" ,__PRETTY_FUNCTION__,"../../opentss/trt",1287); ((int*)0)[0]=0;}}; return (T*)memoryAllocator.alloc(size); } virtual void free(T* t) { memoryAllocator.free(t); } virtual ~DataAllocator() {} }; class Header; extern DataAllocator
*pdataAllocator; template class DataAllocatorCache : public DataAllocator { private: class DataAllocatorHeader : public Ring { private: size_t size; public: inline DataAllocatorHeader () { ct(0); } inline void ct (size_t _size) { size = _size; Ring::ct(); } inline size_t get_size () const { return size; } }; DataAllocatorHeader headFree[HSIZE]; DataAllocator allocator; protected: inline DataAllocatorHeader* allocHeader(size_t size) { return allocator.alloc(sizeof(DataAllocatorHeader) + size); } inline void freeHeader(DataAllocatorHeader* h) { allocator.free(h); } void flush () { unsigned int i; for (i = 0; i < HSIZE; i++) { while (!headFree[i].ringEmpty()) { DataAllocatorHeader *r = (DataAllocatorHeader*)headFree[i].popFront(); freeHeader(r); } } } inline int get_idx(size_t size) { return size?((size-1) >> SHIFT):0; } public: virtual T* alloc(size_t size = sizeof(T)) { DataAllocatorHeader *r; unsigned int idx = get_idx(size); size_t realSize = (idx+1) << SHIFT; if (idx < HSIZE) { if (!headFree[idx].ringEmpty()) { r = (DataAllocatorHeader*)headFree[idx].popFront(); } else { r = allocHeader(realSize); } r->ct(size); } else { r = allocHeader(realSize); r->ct(size); } T* t = (T*)(((char*)r)+sizeof(DataAllocatorHeader)); return t; } virtual void free(T* t) { DataAllocatorHeader *r = (DataAllocatorHeader*)(((char*)t)-sizeof(DataAllocatorHeader)); size_t size = r->get_size(); unsigned int idx = get_idx(size); if (idx < HSIZE) { headFree[idx].pushFront(*r); } else { freeHeader(r); } } virtual ~DataAllocatorCache() { flush (); } }; extern DataAllocatorCache
dataAllocatorCache; class StackAllocator { private: unsigned long stack_addr; unsigned long stack_begin; size_t page_size; public: void init_stack() { stack_addr = get_thread_stack_top(); stack_begin = get_thread_stack_bottom(); stack_addr -= 1 << 15; } StackAllocator() { page_size = getpagesize(); } void* alloc(size_t size) { {if (!(size > 0)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "size > 0" ,__PRETTY_FUNCTION__,"../../opentss/trt",1404); ((int*)0)[0]=0;}}; stack_addr -= size; if (stack_addr <= stack_begin) do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("Stack overflow\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); ; return (void*)(stack_addr); } void free(void* data) { ; } }; extern ThreadLocal stackAllocator; template class ThreadAllocator { private: Ring head[3][20]; public: T* alloc(int prio, int stackSizeLg) { {if (!(stackSizeLg > 0 && stackSizeLg < 20)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "stackSizeLg > 0 && stackSizeLg < TC_MAX_STACK_LG" ,__PRETTY_FUNCTION__,"../../opentss/trt",1430); ((int*)0)[0]=0;}}; {if (!(prio >= 0 && prio < 3)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "prio >= 0 && prio < TC_MAX_PRIO" ,__PRETTY_FUNCTION__,"../../opentss/trt",1431); ((int*)0)[0]=0;}}; {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",1432); ((int*)0)[0]=0;}}; if (head[prio][stackSizeLg].ringEmpty()) return new T(prio,stackSizeLg); else return (T*)head[prio][stackSizeLg].popFront(); } void free(T* t) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",1439); ((int*)0)[0]=0;}}; head[t->prio][t->stackSizeLg].pushFront(*t); t->reinit(); } }; class SThread; typedef ThreadAllocator SThreadAllocator; extern ThreadLocal threadAllocator; # 1466 "../../opentss/trt" class ThrH { public: friend class ThrQ; friend class ThrQS; typedef void (*proc_t)(void*); private: void *stk; proc_t proc; void *arg; ThrH *next; double readyTime; public: int tsLockLevel; int cpu; void *stkMin; void *initStk; inline ThrH(): stk(__null),proc(__null),arg(__null),next(__null),readyTime(0),tsLockLevel(1),cpu(-1),stkMin((void*)-1) { }; inline static ThrH* self() { ThrH* ath = active_thread(); {if (!(ath)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "ath" ,__PRETTY_FUNCTION__,"../../opentss/trt",1490); ((int*)0)[0]=0;}}; return ath; } static void spawn(ThrH* child, proc_t func, void *arg); static void sleep(double sec); inline void initProc(proc_t _proc, void *_arg) { proc = _proc; arg = _arg; stk = initStk; } inline static void yield (ThrH* to) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",1501); ((int*)0)[0]=0;}}; ThrH* from = self(); if (from != to) { if (to->proc) to->stk = to->initStk; {if (!(!to->next)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!to->next" ,__PRETTY_FUNCTION__,"../../opentss/trt",1505); ((int*)0)[0]=0;}}; {if (!(to->cpu == thread_self())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "to->cpu == thread_self()" ,__PRETTY_FUNCTION__,"../../opentss/trt",1506); ((int*)0)[0]=0;}}; active_thread() = to; hwSaveRestore(from,to); {if (!((unsigned long)from->stk > (unsigned long)from->stkMin)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "(unsigned long)from->stk > (unsigned long)from->stkMin" ,__PRETTY_FUNCTION__,"../../opentss/trt",1515); ((int*)0)[0]=0;}}; } } private: static ThreadLocal active_thread; static void hwSaveRestore(ThrH* save, ThrH* restore, void* dummy = __null); }; class ThrQ { friend class ThrH; friend class ThrQS; ThrH* head; public: inline ThrQ() : head(__null) {}; inline ThrH* pop() { ThrH *th = head; if (th) { head = th->next; th->next = __null; } return th; } inline void push(ThrH* th) { {if (!(th && !th->next)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "th && !th->next" ,__PRETTY_FUNCTION__,"../../opentss/trt",1534); ((int*)0)[0]=0;}}; th->next = head; head = th; } void contTasks(bool delay = true); void stopHereAndRunOthers(); }; class ThrQS { friend class ThrQ; public: ThrQ running, delayed, sleeping; ThrH main; void init() { ThrH::active_thread() = &main; main.stkMin = 0; main.cpu = thread_self(); } inline bool hasReadyThreads() { return running.head || delayed.head || (sleeping.head && sleeping.head->readyTime <= wTime()); } inline ThrH* popNextActiveThread() { ThrH* t = running.pop(); if (!t) t = delayed.pop(); if (!t) if (sleeping.head && sleeping.head->readyTime <= wTime()) t = sleeping.pop(); if (!t) t = &main; return t; } inline void run() { {if (!(ThrH::self() == &main)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "ThrH::self() == &main" ,__PRETTY_FUNCTION__,"../../opentss/trt",1565); ((int*)0)[0]=0;}}; ThrH::yield(popNextActiveThread()); } static ThreadLocal tqs; }; long long myMemLimit(); class Task; class SThread : public Ring { private: void* stack_addr; public: int prio; int stackSizeLg; ThrH th; ThrQ waitq; Task *tsk; static int superthreads; SThread (int _prio, int _stackSizeLg) : prio(_prio), stackSizeLg(_stackSizeLg) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",1583); ((int*)0)[0]=0;}}; int stack_size; superthreads++; stack_size = 1 << stackSizeLg; stack_addr = stackAllocator().alloc(stack_size); tsk = __null; th.initStk = (void *)(((unsigned long)stack_addr) + stack_size); th.stkMin = stack_addr; th.cpu = thread_self(); ThrH::spawn(&th, init, this); } ~SThread() { } static void init_threads() { ThrQS& tqs = ThrQS::tqs(); tqs.init(); sigset_t sigs; sigemptyset(&sigs); sigaddset(&sigs, 2); sigaddset(&sigs, 15); sigprocmask(1, &sigs, __null); } void reinit() { th.initProc((ThrH::proc_t)newTask, this); waitq.stopHereAndRunOthers(); } static void init(void* _me) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",1618); ((int*)0)[0]=0;}}; SThread* me = (SThread*)_me; ; me->reinit(); } static void newTask(SThread*); }; class DestructionQueue { friend class Header; public: struct qItem { qItem *next; qItem() : next(__null) {}; }; private: int entered; qItem *head; public: DestructionQueue() : entered(0),head(__null) {} void addToQueue(Header *td); ~DestructionQueue() {} }; extern DestructionQueue destructionQueue; class Header : public ACnt, public Viz, public DestructionQueue::qItem { friend class DestructionQueue; public: Header(const Header&) { {if (!(0 && "Attempt to copy header")) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "0 && \"Attempt to copy header\"" ,__PRETTY_FUNCTION__,"../../opentss/trt",1643); ((int*)0)[0]=0;}}; } Header& operator= (const Header&) { {if (!(0 && "Attempt to copy header")) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "0 && \"Attempt to copy header\"" ,__PRETTY_FUNCTION__,"../../opentss/trt",1644); ((int*)0)[0]=0;}}; return *this; } Header(){} size_t size; virtual ~Header() {} inline static Header* halloc (size_t size) { ; Header* h = pdataAllocator->alloc(size); if (!h) do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("Out of memory\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); h->size = size; return h; } inline void* operator new (size_t size, size_t extra) { return halloc(size + extra); } inline static void hfree (Header* h) { ; pdataAllocator->free(h); } inline void* operator new (size_t size) { return halloc(size); } void* operator new (size_t size, void *mem) { return mem; } inline void operator delete (void* mem) { hfree((Header*)mem); } virtual void onZero () { delete this; ; } }; # 1689 "../../opentss/trt" class SData : public Header { public: int flags; inline SData() : flags (0) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",1696); ((int*)0)[0]=0;}}; } virtual SData* clone() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",1702); ((int*)0)[0]=0;}}; return this; } virtual void onRecv() { ; } virtual void onZero () { if (!(this->flags & 32)) destructionQueue.addToQueue(this); else hfree(this); } }; class SRef : public ARef { public: inline SData* operator-> () const { return (SData*) a; } inline SData& operator* () const { ; return *(SData*)a; } inline SData* operator= (SData *_a) { ; return (SData*) (*(ARef*)this = _a); } inline SData* operator= (const SRef& s) { return (SData*) (*(ARef*)this = s.a);} inline operator SData* () { return (SData*)a; } bool operator == (ACnt *_a) { return a==_a; } inline void clearRef () { (*this) = (SData*)__null; } }; # 1762 "../../opentss/trt" extern Delay *mpiInitDelay; extern bool mpiInitialized; class MPIMsgStat { private: MPIMsgStat(unsigned r, unsigned s) { recvCount = r; sentCount = s; } public: unsigned recvCount; unsigned sentCount; MPIMsgStat() { recvCount = 0; sentCount = 0; } bool equal() const { return recvCount == sentCount; } bool operator == (const MPIMsgStat& c) const { return (recvCount == c.recvCount) && (sentCount == c.sentCount); } MPIMsgStat& operator += (const MPIMsgStat& c) { recvCount += c.recvCount; sentCount += c.sentCount; return *this; } friend MPIMsgStat operator + (const MPIMsgStat& a, const MPIMsgStat& b) { return MPIMsgStat(a.recvCount + b.recvCount, a.sentCount + b.sentCount); } }; static entry_t traceEntry; static int traceMode; static int traceCount = -1; class MPITagHandler : public Service { static MPITagHandler* tagHandler[5]; static int nextTag; static int totalTags; int tag; MPIMsgStat msgStat; public: inline int getTag() const { return tag; } const MPIMsgStat& getStat() const { return msgStat; }; private: class Request { private: SRef data; struct mpi_portal_request mpiRq; public: bool isFree() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",1807); ((int*)0)[0]=0;}}; return getData() == __null; } void setFree() { {if (!(!isFree())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!isFree()" ,__PRETTY_FUNCTION__,"../../opentss/trt",1811); ((int*)0)[0]=0;}}; if (data) { SData *d = data; d->flags |= 32; data.clearRef(); } } void setBusy(SData *d) { {if (!(isFree())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "isFree()" ,__PRETTY_FUNCTION__,"../../opentss/trt",1823); ((int*)0)[0]=0;}}; {if (!(d)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d" ,__PRETTY_FUNCTION__,"../../opentss/trt",1824); ((int*)0)[0]=0;}}; data = d; SData *copy = d->clone(); data = copy; } const SData* getData() { return data; } ~Request() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",1835); ((int*)0)[0]=0;}}; if (!isFree()) { setFree(); } } Request() : data() {} bool testRq() { struct mpi_portal_status status; int free; {if (!(this)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "this" ,__PRETTY_FUNCTION__,"../../opentss/trt",1844); ((int*)0)[0]=0;}}; {if (!(!isFree())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!isFree()" ,__PRETTY_FUNCTION__,"../../opentss/trt",1845); ((int*)0)[0]=0;}}; { int stat = (*mpi_portal->_MPI_Test) (&mpiRq, &free, &status); if (stat != 0) { static char msg[0x1000]; int len = sizeof(msg); (*mpi_portal->_MPI_Error_string)(stat,msg,&len); do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("MPI_Error[%d != %d]: %.*s",stat, 0,len,msg); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); } }; if (free) setFree (); return free; } void sendRq(int dest, int tag, SData *d) { {if (!(this)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "this" ,__PRETTY_FUNCTION__,"../../opentss/trt",1851); ((int*)0)[0]=0;}}; {if (!(d)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d" ,__PRETTY_FUNCTION__,"../../opentss/trt",1852); ((int*)0)[0]=0;}}; {if (!(isFree ())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "isFree ()" ,__PRETTY_FUNCTION__,"../../opentss/trt",1853); ((int*)0)[0]=0;}}; setBusy (d); SData *copy = data; if (conf.showMsgs) do { { VizStr msgstr("[%d,%d] -> [%d]: %s[%d]\n", myRank, tag, dest, copy->viz(), copy->size); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); { TaskStatistic::Holder __taskHolder(&mpiTask); { int stat = (*mpi_portal->_MPI_Isend) (copy, copy->size, (1), dest, tag, ((int)(-2)), &mpiRq); if (stat != 0) { static char msg[0x1000]; int len = sizeof(msg); (*mpi_portal->_MPI_Error_string)(stat,msg,&len); do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("MPI_Error[%d != %d]: %.*s",stat, 0,len,msg); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); } }; StatisticValues& cur = StatisticValues::currentValues(); cur.msg_count++; cur.msg_size += d->size; if (conf.enableAsync) (*mpi_portal->_DMPI_Async_ping)(dest); } } }; public: class RequestQueue { private: Request rq[0x400]; size_t curr; int curRq; public: RequestQueue() : curr(0), curRq(0) {} Request* getFreeRq() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",1880); ((int*)0)[0]=0;}}; int i, tries; for (tries = 0; tries < 1000000000; tries++,sched_yield()) { if (curRq >= 0x400) curRq = 0; for (i = curRq; i < 0x400; i++) if (rq[i].isFree() || rq[i].testRq()) { ; curRq = i+1; return &rq[i]; } } do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("No free MPI_Request (%d tries)", tries); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); return __null; } int flushReqs (int *cnt) { int i; for (i = 0; i < 0x400; i++) { if (rq[i].isFree()) { continue; } int tries; int free = 0; bool flag; for (tries = 0; tries < 1000000000; tries++,sched_yield()) { while (dropMessage(&flag)) if (flag) {++(*cnt);} if (rq[i].testRq()) { free=1; break; } } if (!free) { do { { VizStr msgstr("[%d] Unable to flush request %d.\n", myRank, i); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); return false; } } return true; } # 1924 "../../opentss/trt" } rqq[24]; public: void asyncSend(SData* d, int to) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",1927); ((int*)0)[0]=0;}}; ; if (!totalTags) return; Request *rq = rqq[to].getFreeRq(); SData *copy; copy = d; rq->sendRq (to, tag, copy); msgStat.sentCount++; rq->testRq (); } # 1970 "../../opentss/trt" private: class MPI_Init_Delay : public Delay { public: ~MPI_Init_Delay() { { int stat = MPI_Init(CmdLine::mainArgc,CmdLine::mainArgv); if (stat != 0) { static char msg[0x1000]; int len = sizeof(msg); (*mpi_portal->_MPI_Error_string)(stat,msg,&len); do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("MPI_Error[%d != %d]: %.*s",stat, 0,len,msg); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); } }; traceEntry = ts::Feature::getEntry("trace"); if (traceEntry) traceMode = (unsigned long) traceEntry(CmdLine::extArgc, (void *) CmdLine::extArgv); entry_t ckptEntry = ts::Feature::getEntry("ckpt"); if (ckptEntry) ckptEntry(CmdLine::extArgc, (void *) CmdLine::extArgv); { int stat = (*mpi_portal->_MPI_Comm_rank)(((int)(-2)), &myRank); if (stat != 0) { static char msg[0x1000]; int len = sizeof(msg); (*mpi_portal->_MPI_Error_string)(stat,msg,&len); do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("MPI_Error[%d != %d]: %.*s",stat, 0,len,msg); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); } }; { int stat = (*mpi_portal->_MPI_Comm_size)(((int)(-2)), &realsuperSize); if (stat != 0) { static char msg[0x1000]; int len = sizeof(msg); (*mpi_portal->_MPI_Error_string)(stat,msg,&len); do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("MPI_Error[%d != %d]: %.*s",stat, 0,len,msg); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); } }; mpiInitialized = true; {if (!(realsuperSize<=superSize)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "realsuperSize<=superSize" ,__PRETTY_FUNCTION__,"../../opentss/trt",1987); ((int*)0)[0]=0;}}; ; Delay::force (mpiInitDelay); } }; public: MPITagHandler(const char *name,int servicePrio) : Service(name,servicePrio), tag(nextTag++) { if (!totalTags++) { (*new MPI_Init_Delay())(CmdLine::delay); } tagHandler[tag] = this; ; } private: static bool dropMessage(bool *flag) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2001); ((int*)0)[0]=0;}}; int avail, count; struct mpi_portal_status status; if (flag) *flag = false; { int stat = (*mpi_portal->_MPI_Iprobe)((-1), (-1), ((int)(-2)), &avail, &status); if (stat != 0) { static char msg[0x1000]; int len = sizeof(msg); (*mpi_portal->_MPI_Error_string)(stat,msg,&len); do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("MPI_Error[%d != %d]: %.*s",stat, 0,len,msg); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); } }; if (!avail) return false; { int stat = (*mpi_portal->_MPI_Get_count)(&status, (1), &count); if (stat != 0) { static char msg[0x1000]; int len = sizeof(msg); (*mpi_portal->_MPI_Error_string)(stat,msg,&len); do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("MPI_Error[%d != %d]: %.*s",stat, 0,len,msg); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); } }; void *d = memoryAllocator.alloc(count); { int stat = (*mpi_portal->_MPI_Recv)(d, count, (1), status.MPI_SOURCE, status.MPI_TAG, ((int)(-2)), &status); if (stat != 0) { static char msg[0x1000]; int len = sizeof(msg); (*mpi_portal->_MPI_Error_string)(stat,msg,&len); do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("MPI_Error[%d != %d]: %.*s",stat, 0,len,msg); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); } }; if (status.MPI_TAG == (5 +1)) { if (flag) *flag = true; } memoryAllocator.free(d); return true; } bool stopHandler(int *cnt) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2017); ((int*)0)[0]=0;}}; int node; for (node = 0; node < superSize; node++) { if (node == myRank) continue; rqq[node].flushReqs(cnt); } return true; } public: static void stopMPI() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2027); ((int*)0)[0]=0;}}; {if (!(mpiInitialized)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "mpiInitialized" ,__PRETTY_FUNCTION__,"../../opentss/trt",2028); ((int*)0)[0]=0;}}; int cnt = 0; for (int tg = 0 ; tg < totalTags; tg++) { tagHandler[tg]->stopHandler(&cnt); } if (myRank) { unsigned char d = 0xfb; int free = 0; struct mpi_portal_request mpiRq; cnt = 1; { int stat = (*mpi_portal->_MPI_Isend)(&d, 1, (1), 0, (5 +1), ((int)(-2)), &mpiRq); if (stat != 0) { static char msg[0x1000]; int len = sizeof(msg); (*mpi_portal->_MPI_Error_string)(stat,msg,&len); do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("MPI_Error[%d != %d]: %.*s",stat, 0,len,msg); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); } }; do { struct mpi_portal_status status; bool flag; while (dropMessage(&flag)) {if (flag) cnt--;} { int stat = (*mpi_portal->_MPI_Test)(&mpiRq, &free, &status); if (stat != 0) { static char msg[0x1000]; int len = sizeof(msg); (*mpi_portal->_MPI_Error_string)(stat,msg,&len); do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("MPI_Error[%d != %d]: %.*s",stat, 0,len,msg); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); } }; } while (!free); } else { cnt = realsuperSize - 1 - cnt; do { bool flag; while (dropMessage(&flag)) {if (flag) cnt--;} } while (cnt); } if (myRank) { do { bool flag; while (dropMessage(&flag)) {if (flag) cnt--;} } while (cnt); } else { for (int i = 1; i < realsuperSize; i++) { unsigned char d = 0xfa; { int stat = (*mpi_portal->_MPI_Send)(&d, 1, (1), i, (5 +1), ((int)(-2))); if (stat != 0) { static char msg[0x1000]; int len = sizeof(msg); (*mpi_portal->_MPI_Error_string)(stat,msg,&len); do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("MPI_Error[%d != %d]: %.*s",stat, 0,len,msg); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); } }; } } if (conf.enableAsync) (*mpi_portal->_DMPI_Async_done)(); (*mpi_portal->_MPI_Barrier)(((int)(-2))); (*mpi_portal->_MPI_Finalize)(); mpiInitialized = false; } virtual ~MPITagHandler() { if (!mpiInitialized) { tagHandler[tag] = __null; --totalTags; return; } if (!Service::exitError) { int stat = (*mpi_portal->_MPI_Barrier)(((int)(-2))); if (stat != 0) { static char msg[0x1000]; int len = sizeof(msg); (*mpi_portal->_MPI_Error_string)(stat,msg,&len); do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("MPI_Error[%d != %d]: %.*s",stat, 0,len,msg); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); } }; tagHandler[tag] = __null; if (!--totalTags) { ; { int stat = (*mpi_portal->_MPI_Finalize)(); if (stat != 0) { static char msg[0x1000]; int len = sizeof(msg); (*mpi_portal->_MPI_Error_string)(stat,msg,&len); do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("MPI_Error[%d != %d]: %.*s",stat, 0,len,msg); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); } }; ; } } virtual bool work() { int count = 0; if (traceEntry && traceMode == 2) { if (traceCount < 0) traceCount = (unsigned long) traceEntry(0, 0); traceCount --; if (traceCount >= 0) return false; count = (unsigned long) traceEntry(1, 0); if (count) { SData *d = (SData*)SData::halloc(count); count = (unsigned long) traceEntry(count, (void *) d); if (count) { bool flag; while (!dropMessage(&flag)); msgStat.recvCount++; d->onRecv(); return true; } } return false; } {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2102); ((int*)0)[0]=0;}}; int avail; struct mpi_portal_status status; { int stat = (*mpi_portal->_MPI_Iprobe)((-1), tag, ((int)(-2)), &avail, &status); if (stat != 0) { static char msg[0x1000]; int len = sizeof(msg); (*mpi_portal->_MPI_Error_string)(stat,msg,&len); do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("MPI_Error[%d != %d]: %.*s",stat, 0,len,msg); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); } }; if (!avail) { traceCount ++; return false; } { int stat = (*mpi_portal->_MPI_Get_count)(&status, (1), &count); if (stat != 0) { static char msg[0x1000]; int len = sizeof(msg); (*mpi_portal->_MPI_Error_string)(stat,msg,&len); do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("MPI_Error[%d != %d]: %.*s",stat, 0,len,msg); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); } }; SData *d = (SData*)SData::halloc(count); { TaskStatistic::Holder __taskHolder(&mpiTask); { int stat = (*mpi_portal->_MPI_Recv)(d, count, (1), status.MPI_SOURCE, tag, ((int)(-2)), &status); if (stat != 0) { static char msg[0x1000]; int len = sizeof(msg); (*mpi_portal->_MPI_Error_string)(stat,msg,&len); do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("MPI_Error[%d != %d]: %.*s",stat, 0,len,msg); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); } }; } msgStat.recvCount++; d->cnt = 0; if (traceEntry && traceMode == 1) { traceEntry(traceCount + 1, 0); traceCount = -1; traceEntry(count, (void *) d); } ; d->onRecv(); ; return true; } }; class Cell {}; class TransportHandler : public MPITagHandler { public: int cellRankSize; int cellStartOfs; int cellSize; int sharedSize; void (*onRead)(Cell*); void (*onWrite)(Cell*); void (*inPlaceCtor)(Cell*); void (*clearCell)(Cell*); static void noop(Cell*) {} TransportHandler(const char *name, int prio) : MPITagHandler(name,prio), onRead(noop), onWrite(noop), inPlaceCtor(__null), clearCell(noop) {} }; class VZeroes { private: char *start,*end; char *nextChunk; private: static char *startMap; static char *endMap; static char *nextChunkMap; public: static void checkInit() { if (startMap) return; nextChunkMap = startMap = (char*)calloc(0x800000,1); {if (!(startMap != __null)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "startMap != NULL" ,__PRETTY_FUNCTION__,"../../opentss/trt",2160); ((int*)0)[0]=0;}}; endMap = startMap + 0x800000; } VZeroes(const char *name, size_t size) { checkInit(); start = nextChunk = nextChunkMap; end = nextChunkMap = nextChunkMap + size; {if (!(nextChunkMap < endMap)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "nextChunkMap < endMap" ,__PRETTY_FUNCTION__,"../../opentss/trt",2167); ((int*)0)[0]=0;}}; ; } char *allocZeroes(size_t size) { char *result = nextChunk; nextChunk += size; {if (!(nextChunk <= end)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "nextChunk <= end" ,__PRETTY_FUNCTION__,"../../opentss/trt",2172); ((int*)0)[0]=0;}}; ; return result; } static void* getAddress(int offset) { return startMap+offset; } static int getOffset(const void* addr) { return ((char*)addr)-startMap; } }; static inline int lg(int qty) { if (qty <= 1) return 0; qty -= 1; int l=1; while(qty >>= 1) l++; return l; } template class CachedChunks { private: Chunk* cache[32]; int inUse; public: CachedChunks() : inUse(0) { memset(cache,0,sizeof(cache)); } void finalize() { if (inUse) do { { VizStr msgstr("rank%d: %d supercells are locked\n", myRank, inUse); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } int used() const { return inUse; } private: inline Chunk* pop(Chunk** p) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2200); ((int*)0)[0]=0;}}; Chunk *c = *p; if (!c) c = fillUp(p); *p = (Chunk*)c->getClink(); ; c->setClink((Chunk*)((void*)-1)); return c; } inline void push(Chunk** p, Chunk *c) { c->setClink(*p); *p = c; } Chunk* fillUp(Chunk** p) { if ( p+1 >= cache+32 ) do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("Out of supermemory\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); Chunk *c = pop(p+1); int lg = p-cache; Chunk *c1 = c + (1<chunkSetLg(lg); c1->chunkSetLg(lg); push(p,c1); push(p,c); return c; } public: inline Chunk* allocChunk(int qty) { ; ; {if (!(qty > 0)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "qty > 0" ,__PRETTY_FUNCTION__,"../../opentss/trt",2224); ((int*)0)[0]=0;}}; inUse += qty; Chunk* c = pop(cache+lg(qty)); return c; } inline void freeChunk(Chunk* c, int qty) { ; {if (!(qty > 0)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "qty > 0" ,__PRETTY_FUNCTION__,"../../opentss/trt",2231); ((int*)0)[0]=0;}}; inUse -= qty; push(cache+lg(qty),c); ; } void flushAllChunks() { ; Chunk** p; for (p=cache; p < cache+32; p++) while (*p) Chunk::chunkBaseFree(pop(p)); } void initCollect() { int _inUse = inUse; flushAllChunks(); Chunk::chunkInit(this); inUse = _inUse; } }; class MasterSCell { private: unsigned mstRq:1; unsigned mstDone:1; unsigned mstReady:1; public: inline void mstInit () { mstDone = 0; mstReady = 0; mstRq = 0; } inline void mstSetDone () { mstDone = 1; mstReady = 0; mstRq = 0; } inline void mstSetReady () { mstReady = 1; {if (!(!mstRq)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!mstRq" ,__PRETTY_FUNCTION__,"../../opentss/trt",2255); ((int*)0)[0]=0;}}; } inline void mstSetRq () { {if (!(!mstReady)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!mstReady" ,__PRETTY_FUNCTION__,"../../opentss/trt",2256); ((int*)0)[0]=0;}}; mstRq = 1; } inline bool mstIsDone () const { return mstDone; } inline bool mstIsReady () const { return mstReady; } inline bool mstIsRq () const { return mstRq; } }; class SlaveSCell { public: unsigned slvRq:1; unsigned slvReady:1; public: inline void slvInit () { slvRq = slvReady = 0; } inline void slvSetReady () { slvRq = 0; slvReady = 1; } inline void slvSetRq () { {if (!(!slvReady)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!slvReady" ,__PRETTY_FUNCTION__,"../../opentss/trt",2268); ((int*)0)[0]=0;}}; slvRq = 1; } inline bool slvIsReady () const { return slvReady; } inline bool slvIsRq () const { return slvRq; } }; class ChunkCell : public Cell { public: }; template class Data; template class SPtr; template class SCell : public ChunkCell { private: SCell(const SCell&) { {if (!(0 && "Attempt to copy supercell")) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "0 && \"Attempt to copy supercell\"" ,__PRETTY_FUNCTION__,"../../opentss/trt",2280); ((int*)0)[0]=0;}}; } SCell& operator= (const SCell&) { {if (!(0 && "Attempt to copy supercell")) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "0 && \"Attempt to copy supercell\"" ,__PRETTY_FUNCTION__,"../../opentss/trt",2281); ((int*)0)[0]=0;}}; return *this; } protected: long long seqNo; MasterSCell mstFlags; SlaveSCell slvFlags; private: SRef ref; private: SCell *clink; public: inline void setClink(SCell* l) { clink = l; } inline SCell* getClink() const { return (SCell*)clink; } unsigned ctDone:1; inline SCell() { if (isShared() || master() == myRank) mstFlags.mstInit(); slvFlags.slvInit(); ctDone = 1; if (!isShared() && master() == myRank) seqNo++; {if (!(cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2299); ((int*)0)[0]=0;}}; } virtual ~SCell() { if (master() == myRank) finalizeMaster(); ctDone = 0; } inline long long getSeqNo () const { return seqNo; } inline int offset() const { return VZeroes::getOffset(this); } inline int oindex() const { return (offset()-handler.cellStartOfs) % handler.cellRankSize; } inline int master() const { {if (!(!isShared())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!isShared()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2312); ((int*)0)[0]=0;}}; return (offset()-handler.cellStartOfs) / handler.cellRankSize; } inline bool isShared() const { bool res = offset()-handler.cellStartOfs >= handler.cellRankSize*superSize; return res; } inline bool cellIsOk() const { if (!this) return false; bool ok = ctDone && ( offset() >= 0x1000 && offset() < handler.cellStartOfs + handler.cellRankSize*superSize+handler.sharedSize); if (!ok) { fprintf (stderr," Wrong cell %p clink %p offset %x bound %x \n", this, clink, offset(), handler.cellStartOfs + handler.cellRankSize*superSize+handler.sharedSize); } return ok; } static inline SCell& checkInit(SCell& c) { if (!c.ctDone) handler.inPlaceCtor(&c); return c; } static inline void finalizeCell(SCell& c) { if (c.ctDone) { {if (!(c.cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "c.cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2333); ((int*)0)[0]=0;}}; c.ref.clearRef(); handler.clearCell(&c); c.ctDone = 0; } } static inline SCell& cellAt(int offs) { return checkInit(*(SCell *)(VZeroes::getAddress(offs))); } static inline SCell& cellAtNoInit(int offs) { return *(SCell *)(VZeroes::getAddress(offs)); } static inline SCell* checkInitSeqNo(SCell& c, long long sn) { # 2360 "../../opentss/trt" ; if (!c.ctDone) { checkInit(c); {if (!(c.seqNo <= sn)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "c.seqNo <= sn" ,__PRETTY_FUNCTION__,"../../opentss/trt",2363); ((int*)0)[0]=0;}}; c.seqNo = sn; } else { if (c.seqNo > sn) { do { { VizStr msgstr("REinit cell [%d:%x:%lld] (%lld) by access\n", c.master(), c.oindex(), sn, c.getSeqNo()); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } {if (!(c.seqNo <= sn)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "c.seqNo <= sn" ,__PRETTY_FUNCTION__,"../../opentss/trt",2369); ((int*)0)[0]=0;}}; if (c.seqNo < sn) { finalizeCell(c); checkInit(c); c.seqNo = sn; } } return &c; } static inline SCell* cellAtSeqNo(int offs, long long sn) { return checkInitSeqNo(*(SCell *)(VZeroes::getAddress(offs)), sn); } inline int mirror(int rank) const { {if (!(!isShared())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!isShared()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2385); ((int*)0)[0]=0;}}; ; return handler.cellStartOfs + rank*handler.cellRankSize + oindex(); } inline MasterSCell& masterImage (int rank) const { {if (!(master() == myRank)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "master() == myRank" ,__PRETTY_FUNCTION__,"../../opentss/trt",2391); ((int*)0)[0]=0;}}; return cellAt(mirror(rank)).mstFlags; } virtual void dumpLeakCell() { } static inline void checkLeakCell(SCell& c) { if (!c.ctDone) return; c.dumpLeakCell(); } inline SPtr ptr() const { SPtr result(offset(),getSeqNo()); return result; } inline Data& data() { return *(Data *)& * ref; } inline Data* operator = (Data* d) { return (Data*)(ref = d); } inline operator Data* () { return &data(); } private: void finalizeMaster() { int i; for (i = 0; i < realsuperSize; i++) { MasterSCell& c = masterImage(i); if (c.mstIsDone()) handler.asyncSend(new Data(ptr(), &SCell::onSlvFinalize, "finalize", 0), i); c.mstInit(); } ref.clearRef(); } void onSlvFinalize(Data& d) { {if (!(cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2430); ((int*)0)[0]=0;}}; finalizeCell(*this); }; public: static void chunkBaseFree(SCell*) { ; } static void chunkInit(void *_cc) { ; CachedChunks< SCell >* cc = (CachedChunks< SCell >*) _cc; ; int ofs = 0; size_t qty = handler.cellRankSize/handler.cellSize; while (qty) { size_t curr = 1 << (lg(qty + 1) - 1); cc->freeChunk((SCell*)(VZeroes::getAddress(handler.cellStartOfs + handler.cellRankSize * myRank + (ofs * handler.cellSize))), curr); ofs += curr; qty -= curr; } } void chunkSetLg(int) { } }; template class SPtr { public: int cellOffset; long long seqNo; public: inline SPtr() : cellOffset(0), seqNo(0) {} inline SPtr(int offs, long long seq) : cellOffset(offs), seqNo(seq) {} inline SPtr(const SPtr& s) : cellOffset(s.cellOffset), seqNo(s.seqNo) {} inline SPtr& operator = (const SPtr& s) { cellOffset = s.cellOffset; seqNo = s.seqNo; return *this; } inline SPtr& operator = (const SCell* p) { if (p) { *this = p->ptr(); } else { cellOffset = 0; seqNo = 0; } return *this; } inline bool operator == (const SPtr& s) const { if (cellOffset == s.cellOffset) { {if (!(seqNo == s.seqNo)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "seqNo == s.seqNo" ,__PRETTY_FUNCTION__,"../../opentss/trt",2479); ((int*)0)[0]=0;}}; return true; } else { return false; } } inline bool isNull () const { return cellOffset == 0; } inline bool notNull () const { return cellOffset != 0; } inline SCell* getObjPtr() const { if (isNull()) return __null; return SCell::cellAtSeqNo(cellOffset,seqNo); } inline SCell* getObjPtrNoUpd() const { if (isNull()) return __null; return &SCell::cellAt(cellOffset); } }; template class Data : public SData { public: SPtr ptr; typedef void (SCell::*OnRecvMethod)(Data&); OnRecvMethod method; int srcRank; Data() : ptr(), method(__null), srcRank(myRank) {} Data(const SPtr& _ptr, OnRecvMethod _method, const char* _vid, int _flags = 0) : ptr(_ptr), method(_method), srcRank(myRank) { vid = _vid; flags |= _flags; } inline Data(const Data& d) { ptr = d.ptr; method = d.method; srcRank = d.srcRank; } virtual void onRecv() { SRef forCollect; forCollect = this; # 2543 "../../opentss/trt" SCell *c = ptr.getObjPtrNoUpd(); if (c->getSeqNo() > ptr.seqNo) { do { { VizStr msgstr("Cell [%d:%x:%lld] got request on %lld (%s [%d])\n", c->master(), c->oindex(), c->getSeqNo(), ptr.seqNo, viz(), size); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); return; } c = ptr.getObjPtr(); ; (c->*method)(*this); ; } }; template class DataCell : public SCell { private: void onMstRead(Data &d) { MasterSCell& slv = masterImage(d.srcRank); if (!slv.mstIsReady()) slv.mstSetRq(); else sendToSlave(d.srcRank); handler.onRead(this); } inline void masterUpdateData() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2565); ((int*)0)[0]=0;}}; int i; for (i = 0; i < realsuperSize; i++) { MasterSCell& c = this->masterImage(i); ; if (c.mstIsRq()) sendToSlave(i); else c.mstSetReady(); } } void onMstWrite(Data& d) { if (&this->data() != &d) { *(SCell*)this = &d; } ; ; if (d.srcRank != myRank) { MasterSCell& slv = masterImage(d.srcRank); slv.mstSetDone(); } masterUpdateData(); handler.onWrite(this); } inline void sendToSlave(int slvRank) { {if (!(this->cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "this->cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2588); ((int*)0)[0]=0;}}; ; SRef collect; Data *d = &this->data(); d->method=(typename Data::OnRecvMethod)&DataCell::onSlvWrite; d->ptr = this->ptr(); handler.asyncSend(d,slvRank); MasterSCell& slv = this->masterImage(slvRank); slv.mstSetDone(); } private: void onSlvWrite(Data& d) { ; {if (!(this->cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "this->cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2610); ((int*)0)[0]=0;}}; this->slvFlags.slvSetReady(); ; *(SCell*)this=&d; ; this->seqNo = d.ptr.seqNo; ; handler.onWrite(this);; } inline void sendToMaster() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2619); ((int*)0)[0]=0;}}; {if (!(this->cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "this->cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2620); ((int*)0)[0]=0;}}; ; SRef collect; Data *d = &this->data(); d->method=(typename Data::OnRecvMethod)&DataCell::onMstWrite; d->ptr = this->ptr(); handler.asyncSend(d,this->master()); this->slvFlags.slvSetReady(); } public: void write() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2640); ((int*)0)[0]=0;}}; {if (!(!this->isShared())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!this->isShared()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2641); ((int*)0)[0]=0;}}; ; this->data().srcRank = myRank; if (this->master() == myRank) masterUpdateData(); else sendToMaster(); handler.onWrite(this); } void read() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2650); ((int*)0)[0]=0;}}; {if (!(!this->isShared())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!this->isShared()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2651); ((int*)0)[0]=0;}}; if (this->master() == myRank) { handler.onRead(this); return; } {if (!(!(this->slvFlags.slvRq && this->slvFlags.slvReady))) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!(this->slvFlags.slvRq && this->slvFlags.slvReady)" ,__PRETTY_FUNCTION__,"../../opentss/trt",2653); ((int*)0)[0]=0;}}; if (this->slvFlags.slvRq) return; this->slvFlags.slvReady = 0; ; handler.asyncSend(new Data(this->ptr(),(typename Data::OnRecvMethod)&DataCell::onMstRead,"readRq"), this->master()); this->slvFlags.slvRq = 1; } }; template class StaticCell : public SCell { private: void onMstRead(Data &d) { MasterSCell& slv = this->masterImage(d.srcRank); if (!slv.mstIsReady()) slv.mstSetRq(); else sendToSlave(d.srcRank); handler.onRead(this); } inline void masterUpdateData() { int i; for (i = 0; i < realsuperSize; i++) { MasterSCell& c = this->masterImage(i); ; if (c.mstIsRq()) sendToSlave(i); else c.mstSetReady(); } } void onMstWrite(Data& d) { if (&this->data() != &d) { *(SCell*)this = &d; } ; ; if (d.srcRank != myRank) { MasterSCell& slv = this->masterImage(d.srcRank); slv.mstSetDone(); } masterUpdateData(); handler.onWrite(this); } inline void sendToSlave(int slvRank) { {if (!(this->cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "this->cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2697); ((int*)0)[0]=0;}}; ; this->data().method=(typename Data::OnRecvMethod)&StaticCell::onSlvWrite; this->data().ptr=this->ptr(); handler.asyncSend(&this->data(),slvRank); MasterSCell& slv = this->masterImage(slvRank); slv.mstSetDone(); } private: void onSlvWrite(Data &d) { ; this->slvFlags.slvSetReady(); ; *(SCell*)this = &d; ; this->seqNo = d.ptr.seqNo; ; handler.onWrite(this);; } inline void sendToMaster() { {if (!(this->cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "this->cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2713); ((int*)0)[0]=0;}}; ; this->data().method=(typename Data::OnRecvMethod)&StaticCell::onMstWrite; this->data().ptr=this->ptr(); handler.asyncSend(&this->data(),this->master()); this->slvFlags.slvSetReady(); } void writeToAll() { {if (!(this->isShared())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "this->isShared()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2720); ((int*)0)[0]=0;}}; this->data().method = (typename Data::OnRecvMethod)&StaticCell::onSlvWrite; this->data().ptr = this->ptr(); int i; for (i = 0; i < realsuperSize; i++) { if (i == myRank) continue; handler.asyncSend(&this->data(),i); } } public: inline Data* operator = (Data* d) { return *((SCell*)this) = d; } void write() { this->data().srcRank = myRank; if (this->isShared()) { writeToAll(); return; } if (1 < this->getSeqNo()) { do { { VizStr msgstr("INFO: attempt to overwrite with seqNo %llx less than current %llx\n",1,this->getSeqNo()); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); ((int*)0)[0] = 0; return; } if (this->master() == myRank) masterUpdateData(); else sendToMaster(); } void read() { if (this->isShared() || this->master() == myRank) { {if (!(this->getSeqNo() == 1)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "this->getSeqNo() == 1" ,__PRETTY_FUNCTION__,"../../opentss/trt",2744); ((int*)0)[0]=0;}}; handler.onRead(this); return; } {if (!(!(this->slvFlags.slvRq && this->slvFlags.slvReady))) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!(this->slvFlags.slvRq && this->slvFlags.slvReady)" ,__PRETTY_FUNCTION__,"../../opentss/trt",2745); ((int*)0)[0]=0;}}; if (this->slvFlags.slvRq) return; this->slvFlags.slvReady = 0; ; handler.asyncSend(new Data(SPtr(this->offset(),1),(typename Data::OnRecvMethod)&StaticCell::onMstRead,"readRq"), this->master()); this->slvFlags.slvRq = 1; } }; template class SharedCell : public SCell { private: void onSlvWrite(Data &d) { ; ; *(SCell*)this = &d; ; ; handler.onWrite(this);; } public: void writeToAll() { this->data().method = (typename Data::OnRecvMethod)&SharedCell::onSlvWrite; this->data().ptr = this->ptr(); int i; for (i = 0; i < realsuperSize; i++) { if (i == myRank) continue; handler.asyncSend(&this->data(),i); } } inline Data* operator = (Data* d) { return *((SCell*)this) = d; } }; template class DynamicSegment : public CachedChunks, public VZeroes { private: class SSegDelay : public Delay { private: CachedChunks *data; public: SSegDelay (CachedChunks *_data) : data(_data) {} ~SSegDelay() { data->initCollect(); } }; Cell *ns; public: DynamicSegment() : VZeroes(__PRETTY_FUNCTION__,sizeof(Cell)*(cellsPerNode*superSize) + 0x1000) { ns = (Cell*) (allocZeroes(sizeof(Cell)*(cellsPerNode*superSize) + 0x1000) + 0x1000); handler.cellStartOfs = VZeroes::getOffset(ns); handler.cellSize = sizeof(Cell); handler.cellRankSize = sizeof(Cell)*cellsPerNode; handler.sharedSize = 0; (*new SSegDelay(this))(mpiInitDelay); } void dumpLeakedCells() { for (int i = 0; i < cellsPerNode * realsuperSize; i++) { Cell::checkLeakCell(ns[i]); } } }; template class StaticSegment : public VZeroes { private: class SSegDelay : public Delay { private: cell *ns; public: SSegDelay (cell *_ns) : ns(_ns) {} ~SSegDelay() { for (int i=0; i < cellsPerNode*superSize+sharedCells; i++) { new (ns+i) cell; } } }; cell *ns; public: StaticSegment() : VZeroes(__PRETTY_FUNCTION__,sizeof(cell)*(cellsPerNode*superSize+sharedCells) + 0x1000) { ns = (cell*) (allocZeroes(sizeof(cell)*(cellsPerNode*superSize+sharedCells) + 0x1000) + 0x1000); handler.cellStartOfs = VZeroes::getOffset(ns); handler.cellSize = sizeof(cell); handler.cellRankSize = sizeof(cell)*cellsPerNode; handler.sharedSize = sizeof(cell)*sharedCells; (*new SSegDelay(ns))(mpiInitDelay); } cell& operator[] (int i) { ; return (ns [i]); } cell& sharedCell (int i) { ; {if (!(i >= 0 && i < sharedCells)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "i >= 0 && i < sharedCells" ,__PRETTY_FUNCTION__,"../../opentss/trt",2833); ((int*)0)[0]=0;}}; return ns [i+cellsPerNode*superSize]; } }; extern TransportHandler controlHandler, dataHandler, drcHandler; template class MData : public Data { public: MData() {} MData(const MData& m) : Data(m) {} }; template class MControlData : public Data { public: type val; inline type& operator ()() { return val; } inline MControlData() {} inline MControlData(const MControlData& m) : Data(m), val(m.val) { ; {if (!(m.size == this->size)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "m.size == this->size" ,__PRETTY_FUNCTION__,"../../opentss/trt",2854); ((int*)0)[0]=0;}}; } inline MControlData& operator= (const MControlData& m) { ; {if (!(m.size == this->size)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "m.size == this->size" ,__PRETTY_FUNCTION__,"../../opentss/trt",2858); ((int*)0)[0]=0;}}; ; this->val = m.val; ; return *this; } virtual SData* clone () { SData* result = (SData*) new (SData::halloc(this->size)) MControlData(*this); return result; } }; class DRCObj : public DataCell, public ThrQ { public: int lcnt; long long taken, we; unsigned takeRqSent : 1; static int inDRCwaiting; short sig; inline DRCObj() : lcnt(0), taken(0), we(0), takeRqSent(0), sig(17) { } inline bool drcObjOk() { return sig == 17; } inline void putWEE(signed char &wee) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2883); ((int*)0)[0]=0;}}; {if (!(drcObjOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "drcObjOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2884); ((int*)0)[0]=0;}}; {if (!(wee > 0)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "wee > 0" ,__PRETTY_FUNCTION__,"../../opentss/trt",2885); ((int*)0)[0]=0;}}; ; we += 1LL << wee; wee = -1; lcnt++; } static inline char we2wee (long long we) { {if (!(we >= 2)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "we >= 2" ,__PRETTY_FUNCTION__,"../../opentss/trt",2891); ((int*)0)[0]=0;}}; if (we > (1LL << 31)) return 31; if (we > (1LL << 16)) return 16; if (we > (1LL << 8)) return 8; if (we > (1LL << 4)) return 4; if (we > (1LL << 2)) return 2; return 1; } inline signed char getWEE() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2900); ((int*)0)[0]=0;}}; {if (!(drcObjOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "drcObjOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2901); ((int*)0)[0]=0;}}; if (we < 4) { takeWE(); {if (!(we > 4)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "we > 4" ,__PRETTY_FUNCTION__,"../../opentss/trt",2908); ((int*)0)[0]=0;}}; } signed char wee = we2wee(we); we -= 1LL << wee; {if (!(wee > 0 && we >= 0)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "wee > 0 && we >= 0" ,__PRETTY_FUNCTION__,"../../opentss/trt",2911); ((int*)0)[0]=0;}}; return wee; } inline void take(long long &_we) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2915); ((int*)0)[0]=0;}}; {if (!(drcObjOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "drcObjOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2916); ((int*)0)[0]=0;}}; taken -= _we; _we = 1LL << 31; taken += _we; } inline void retrieve(long long &_we) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2922); ((int*)0)[0]=0;}}; {if (!(drcObjOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "drcObjOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2923); ((int*)0)[0]=0;}}; taken -= _we; {if (!(taken >= 0)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "taken >= 0" ,__PRETTY_FUNCTION__,"../../opentss/trt",2925); ((int*)0)[0]=0;}}; _we = 0; if (taken == we && lcnt == 0) delete this; } inline void onLZero() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2930); ((int*)0)[0]=0;}}; retrieveWE(); } virtual void takeWE() = 0; virtual void retrieveWE() = 0; class DRCData : public Data { public: long long we; DRCData (const SPtr& _p, OnRecvMethod _method, long long _we, const char *vid) : Data(_p, _method, vid), we(_we) {} }; void onTake(Data &_d) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2945); ((int*)0)[0]=0;}}; DRCData& d = (DRCData&)_d; take(d.we); d.vid = "takeReply"; d.method = (Data::OnRecvMethod)&ts::DRCObj::onTakeReply; int srcRank = d.srcRank; d.srcRank = myRank; dataHandler .asyncSend(&d, srcRank); ; } void onTakeReply(Data &_d) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2963); ((int*)0)[0]=0;}}; DRCData& d = (DRCData&)_d; we += d.we; takeRqSent = 0; contTasks(); } void onRetrieve(Data &_d) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",2970); ((int*)0)[0]=0;}}; DRCData& d = (DRCData&)_d; {if (!(d.we > 0)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d.we > 0" ,__PRETTY_FUNCTION__,"../../opentss/trt",2972); ((int*)0)[0]=0;}}; retrieve(d.we); } virtual ~DRCObj() { sig = 0; } # 3001 "../../opentss/trt" }; class DRCRef { public: signed char wee; inline void lighten() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3006); ((int*)0)[0]=0;}}; if (wee > 0) getObj().putWEE(wee); } inline void ctor(DRCObj* obj = __null) { wee = obj ? obj->getWEE() : 0; } signed char getWEE() { lighten(); return wee ? getObj().getWEE() : 0; } inline void dtor() { ; lighten(); {if (!(!wee || getObj().lcnt > 0)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!wee || getObj().lcnt > 0" ,__PRETTY_FUNCTION__,"../../opentss/trt",3017); ((int*)0)[0]=0;}}; if (wee && !--getObj().lcnt) getObj().onLZero(); } virtual DRCObj& getObj() = 0; }; template class MObj; template class MRef : protected DRCRef, public SPtr { private: int pflags; public: inline MRef(MObj* mo = __null) { ctor(mo); } inline MRef(const MRef& mr) { ; ctor(mr.getMObjPtr()); } inline MRef& operator= (MObj* mo) { ; MRef holder(getMObjPtr()); if (getMObjPtr() != mo) { dtor(); ctor(mo); } return *this; } inline MObj* operator= (const MRef& mr) { ; ; *this = mr.getMObjPtr(); return getMObjPtr(); } inline void lighten() { DRCRef::lighten(); } # 3080 "../../opentss/trt" inline MObj* getMObjPtr() const { return (MObj*)getObjPtr(); } inline MObj& operator* () const ; virtual DRCObj& getObj(); virtual ~MRef() { ; DRCRef::dtor(); SPtr::operator = (__null); } void ctor(MObj* mo); void dtor(); }; struct Resource { int prio; int mflops; int mbytes; int bogomips; int wantedTaskMFlops; Resource() : prio(0),mflops(0),mbytes(0),bogomips(0),wantedTaskMFlops(0) {} bool operator== (Resource& r) { ; return prio==r.prio && mflops==r.mflops && bogomips==r.bogomips && mbytes==r.mbytes && wantedTaskMFlops==r.wantedTaskMFlops; } Resource& operator= (const Resource& r) { prio = r.prio; mflops = r.mflops; bogomips = r.bogomips; mbytes = r.mbytes; wantedTaskMFlops = r.wantedTaskMFlops; return *this; } Resource& operator += (const Resource &r) { prio += r.prio; mflops += r.mflops; bogomips += r.bogomips; mbytes += r.mbytes; return *this; } const char* viz() { static char buf[0x100]; snprintf(buf, sizeof(buf)-1, "[%'.1fGf,%dBM,%'.2fGiB]", mflops/1000., bogomips, mbytes/1024.); return buf; } }; class FreeResource : public Resource { public: static double doFlops (long long n) { float x=0.,x1=0.,x2=0.,x3=0.,x4=0.; while ((n-=16) > 0) x = x + x1 * x2 + x3 * x4; return x; } static long usecFlops(int n) { double startTime = wTime(); doFlops(n); double endTime = wTime(); return (long)(1000000.*(endTime - startTime)); } FreeResource() { prio = tc().nodePrio; long long flop = 10000000; int flopTime = usecFlops(flop); flop *= 100000; flop /= flopTime; (*mpi_portal->_MPI_Barrier)(((int)(-2))); mflops = flop/usecFlops(flop); const char *bogoStr = fileInfo("/proc/cpuinfo","bogomips",": ","\n"); bogomips = bogoStr ? atoi(bogoStr) : 1000; mbytes = ((long long)sysconf(_SC_PHYS_PAGES)*(long long)sysconf(_SC_PAGESIZE))/(1024*1024); } }; int getCurrentMFlops(); class TaskResource : public Resource { public: int atRank; int stackSizeLg; bool do_C_call; TaskResource() : atRank(tc().atRank), stackSizeLg(tc().stackSizeLg), do_C_call(false) { {if (!(atRank >= -1 && atRank < realsuperSize)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "atRank >= -1 && atRank < realsuperSize" ,__PRETTY_FUNCTION__,"../../opentss/trt",3167); ((int*)0)[0]=0;}}; prio = tc().prio; mflops = getCurrentMFlops()+1; if (mflops >= -1) { mflops = -1; if (conf.autoCcall) { do_C_call = true; stackSizeLg = 17; } } mbytes = tc().mbytes; }; }; class TaskCtxt { static long lastTaskClassId; static const int max_name_len = 30; char name_[max_name_len+1]; public: long taskClassId; TaskCtxt(char *name) : taskClassId(++lastTaskClassId) { strncpy(name_, name, max_name_len); name_[max_name_len] = '\0'; } char *name() { return name_; } }; extern ThreadLocal userRootTask; class Task : public MControlData, public Ring, public TaskStatistic { static long lowNextTaskId; static inline long long newTaskId() { ; return (long long)++lowNextTaskId + (((long long)myRank) << 32); } public: long long taskId; bool packed; bool reallyFinished; private: static ThreadLocal _current; char label[0x40]; public: inline Task() : TaskStatistic(0, 0) { } static inline Task* getCurrent() { return _current(); } inline bool isSystem() { return (taskId<0); } inline bool isUser() { return (taskId>0); } inline bool isSystemRoot() { return (taskId==-4); } inline virtual SData* clone() { return this; } static inline bool inUserTask() { Task *t = getCurrent(); return t ? t->isUser() : false; } static inline void setCurrent(Task* t) { {if (!(t)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "t" ,__PRETTY_FUNCTION__,"../../opentss/trt",3231); ((int*)0)[0]=0;}}; Task*& current = _current(); {if (!(current)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "current" ,__PRETTY_FUNCTION__,"../../opentss/trt",3233); ((int*)0)[0]=0;}}; if (t == current) return; current->switchStatistic(t); current = t; } static inline void enterCurrent(Task* t) { {if (!(t)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "t" ,__PRETTY_FUNCTION__,"../../opentss/trt",3240); ((int*)0)[0]=0;}}; Task* ¤t = _current(); if (!t->isSystemRoot()) {if (!(current)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "current" ,__PRETTY_FUNCTION__,"../../opentss/trt",3242); ((int*)0)[0]=0;}}; if (t == current) return; t->enter(0); current = t; } Task *parent; SThread* sth; static size_t (*get_extra)(void); static void (*after_ctor)(Task*); static size_t get_extra_default(void) {return 0;} static void after_ctor_default(Task*) {return;} virtual TaskCtxt& context(){ {if (!(0 && "ERROR: Task::context() called for pseudo-task\n")) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "0 && \"ERROR: Task::context() called for pseudo-task\\n\"" ,__PRETTY_FUNCTION__,"../../opentss/trt",3255); ((int*)0)[0]=0;}}; return *(TaskCtxt*)0; } void setLabel(const char *format, ...) { va_list args; __builtin_stdarg_start((args),format); vsnprintf(label,sizeof(label)-1,format,args); label[sizeof(label)-1] = 0; __builtin_va_end (args); } const char* getLabel() const { return label; } inline Task(long long taskId_, TaskStatistic* upStat_) : TaskStatistic(upStat_, taskId_), taskId((taskId_) ? taskId_ : newTaskId()), packed(false), reallyFinished(false), parent(getCurrent()) { label[0] = 0; if (isUser()) setCurrent(this); ; } inline void activate() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3275); ((int*)0)[0]=0;}}; {if (!(isUser())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "isUser()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3276); ((int*)0)[0]=0;}}; upStat = &userRootTask(); TaskResource& tskres = (*this)(); sth = threadAllocator().alloc(tskres.prio, tskres.stackSizeLg); sth->tsk = this; sth->waitq.contTasks(); } virtual void packState() { {if (!(!packed)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!packed" ,__PRETTY_FUNCTION__,"../../opentss/trt",3284); ((int*)0)[0]=0;}}; packed = true; } virtual void unpackState() { {if (!(packed)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "packed" ,__PRETTY_FUNCTION__,"../../opentss/trt",3288); ((int*)0)[0]=0;}}; packed = false; {if (!(isUser())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "isUser()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3290); ((int*)0)[0]=0;}}; } virtual void onRecv(); virtual void work() { {if (!(0 && "ERROR: Task::work() called for pseudo-task\n")) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "0 && \"ERROR: Task::work() called for pseudo-task\\n\"" ,__PRETTY_FUNCTION__,"../../opentss/trt",3297); ((int*)0)[0]=0;}}; } virtual ~Task() { } }; extern ThreadLocal rootTask; extern ThreadLocal idleTask; extern ThreadLocal userRootTask; extern ThreadLocal systemRootTask; extern Task schedTask; extern Task mpiTask; class TaskPrioQueue { public: Ring tasks[3]; int count; TaskPrioQueue() : count(0) {} void put(Task& t, bool fromExport) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3317); ((int*)0)[0]=0;}}; fromExport ? tasks[t().prio].pushBack(t) : tasks[t().prio].pushFront(t); count++; } Task *get(bool forExport) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3322); ((int*)0)[0]=0;}}; int i; for (i=0; i<3; i++) { if (!tasks[i].ringEmpty()) { return (Task*)(forExport ? tasks[i].getBack() : tasks[i].getFront()); } } return __null; } Task* pop(bool forExport) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3332); ((int*)0)[0]=0;}}; Task *result = get(forExport); if (result) { count--; result->remove(); } return result; } void remove(Task *t) { {if (!(count > 0)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "count > 0" ,__PRETTY_FUNCTION__,"../../opentss/trt",3338); ((int*)0)[0]=0;}}; count--; t->remove(); } void clear() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3343); ((int*)0)[0]=0;}}; ; for (int i = 0; i < 3; i++) { while (!tasks[i].ringEmpty()) { delete (Task *)tasks[i].popFront(); count--; } } } }; extern TaskPrioQueue tq; extern TaskPrioQueue ptq; class MThread : public Task { public: MThread(); bool isRunning; bool finishCondition(); virtual void start() { if (finishCondition()) throw new FinalizeException(); } virtual void stop() { } void run() { ; if (!isRunning) { ; ptq.put(*this,false); isRunning = true; } } virtual void work() = 0; virtual ~MThread() { ; } }; # 3384 "../../opentss/trt" template class MObj : public DRCObj { public: long long owner; protected: inline bool isOwned () const { return Task::inUserTask() && (Task::getCurrent()->taskId == owner); } private: inline bool isBound() { return (&this->data()!=__null); } public: inline bool isAbsolutelyReady() { bool result = isBound() && !this->owner; ; return result; } public: inline MObj() : owner(-1) {} inline MData* operator= (MData *data) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3404); ((int*)0)[0]=0;}}; return (MData*) (*(SCell*)this = data); } inline void waiting() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3408); ((int*)0)[0]=0;}}; {if (!(Task::inUserTask())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "Task::inUserTask()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3409); ((int*)0)[0]=0;}}; Freezer::TemporaryOff _f; ; { Task::Holder __holder(&systemRootTask()); stopHereAndRunOthers(); } ; {if (!(cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3421); ((int*)0)[0]=0;}}; } inline MData* getData() { ; {if (!(cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3426); ((int*)0)[0]=0;}}; if (isOwned()) { do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("Deadlock detected\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); } read(); while (owner) waiting(); {if (!(&data() != __null)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "&data() != NULL" ,__PRETTY_FUNCTION__,"../../opentss/trt",3430); ((int*)0)[0]=0;}}; return (MData*)&data(); } # 3445 "../../opentss/trt" protected: inline void unlock() { ; write(); } inline void lockBy(long long _owner) { {if (!(_owner > 0)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "_owner > 0" ,__PRETTY_FUNCTION__,"../../opentss/trt",3458); ((int*)0)[0]=0;}}; if (_owner == owner) return; {if (!(owner == -1)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "owner == -1" ,__PRETTY_FUNCTION__,"../../opentss/trt",3460); ((int*)0)[0]=0;}}; owner = _owner; } inline void lock() { if (Task::getCurrent()) lockBy(Task::getCurrent()->taskId); } protected: inline void onWrite() { owner = 0; contTasks(); } public: void chunkSetLg(int) { } virtual ~MObj() { ; } virtual void takeWE() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3478); ((int*)0)[0]=0;}}; if (master() == myRank) { take(we); } else { ; inDRCwaiting++; while (we < (1ll << 16)) { if (!takeRqSent) { dataHandler .asyncSend(new DRCData(ptr(), (Data::OnRecvMethod)&ts::DRCObj::onTake, we, "takeWE"), master()); we = 0; takeRqSent = 1; } if (Task::inUserTask()) waiting(); else { Freezer::TemporaryOff _f; while (takeRqSent) { dataHandler.work(); sched_yield(); } } } inDRCwaiting--; } } virtual void retrieveWE() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3510); ((int*)0)[0]=0;}}; ; if (master() == myRank) { retrieve(we); } else { ; if (we == 0) return; dataHandler.asyncSend(new DRCData(ptr(), (Data::OnRecvMethod)&ts::DRCObj::onRetrieve, we, "retrieve"), master()); we = 0; } } private: void* operator new (size_t) {return __null;} void* operator new[] (size_t) {return __null;} }; inline bool MThread::finishCondition() { return false; } template inline MObj& MRef::operator* () const { return *getMObjPtr(); } template inline void MRef::ctor(MObj* mo) { ; DRCRef::ctor(mo ? mo : __null); SPtr::operator = (mo); pflags = tc().pflags; } template inline void MRef::dtor () { DRCRef::dtor(); *(SPtr*)this = __null; } template DRCObj& MRef::getObj() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3548); ((int*)0)[0]=0;}}; MObj *mo = getMObjPtr(); if (mo) {if (!(mo->drcObjOk() && mo->cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "mo->drcObjOk() && mo->cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3550); ((int*)0)[0]=0;}}; return (DRCObj &)*mo; } # 3580 "../../opentss/trt" class TaskBoard : public StaticSegment,controlHandler,(5),(4+2)> { public: inline StaticCell& resourceCell(int rank) { return (*this)[(5)*rank]; } inline Resource& resourceAt(int rank) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3584); ((int*)0)[0]=0;}}; if (rank != myRank) resourceCell(rank).read(); MControlData *d = (MControlData *)&resourceCell(rank).data(); if (!d) resourceCell(rank) = d = new MControlData(); d->vid = "resource"; return (*d)(); } inline StaticCell& statisticCell(int rank) { return (*this)[(5)*rank+1]; } inline Statistic& statisticAt(int rank) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3593); ((int*)0)[0]=0;}}; if (rank != myRank) statisticCell(rank).read(); MControlData *d = (MControlData *)&statisticCell(rank).data(); if (!d) statisticCell(rank) = d = new MControlData(); d->vid = "statistic"; return (*d)(); } inline StaticCell& readyCell(int rank) { return (*this)[(5)*rank+2]; } inline char& readyAt(int rank) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3602); ((int*)0)[0]=0;}}; if (rank != myRank) readyCell(rank).read(); MControlData *d = (MControlData *)&readyCell(rank).data(); if (!d) { readyCell(rank) = d = new MControlData(); d->vid = "ready"; (*d)() = 0; } return (*d)(); } inline StaticCell& msgStatCell(int rank) { return (*this)[(5)*rank+3]; } StaticCell& heartbeatCell() { return sharedCell(0); } int& heartbeatData() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3615); ((int*)0)[0]=0;}}; MControlData *d = (MControlData *)&heartbeatCell().data(); if (!d) { heartbeatCell() = d = new MControlData(); d->vid = "heartbeat"; (*d)() = 0; } return (*d)(); } StaticCell& relaxCell() { return sharedCell(1); } char& relaxData() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3626); ((int*)0)[0]=0;}}; MControlData *d = (MControlData *)&relaxCell().data(); if (!d) { relaxCell() = d = new MControlData(); d->vid = "relax"; (*d)() = 0; } return (*d)(); } FreeResource *myFreeRes; Resource *zeroRes; TaskBoard() : myFreeRes(new FreeResource), zeroRes(new Resource) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3638); ((int*)0)[0]=0;}}; myStat = &statisticAt(myRank); resourceAt(myRank) = *myFreeRes; resourceCell(myRank).write(); } void deleteSuperCells() { for (int j=0;j<(4+2);j++) ((SCell&)(sharedCell(j))) = 0; for (int i=0; i maxMFlops) { rankFound = i; maxMFlops = res.mflops; ; } } return rankFound; } int routeTask(Task *t, int tryToRunWhere) { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3685); ((int*)0)[0]=0;}}; int atRank = (*t)().atRank; if (atRank == -1) atRank = tryToRunWhere; if (atRank == -1) return -1; if (atRank == myRank) { {if (!(t->ringEmpty())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "t->ringEmpty()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3690); ((int*)0)[0]=0;}}; tq.put(*t, false); t->activate(); statisticCell(myRank).write(); myStat->tasksActivated++; } else { if (!t->packed) t->packState(); if ((*t)().atRank < 0) resourceAt(atRank).mflops = 0; controlHandler.asyncSend(t,atRank); myStat->tasksExported++; } return atRank; } }; class MacroScheduler : public Service { class Heartbeat : public Prof { int lastHeartbeat; MacroScheduler* ms; public: Heartbeat(MacroScheduler *_instance):lastHeartbeat(0),ms(_instance) { start(); }; void check() { stop(); if (ms->tb.heartbeatData() < 0) { exitServices(0); goto out; } # 3745 "../../opentss/trt" out: start(); } }; Heartbeat hb; public: TaskBoard tb; static MacroScheduler* (*New)(void); static MacroScheduler* New_default() { return new MacroScheduler; }; MacroScheduler(): Service( __FUNCTION__,4 ),hb(this) { ; } virtual ~MacroScheduler() {} virtual bool visit() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3761); ((int*)0)[0]=0;}}; if (ptq.count > 1) { ; Task* t = ptq.pop(true); {if (!(t != __null)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "t != NULL" ,__PRETTY_FUNCTION__,"../../opentss/trt",3764); ((int*)0)[0]=0;}}; if (tb.routeTask(t,tb.mostFreeRank((*t)().mflops)) >= 0) { return true; } else { ptq.put(*t, true); return tb.publish((*t)()); } } else if (ptq.count == 1) { return tb.publish(*tb.zeroRes); } else { int mflops = tb.mostHeavyTaskMFlops(); if (mflops < 0) { tb.myFreeRes->wantedTaskMFlops = mflops; return tb.publish(*tb.myFreeRes); } else { return false; } } } bool runLocalTasks() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3784); ((int*)0)[0]=0;}}; ThrQS& tqs = ThrQS::tqs(); bool have_tasks = tqs.hasReadyThreads(); Task *t; if (!have_tasks && (t = ptq.pop(false))) { tb.routeTask(t,myRank); } have_tasks = tqs.hasReadyThreads(); if (have_tasks) { Task::setCurrent(&systemRootTask()); Task::setCurrent(&schedTask); tqs.run(); } else { Task::setCurrent(&idleTask()); Task::setCurrent(&schedTask); } return have_tasks; } void setStatistic() { {if (!(thread_self() == 0)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "thread_self() == 0" ,__PRETTY_FUNCTION__,"../../opentss/trt",3803); ((int*)0)[0]=0;}}; {if (!(Task::getCurrent()->isSystemRoot())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "Task::getCurrent()->isSystemRoot()" ,__PRETTY_FUNCTION__,"../../opentss/trt",3804); ((int*)0)[0]=0;}}; systemRootTask().leave(); myStat->alive = false; myStat->total_time = tick2Sec(rootTask().time); myStat->tasks_time = 0; myStat->idle_time = 0; for (int i = 0; i < thread_ncpu(); i++) { myStat->tasks_time += tick2Sec(userRootTask[i].time); myStat->idle_time += tick2Sec(idleTask[i].time); } myStat->sched_time = tick2Sec(schedTask.time); myStat->mpi_time = tick2Sec(mpiTask.time); myStat->msgsSent = mpiTask.msg_count; myStat->msgsAsyncSent = mpiTask.async_msg_count; myStat->msgsSize = mpiTask.msg_size; tb.statisticCell(myRank).write(); ; } bool mainStatisticReady() { int i; for (i = 0; i < realsuperSize; i++) if (tb.statisticAt(i).alive) return false; return true; } # 3849 "../../opentss/trt" void printStatistic() { do { do { { VizStr msgstr("%-20s ", "Tasks activated"":"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); if (realsuperSize > 1 ) { typeof(myStat->tasksActivated) min,max,avg,tmp; min=max=avg=tb.statisticAt(0).tasksActivated; for (int i=1; i= tmp) min = tmp; if (max <= tmp) max = tmp; avg += tmp; } avg /= realsuperSize; do { { VizStr msgstr(" [""%Ld""/""%Ld""/""%Ld""] ", min, avg, max); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } else { for (int i=0; iwrite(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } do { { VizStr msgstr("\n"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } while (0); do { do { { VizStr msgstr("%-20s ", "Tasks exported"":"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); if (realsuperSize > 1 ) { typeof(myStat->tasksExported) min,max,avg,tmp; min=max=avg=tb.statisticAt(0).tasksExported; for (int i=1; i= tmp) min = tmp; if (max <= tmp) max = tmp; avg += tmp; } avg /= realsuperSize; do { { VizStr msgstr(" [""%Ld""/""%Ld""/""%Ld""] ", min, avg, max); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } else { for (int i=0; iwrite(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } do { { VizStr msgstr("\n"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } while (0); do { do { { VizStr msgstr("%-20s ", "Msgs sent"":"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); if (realsuperSize > 1 ) { typeof(myStat->msgsSent) min,max,avg,tmp; min=max=avg=tb.statisticAt(0).msgsSent; for (int i=1; i= tmp) min = tmp; if (max <= tmp) max = tmp; avg += tmp; } avg /= realsuperSize; do { { VizStr msgstr(" [""%Ld""/""%Ld""/""%Ld""] ", min, avg, max); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } else { for (int i=0; iwrite(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } do { { VizStr msgstr("\n"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } while (0); do { do { { VizStr msgstr("%-20s ", "Async Msgs"":"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); if (realsuperSize > 1 ) { typeof(myStat->msgsAsyncSent) min,max,avg,tmp; min=max=avg=tb.statisticAt(0).msgsAsyncSent; for (int i=1; i= tmp) min = tmp; if (max <= tmp) max = tmp; avg += tmp; } avg /= realsuperSize; do { { VizStr msgstr(" [""%Ld""/""%Ld""/""%Ld""] ", min, avg, max); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } else { for (int i=0; iwrite(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } do { { VizStr msgstr("\n"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } while (0); do { do { { VizStr msgstr("%-20s ", "Msgs size"":"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); if (realsuperSize > 1 ) { typeof(myStat->msgsSize) min,max,avg,tmp; min=max=avg=tb.statisticAt(0).msgsSize; for (int i=1; i= tmp) min = tmp; if (max <= tmp) max = tmp; avg += tmp; } avg /= realsuperSize; do { { VizStr msgstr(" [""%Ld""/""%Ld""/""%Ld""] ", min, avg, max); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } else { for (int i=0; iwrite(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } do { { VizStr msgstr("\n"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } while (0); do { do { { VizStr msgstr("%-20s ", "Taskboard visits"":"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); if (realsuperSize > 1 ) { typeof(myStat->visit_count) min,max,avg,tmp; min=max=avg=tb.statisticAt(0).visit_count; for (int i=1; i= tmp) min = tmp; if (max <= tmp) max = tmp; avg += tmp; } avg /= realsuperSize; do { { VizStr msgstr(" [""%d""/""%d""/""%d""] ", min, avg, max); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } else { for (int i=0; iwrite(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } do { { VizStr msgstr("\n"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } while (0); do { do { { VizStr msgstr("%-20s ", "Scheduler time"":"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); if (realsuperSize > 1 ) { typeof(myStat->sched_time) min,max,avg,tmp; min=max=avg=tb.statisticAt(0).sched_time; for (int i=1; i= tmp) min = tmp; if (max <= tmp) max = tmp; avg += tmp; } avg /= realsuperSize; do { { VizStr msgstr(" [""%.3lf""/""%.3lf""/""%.3lf""] ", min, avg, max); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } else { for (int i=0; iwrite(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } do { { VizStr msgstr("\n"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } while (0); do { do { { VizStr msgstr("%-20s ", "MPI time"":"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); if (realsuperSize > 1 ) { typeof(myStat->mpi_time) min,max,avg,tmp; min=max=avg=tb.statisticAt(0).mpi_time; for (int i=1; i= tmp) min = tmp; if (max <= tmp) max = tmp; avg += tmp; } avg /= realsuperSize; do { { VizStr msgstr(" [""%.3lf""/""%.3lf""/""%.3lf""] ", min, avg, max); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } else { for (int i=0; iwrite(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } do { { VizStr msgstr("\n"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } while (0); do { do { { VizStr msgstr("%-20s ", "Idle time"":"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); if (realsuperSize > 1 ) { typeof(myStat->idle_time) min,max,avg,tmp; min=max=avg=tb.statisticAt(0).idle_time; for (int i=1; i= tmp) min = tmp; if (max <= tmp) max = tmp; avg += tmp; } avg /= realsuperSize; do { { VizStr msgstr(" [""%.3lf""/""%.3lf""/""%.3lf""] ", min, avg, max); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } else { for (int i=0; iwrite(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } do { { VizStr msgstr("\n"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } while (0); do { do { { VizStr msgstr("%-20s ", "Tasks time"":"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); if (realsuperSize > 1 ) { typeof(myStat->tasks_time) min,max,avg,tmp; min=max=avg=tb.statisticAt(0).tasks_time; for (int i=1; i= tmp) min = tmp; if (max <= tmp) max = tmp; avg += tmp; } avg /= realsuperSize; do { { VizStr msgstr(" [""%.3lf""/""%.3lf""/""%.3lf""] ", min, avg, max); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } else { for (int i=0; iwrite(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } do { { VizStr msgstr("\n"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } while (0); do { do { { VizStr msgstr("%-20s ", "Total time"":"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); if (realsuperSize > 1 ) { typeof(myStat->total_time) min,max,avg,tmp; min=max=avg=tb.statisticAt(0).total_time; for (int i=1; i= tmp) min = tmp; if (max <= tmp) max = tmp; avg += tmp; } avg /= realsuperSize; do { { VizStr msgstr(" [""%.3lf""/""%.3lf""/""%.3lf""] ", min, avg, max); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } else { for (int i=0; iwrite(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } do { { VizStr msgstr("\n"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } while (0); } virtual void exchangeByResources() { int i, realRess; do { Service::service[0]->work(); for (realRess = 0, i = 0; i < realsuperSize; i++) realRess += !!tb.resourceAt(i).mflops; } while (realRess < realsuperSize); ; tb.readyAt(myRank) = 1; tb.readyCell(myRank).write(); ; do { Service::service[0]->work(); for (realRess = 0, i = 0; i < realsuperSize; i++) realRess += !!tb.readyAt(i); } while (realRess < realsuperSize); ; } void printClusterResources() { Resource *r; if (realsuperSize > 1) { do { { VizStr msgstr("("); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); int i, cnt = 0; Resource total; Resource *p = __null; for (i = 0; i < realsuperSize; i++) { r = &tb.resourceAt(i); {if (!(r->mflops > 0)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "r->mflops > 0" ,__PRETTY_FUNCTION__,"../../opentss/trt",3894); ((int*)0)[0]=0;}}; if ((i == 0) || (r->bogomips != p->bogomips) || (r->mbytes != p->mbytes)) { if ((i != 0) && (cnt > 1)) do { { VizStr msgstr("*%d",cnt); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("%s%s", i?"+":"", r->viz()); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); cnt = 1; } else cnt++; total += *r; p = r; } if (cnt > 1) do { { VizStr msgstr("*%d",cnt); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr(") ~= %s\n", total.viz()); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } else { do { { VizStr msgstr("%s\n", tb.resourceAt(myRank).viz()); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } } bool tryShutdownDataHandler() { {if (!(myRank == 0)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "myRank == 0" ,__PRETTY_FUNCTION__,"../../opentss/trt",3910); ((int*)0)[0]=0;}}; int rank; int count; MPIMsgStat cur; static MPIMsgStat last; count = 0; for (rank = 0; rank < realsuperSize; rank++) { MControlData *d = (MControlData*)&tb.msgStatCell(rank).data(); if (d == 0) { tb.msgStatCell(rank).read(); return false; } count++; cur += (*d)(); } {if (!(count == realsuperSize)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "count == realsuperSize" ,__PRETTY_FUNCTION__,"../../opentss/trt",3925); ((int*)0)[0]=0;}}; for (rank = 1; rank < realsuperSize; rank++) { tb.msgStatCell(rank) = __null; } if (!cur.equal()) return false; if (cur == last) { return true; } last = cur; return false; } virtual bool work() { hb.check(); static bool relaxed = false; static bool gotRelax = false; static bool canShutdown = false; static bool statisticReady = false; ; if (tb.relaxData() && !gotRelax) { ptq.clear(); gotRelax = true; } if (gotRelax && !relaxed) { if (thread_self() != 0) { Task::setCurrent(&systemRootTask()); Service::exitThread(); return false; } if (Service::threadExited < (thread_ncpu() - 1)) return false; Task::setCurrent(&systemRootTask()); {if (!(thread_self() == 0)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "thread_self() == 0" ,__PRETTY_FUNCTION__,"../../opentss/trt",3958); ((int*)0)[0]=0;}}; if (tq.count > 0) { do { { VizStr msgstr("main result is ready and %d TFuns are still working. Memory leaks are possible.\n", tq.count); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } MControlData *d = new MControlData(); tb.msgStatCell(myRank) = d; d->vid = "msgstat"; setStatistic(); ; relaxed = true; } if (relaxed) { MControlData *d = (MControlData *)&tb.msgStatCell(myRank).data(); (*d)() = dataHandler.getStat(); tb.msgStatCell(myRank).write(); if (myRank == mainRank) { if (!canShutdown && tryShutdownDataHandler()) canShutdown = true; } } if (myRank == mainRank) { if (relaxed) { if (!statisticReady) statisticReady = mainStatisticReady(); if (statisticReady && canShutdown) { tb.heartbeatData() = -1; tb.heartbeatCell().write(); ; } return false; } else { bool mainResultReady(); if (mainResultReady()) { tb.relaxData() = 1; ; tb.relaxCell().write(); return false; } } } static bool last_result = false; bool result; { Task::setCurrent(&schedTask); myStat->visit_count++; result = visit(); bool has_tasks = runLocalTasks(); result = result || has_tasks; if (has_tasks) Task::setCurrent(&systemRootTask()); else Task::setCurrent(&idleTask()); } last_result = result; return result; } }; template class TData : public MData { public: TData() {} TData(const TData& m) : MData(m) {} virtual bool isReady() const = 0; }; class ExtDataInfo { char signature; public: size_t eDataSize; size_t eDataOffs; inline ExtDataInfo() {} inline ExtDataInfo(char *eData, size_t eSize): signature(123),eDataSize(eSize),eDataOffs(eData-(char*)this) { } inline bool ok() { return signature == 123; } }; class TExtData { ExtDataInfo __edi[0]; inline ExtDataInfo& edi() const { ExtDataInfo& edi = (ExtDataInfo&)__edi[-1]; if (!edi.ok()) { do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("ExtData: failed to access extra data area. May be non-tval ExtData ?"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); } return edi; } public: TExtData(){} size_t& extDataSize() const { return edi().eDataSize; } void* extData () const { return edi().eDataSize ? (char*)&edi() + edi().eDataOffs : __null; } }; template class TDataReady : public TData { private: ExtDataInfo edi; type val; public: char __end[0]; inline type& operator ()() { return val; } virtual bool isReady() const { return true; } inline TDataReady() : edi(__end,0) { } inline TDataReady(const TDataReady& m) : TData(m), edi(__end,m.edi.eDataSize), val(m.val) { ; } inline TDataReady& operator= (const TDataReady& m) { ; edi = m.edi; {if (!(this->ptr == m.ptr)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "this->ptr == m.ptr" ,__PRETTY_FUNCTION__,"../../opentss/trt",4084); ((int*)0)[0]=0;}}; ; this->val = m.val; ; return *this; } virtual SData* clone () { SData* result = (SData*) new (TDataReady::halloc(sizeof(*this)+edi.eDataSize)) TDataReady(*this); return result; } }; template class TObj; template class TDsc : public MRef { public: inline TDsc() { } inline TDsc(const TDsc& d) { (*this) = &d(); } inline TDsc& operator= (const TDsc d) { (*this) = &d(); return *this; } inline TDsc(TObj*); inline TObj* operator= (TObj*); inline TObj& operator()() const { return *getTObjPtr(); } inline TObj* getTObjPtr() const { return (TObj *)this->getMObjPtr(); } inline void drop(); virtual ~TDsc() { } inline bool isLocal() const { return this->isNull() || getTObjPtr()->isLocal(); } inline bool isGlobal() const { return !isLocal(); } inline void localize(); virtual const char *info() const { return "TDsc: "; } }; class AnyType {}; template class TDataNotReady; template class TObj : public MObj { public: TDsc dth; size_t initialExtraSize; private: bool local; public: inline bool isLocal() const { return local; } inline bool isGlobal() const { return !local; } inline void setGlobal() { local = false; } inline void setUnlock() { setGlobal(); this->unlock(); } inline void setOwner(long long owner) { this->lockBy(owner); } public: inline TObj(bool locked=true) : dth(__null), initialExtraSize(tc().extraSize), local(true) { if (locked) this->lock(); } private: inline TObj(const TObj& t) : dth(__null), initialExtraSize(0) { {if (!(0)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "0" ,__PRETTY_FUNCTION__,"../../opentss/trt",4189); ((int*)0)[0]=0;}}; } private: inline void makeUnbound() { *this = (TData*)__null; } public: inline TData* operator= (TData *data) { ; *(SCell*)this = data; ; return data; } public: inline operator type () { {if (!(isLocal())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "isLocal()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4205); ((int*)0)[0]=0;}}; return (*this)()(); } # 4252 "../../opentss/trt" inline TDataReady& operator()() { {if (!(isLocal())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "isLocal()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4253); ((int*)0)[0]=0;}}; TData* td = (TData*)&this->data(); if (td == __null) { TDataReady* t = new (TDataReady::halloc(sizeof(TDataReady)+initialExtraSize)) TDataReady; *this = t; return *t; } else if (td->isReady()) { return *(TDataReady*)td; } else { do { TObj* curr = ((TDataNotReady*)td)->getTObjPtr(); td = (TData*) (curr->getData()); *this = td; if (td->isReady()) { TDataReady* rd = (TDataReady*) (td->clone()); *this = rd; return *rd; } } while (1); } } # 4304 "../../opentss/trt" private: inline TObj& getMyDrop() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4306); ((int*)0)[0]=0;}}; {if (!(this->cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "this->cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4307); ((int*)0)[0]=0;}}; {if (!(this->isOwned())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "this->isOwned()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4311); ((int*)0)[0]=0;}}; TObj *dt = dth.getTObjPtr(); if (!dt) { dt = new TObj; ; dt->setGlobal(); dth = dt; } return *dt; } public: inline TDsc ownerCopy() { if (this == __null) return __null; ; {if (!(this->cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "this->cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4328); ((int*)0)[0]=0;}}; {if (!(Task::inUserTask())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "Task::inUserTask()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4329); ((int*)0)[0]=0;}}; if (!this->isOwned()) return this; if (&this->data()!=__null) { TObj* t = new TObj; *t = &ownerCopyData(); t->setUnlock(); TDsc d = t; return d; } else { return &getMyDrop(); } } inline TObj& operator= (const type& v) { ; {if (!(this->cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "this->cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4349); ((int*)0)[0]=0;}}; {if (!(isLocal())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "isLocal()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4351); ((int*)0)[0]=0;}}; TData* td = (TData*)&this->data(); TDataReady* t; if ((td == __null) || !(td->isReady())) { t = new (TDataReady::halloc(sizeof(TDataReady)+initialExtraSize)) TDataReady; *this = t; } else { t = (TDataReady*) td; } (*t)() = v; return *this; } inline TObj& operator= (TObj& t) { ; {if (!(this->cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "this->cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4369); ((int*)0)[0]=0;}}; {if (!(isLocal())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "isLocal()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4371); ((int*)0)[0]=0;}}; if (this != &t) { if (!t.owner || (t.isOwned() && (&t.data()!=__null))) { ; TData *td = (TData*)&t.data(); *this = td; if (td->isReady()) { *this = (TData*)(td->clone()); } } else { ; *this = new TDataNotReady(t.isOwned()?t.getMyDrop():t); } # 4400 "../../opentss/trt" } else { ; } return *this; } void drop(bool doUnbound = true) { ; {if (!(this->cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "this->cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4407); ((int*)0)[0]=0;}}; ; if (Task::inUserTask() && isLocal()) { TObj *dt = dth.getTObjPtr(); if (dt) { {if (!(dt->cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "dt->cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4416); ((int*)0)[0]=0;}}; *dt = &ownerCopyData(); # 4428 "../../opentss/trt" dt->setUnlock(); ; } } dth = __null; if (doUnbound) makeUnbound(); } public: inline TObj& ownerFreezeCopy() { TObj& result = *new TObj; result = &ownerCopyData(); result.setUnlock(); return result; } inline TData& ownerCopyData() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4444); ((int*)0)[0]=0;}}; {if (!(this->cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "this->cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4445); ((int*)0)[0]=0;}}; TData *my = (TData*) &this->data(); if (!my) { do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("Drop or freeze on unitialized T-value!"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); } { Freezer frz; TData* d = (TData*)(my->clone()); return *d; } } public: virtual ~TObj() { {if (!(this->cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "this->cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4471); ((int*)0)[0]=0;}}; drop(); ; ; } virtual void dumpLeakCell() { if (&this->data() == 0) return; do { { VizStr msgstr("[%d] Leaked cell %x,%lld with data %s (%d bytes). Have weight %lld, lcnt %d\n", myRank, this->offset(), this->getSeqNo(), this->data().viz(), this->data().size, this->we, this->lcnt); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); # 4487 "../../opentss/trt" } void* operator new (size_t size) { extern DynamicSegment< TObj, dataHandler, ((0x800000/(sizeof(TObj)*24)) - (0x10)) >& tseg(); return tseg().allocChunk((size+sizeof(TObj)-1)/sizeof(TObj)); } void* operator new[] (size_t size) { extern DynamicSegment< TObj, dataHandler, ((0x800000/(sizeof(TObj)*24)) - (0x10)) >& tseg(); return tseg().allocChunk((size+sizeof(TObj)-1)/sizeof(TObj)); } void operator delete (void* mem, size_t size) { extern DynamicSegment< TObj, dataHandler, ((0x800000/(sizeof(TObj)*24)) - (0x10)) >& tseg(); TObj*m = (TObj*)mem; {if (!(m->master() == myRank)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "m->master() == myRank" ,__PRETTY_FUNCTION__,"../../opentss/trt",4505); ((int*)0)[0]=0;}}; tseg().freeChunk(m, (size+sizeof(TObj)-1)/sizeof(TObj)); } void operator delete[] (void* mem, size_t size) { extern DynamicSegment< TObj, dataHandler, ((0x800000/(sizeof(TObj)*24)) - (0x10)) >& tseg(); TObj*m = (TObj*)mem; {if (!(m->master() == myRank)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "m->master() == myRank" ,__PRETTY_FUNCTION__,"../../opentss/trt",4511); ((int*)0)[0]=0;}}; tseg().freeChunk(m, (size+sizeof(TObj)-1)/sizeof(TObj)); } void* operator new (size_t size, void *mem) { return mem; } public: class InitDataHandler { private: static void inPlaceCtor (Cell *c) { TObj *t = new (c) TObj(false); t->setGlobal(); } static void clearCell (Cell *c) { ((TObj*)c)->clearCell(); } static void tssOnWrite (Cell *c) { ((TObj*)c)->tssOnWrite(); } public: InitDataHandler() { dataHandler.onWrite = tssOnWrite; dataHandler.inPlaceCtor = inPlaceCtor; dataHandler.clearCell = clearCell; } }; private: void clearCell() { dth = __null; makeUnbound(); {if (!(this->owner <= 0)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "this->owner <= 0" ,__PRETTY_FUNCTION__,"../../opentss/trt",4537); ((int*)0)[0]=0;}}; this->owner = 0; this->initialExtraSize = 0; ((DRCObj *)this)->~DRCObj(); } void tssOnWrite () { Task *savedCurrent = Task::getCurrent(); Task::setCurrent(&systemRootTask()); this->onWrite(); Task::setCurrent(savedCurrent); } # 4606 "../../opentss/trt" }; template class TDataNotReady : public TData { private: MRef nonReady; public: virtual bool isReady() const { return false; } TDataNotReady(TObj& to) { nonReady = &to; } # 4634 "../../opentss/trt" virtual SData* clone () { SData* result = (SData*) new (TDataNotReady::halloc(this->size)) TDataNotReady(*this); return result; } inline TObj* getTObjPtr() const { return (TObj*)(nonReady.getMObjPtr()); } }; template inline TDsc::TDsc(TObj* t) { *(MRef*)this = t; } template inline TObj* TDsc::operator= (TObj* t) { *(MRef*)this = t; return t; } template inline void TDsc::drop() { if (this->notNull()) getTObjPtr()->drop( false ); } template inline void TDsc::localize() { if (this->isNull()) return; if (this->isLocal()) return; TObj *t = new TObj; *t = new TDataNotReady(*(getTObjPtr())); *this = t; } extern DynamicSegment< TObj,dataHandler,((0x800000/(sizeof(TObj)*24)) - (0x10)) > _tseg; extern DynamicSegment< TObj,dataHandler,((0x800000/(sizeof(TObj)*24)) - (0x10)) >& tseg(); template class TVar ; template class TFrz { int magic; TDsc d; public: inline bool ok() const { return magic == 0x1223331; } TObj& operator()() const { {if (!(d.isGlobal())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d.isGlobal()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4683); ((int*)0)[0]=0;}}; return d(); } operator TObj& () const { {if (!(d.isGlobal())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d.isGlobal()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4684); ((int*)0)[0]=0;}}; return d(); } operator type () const { {if (!(d.isGlobal())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d.isGlobal()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4686); ((int*)0)[0]=0;}}; if (Task::inUserTask()) { TDsc t = d; t.localize(); return t()()(); } TData* data = (TData*)&(d().data()); if (data->isReady()) { return (*(TDataReady*)data)(); } else { do { do { { VizStr msgstr("\n\n[%d]: ", myRank); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("Sorry, dude. I can't wait for data here.\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("\n\n"); ui->write(bright(Red),msgstr.close()); } VizStr::rewind(); } while(0); exit(1); } while(0); return d()()(); } } const char * info() const { return d.info(); } inline TFrz() : magic(0x1223331), d(__null) {}; inline ~TFrz() { magic = 0; } inline type operator+ (TFrz t) { return (type)(*this) + (type)t; } inline type operator- (TFrz t) { return (type)(*this) - (type)t; } inline type operator* (TFrz t) { return (type)(*this) * (type)t; } inline type operator/ (TFrz t) { return (type)(*this) / (type)t; } inline TFrz(type v) : magic(0x1223331),d(new TObj) { Freezer frz; d()()() = v; d().setUnlock(); {if (!(d.isGlobal())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d.isGlobal()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4713); ((int*)0)[0]=0;}}; } inline TFrz(TObj* t) : magic(0x1223331),d(t->ownerCopy()) { {if (!(d.isGlobal())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d.isGlobal()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4714); ((int*)0)[0]=0;}}; } inline TFrz(TObj& t) : magic(0x1223331),d(t.ownerCopy()) { {if (!(d.isGlobal())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d.isGlobal()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4715); ((int*)0)[0]=0;}}; } inline TFrz(const TDsc& t) : magic(0x1223331),d(t().ownerCopy()) { {if (!(d.isGlobal())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d.isGlobal()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4716); ((int*)0)[0]=0;}}; } inline TFrz(const TVar& t) : magic(0x1223331),d(((TObj&)((TVar&)t)).ownerCopy()) { {if (!(d.isGlobal())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d.isGlobal()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4717); ((int*)0)[0]=0;}}; } inline TFrz(const TFrz& t) : magic(0x1223331),d(&t()) { {if (!(d.isGlobal())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d.isGlobal()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4718); ((int*)0)[0]=0;}}; } inline TFrz& operator = (const TFrz t) { d = &t(); {if (!(d.isGlobal())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d.isGlobal()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4719); ((int*)0)[0]=0;}}; return *this; } # 4730 "../../opentss/trt" inline void reset() { d = __null; } }; template class TPtr { private: TDsc d; public: inline TPtr() {} inline TPtr(const TObj* t) { ; d = (TObj*)t; } inline TObj* operator= (TObj* t) { d = (TObj*)t; ; return d.getTObjPtr(); } inline TObj* operator= (TFrz frz) { d = &(TObj&)frz; return d.getTObjPtr(); } inline TPtr(const TPtr& t) { *this = t; } inline TPtr& operator= (const TPtr& t) { ; if (t.d.isNull()) { ; d = __null; ; } else { {if (!(t.d().cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "t.d().cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4766); ((int*)0)[0]=0;}}; if (!Freezer::isOn() || t.d.isGlobal()) { ; d = t.d.getTObjPtr(); ; } else { ; d = t.d().ownerCopy(); ; } } return *this; } inline operator type* () { if (d.isNull()) return __null; d.localize(); return &d()()(); } inline operator bool () const { return d.notNull(); } inline type* operator->() { type *p = (type*)*this; if (p == __null) do { { VizStr msgstr("\nNULL TPtr dereference (operator ->)\n"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); return p; } inline void drop() { {if (!(!Freezer::isOn())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!Freezer::isOn()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4792); ((int*)0)[0]=0;}}; {if (!(d().cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d().cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4793); ((int*)0)[0]=0;}}; d.drop(); } inline TObj& operator* () { d.localize(); return d(); } inline const TObj& operator* () const { d.localize(); return d(); } inline const bool operator == (TPtr& t) const { return d == t.d; } inline const bool operator != (TPtr& t) const { return d != t.d; } }; # 4816 "../../opentss/trt" template class TVar { protected: TDsc d; public: inline TObj& operator()() { d.localize(); return d(); } public: inline TVar() : d(new TObj) { ; {if (!(d().cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d().cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4831); ((int*)0)[0]=0;}}; } inline TVar(type v) : d(new TObj) { ; {if (!(!Freezer::isOn())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!Freezer::isOn()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4835); ((int*)0)[0]=0;}}; d()()() = v; {if (!(d().cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d().cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4837); ((int*)0)[0]=0;}}; } inline TVar& operator= (const type& v) { {if (!(!Freezer::isOn())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!Freezer::isOn()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4840); ((int*)0)[0]=0;}}; (*this)() = v; {if (!(d().cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d().cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4842); ((int*)0)[0]=0;}}; return *this; } inline TVar(TObj& t) : d(new TObj) { ; {if (!(!Freezer::isOn())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!Freezer::isOn()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4847); ((int*)0)[0]=0;}}; d() = t; {if (!(d().cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d().cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4852); ((int*)0)[0]=0;}}; } inline TVar(const TVar& v) : d(__null) { ; if (v.d.isGlobal()) { d = v.d; } else { d = new TObj; *this = v; } if (Freezer::isOn()) {if (!(d.isGlobal())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d.isGlobal()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4863); ((int*)0)[0]=0;}}; {if (!(d().cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d().cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4864); ((int*)0)[0]=0;}}; } # 4882 "../../opentss/trt" inline TVar& operator= (TObj& to) { ; TObj& t = (*this)(); if (!Freezer::isOn()) { t = to; ; } else { d = to.ownerCopy(); {if (!(d.isGlobal())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d.isGlobal()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4894); ((int*)0)[0]=0;}}; # 4906 "../../opentss/trt" } {if (!(d().cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d().cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4907); ((int*)0)[0]=0;}}; return *this; } inline TVar& operator= (const TVar& v) { {if (!(v.d().cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "v.d().cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4911); ((int*)0)[0]=0;}}; return (*this) = v.d(); } inline TVar(const TFrz& frz) : d(__null) { {if (!(!Freezer::isOn())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!Freezer::isOn()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4916); ((int*)0)[0]=0;}}; d = &((TFrz&)frz)(); {if (!(d().cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d().cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4918); ((int*)0)[0]=0;}}; } inline TVar& operator= (TFrz frz) { {if (!(!Freezer::isOn())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!Freezer::isOn()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4928); ((int*)0)[0]=0;}}; if (Freezer::isOn()) { d = &frz(); {if (!(d.isGlobal())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d.isGlobal()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4931); ((int*)0)[0]=0;}}; } else { (*this)() = new TDataNotReady (frz()); } return *this; } inline void drop() { {if (!(!Freezer::isOn())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!Freezer::isOn()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4942); ((int*)0)[0]=0;}}; {if (!(d().cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "d().cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4943); ((int*)0)[0]=0;}}; d.drop(); } inline TVar* ampersand() const { return (TVar*)this; } inline TObj* operator& () { return &(*this)(); } inline operator type& () { return (*this)()()(); } inline type& operator += (type n) { return (*this)()()() += n; } inline type& operator -= (type n) { return (*this)()()() -= n; } inline type& operator ++ () { return ++(*this)()()(); } inline type& operator -- () { return --(*this)()()(); } inline type operator ++ (int) { return (*this)()()()++; } inline type operator -- (int) { return (*this)()()()--; } inline type operator+ (TObj& t) { return (*this)()()() + t()(); } inline type operator- (TObj& t) { return (*this)()()() - t()(); } inline type operator* (TObj& t) { return (*this)()()() * t()(); } inline type operator/ (TObj& t) { return (*this)()()() / t()(); } inline type operator+ (type t) { return (*this)()()() + t; } inline type operator- (type t) { return (*this)()()() - t; } inline type operator* (type t) { return (*this)()()() * t; } inline type operator/ (type t) { return (*this)()()() / t; } inline operator TObj& () { return (*this)(); } }; extern ThreadLocal toutChain; class toutChainReset { public: toutChainReset() { toutChain() = 0; } }; template class TOut : public TVar { long nextOffset; char sign; public: inline TOut* next() { TOut* res = (TOut*) (nextOffset+(long)this); {if (!(res->sign == 'o')) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "res->sign == 'o'" ,__PRETTY_FUNCTION__,"../../opentss/trt",4977); ((int*)0)[0]=0;}}; return res; } TOut() : nextOffset(0), sign('o') { ; if (!toutChain()) toutChain() = (long)this; else { nextOffset = (long)((TOut*)toutChain())->next() - (long)this; ((TOut*)toutChain())->nextOffset = (long)this - toutChain(); } } const char * info() const { String str; str.printf("TOut %s",(*(TOut*)this)().info()); return str.close(); } void pack() { TObj *to = &(*this)(); {if (!(to->cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "to->cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",4996); ((int*)0)[0]=0;}}; this->d = to->dth; } void unpack(long long taskId) { TObj *to = new TObj(false); to->setOwner(taskId); if (this->d.notNull()) { TObj *dropTo = this->d.getTObjPtr(); ; dropTo->setOwner(taskId); {if (!(dropTo->cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "dropTo->cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",5015); ((int*)0)[0]=0;}}; to->dth = dropTo; } this->d = to; {if (!(to->cellIsOk())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "to->cellIsOk()" ,__PRETTY_FUNCTION__,"../../opentss/trt",5024); ((int*)0)[0]=0;}}; } TObj& operator= (TObj& to) { (*this)() = to; return (*this)(); } TObj& operator= (const type& v) { (*this)()()() = v; return (*this)(); } TObj& operator= (TFrz frz) { ; if (!frz.ok()) { do { { VizStr msgstr("TFun %s didn't return any value.\n" "It is a user bug. Dumping stack and exit...\n", Task::getCurrent()->context().name()); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); fault(); } (*this)() = frz(); return (*this)(); } }; # 5111 "../../opentss/trt" class TFunCtxt : public TaskCtxt { public: TFunCtxt(char *name) : TaskCtxt(name) {} }; template class TFun : public MThread, toutChainReset { private: long long parentTaskId; public: int tfunId; int fflags; TOut retval; TFrz retfrz; TFun() : parentTaskId(parent?parent->taskId:-1), fflags(tc().fflags), retfrz(retval) { ; if (parentTaskId >= 0) { do { if (ts::conf.generateCallGraph) { static char buf[0x100000]; char *p=buf, *e=buf+sizeof(buf)-1; p += snprintf(p,e-p,"\ncallGraph\t"); p += snprintf(p,e-p,"\tf%Lx -> f%Lx;\n", parent->taskId, taskId); p += snprintf(p,e-p,"\n"); fprintf(stderr, "%s\n", buf); } } while (0); } } TFunCtxt& context() { return ctxt; } virtual void packState() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",5139); ((int*)0)[0]=0;}}; Task::packState(); TOut* t = (TOut*)retval.ampersand(); do t->pack(); while ((t = t->next()) != retval.ampersand()); } virtual void unpackState() { {if (!(tsLocked())) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "tsLocked()" ,__PRETTY_FUNCTION__,"../../opentss/trt",5145); ((int*)0)[0]=0;}}; TOut* t = (TOut*)retval.ampersand(); do t->unpack(taskId); while ((t = t->next()) != retval.ampersand()); } const char *name() { char *p = demangle(typeid(*this).name()), *q; if ((q=strstr(p,"TFunImpl"))) *q = 0; if ((q=strstr(p,"ts::TFun"))) { if ((q = strstr(q,", ")) ) { p = q+2; if (( q = strstr(p,"TFun")) ) *q = 0; } } if (!strcmp(p,"tfunmain")) p += 4; return p; } const char* toutInfo () { String str; TOut* t = (TOut*)retval.ampersand(); do str.printf("%s\n",t->info()); while ((t = t->next()) != retval.ampersand()); return str.close(); } # 5219 "../../opentss/trt" static TFun* tryToReuseMemo(TFun* tf, void* key, size_t keySize) { if (tc().memoize) { # 5252 "../../opentss/trt" static int warnCnt = 0; if (!warnCnt++) do { { VizStr msgstr("WARN: memoization is not supported; please enable it in tssconfig.h\n"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); } return tf; } virtual void work() { static char * clr[] = {"yellow", "red", "green", "blue", "magenta", "cyan"}; const int clrQty = sizeof(clr)/sizeof(clr[0]); try { ; ; { ; retval = body(); } do { if (ts::conf.generateCallGraph) { static char buf[0x100000]; char *p=buf, *e=buf+sizeof(buf)-1; p += snprintf(p,e-p,"\ncallGraph\t"); p += snprintf(p,e-p,"\tf%Lx [label=\"%s %s\",style=\"filled\",fillcolor=\"%s\"];\n", taskId, name(), this->getLabel(), clr[myRank%clrQty]); p += snprintf(p,e-p,"\n"); fprintf(stderr, "%s\n", buf); } } while (0); } catch (FinalizeException e) { ; } ; } inline void stopAndContParent() { setCurrent(parent); ; parent = __null; if (!(1 & fflags)) run(); } virtual TFrz body() = 0; virtual ~TFun() { ; } }; class ParentTemporaryOn { Task *task; public: ParentTemporaryOn(Task *_task) : task(_task) { Task::setCurrent(task->parent); } ~ParentTemporaryOn() { Task::setCurrent(task); } }; void sleep(double sec=0.); class DefaultExceptionHandler { public: static void unexpectedException() { fprintf(stderr, "%s: may be some 'try {} catch()' missed?\n", __FUNCTION__); fprintf(stderr, "%s: terminating program execution\n", __FUNCTION__); exit(1); } void (*savedHandler)(); DefaultExceptionHandler() { savedHandler = std::set_unexpected(unexpectedException); } ~DefaultExceptionHandler() { std::set_unexpected(savedHandler); } }; class TRT : public CmdLine, DefaultExceptionHandler { public: static TRT *trt; MacroScheduler *ms; TRT(int* argc, char *** argv) : CmdLine(argc,argv), ms(MacroScheduler::New()) { {if (!(!trt)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!trt" ,__PRETTY_FUNCTION__,"../../opentss/trt",5317); ((int*)0)[0]=0;}}; trt = this ; atexit(atExit); Feature::initialize(); ; if (conf.enableAsync) (*mpi_portal->_DMPI_Async_init)(); trt->ms->exchangeByResources(); } static void atExit() { ; if (!Service::exitFlag()) { Task::setCurrent(&systemRootTask()); (*mpi_portal->_DMPI_Async_disable)(); if(!trt) return; trt->ms->tb.relaxData() = 1; trt->ms->tb.relaxCell().write(); trt->ms->setStatistic(); ; } } ~TRT() { tseg().finalize(); delete ms; trt = __null; } }; class MainTRT { public: MainTRT() { do { { VizStr msgstr("Open T-System Runtime v3.0, 2003-2004, PSI RAS, Russia.\n"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); do { { VizStr msgstr("Running under %s MPI on %d-rank %scluster:\n ", mpi_portal->name, realsuperSize, dmpi_meta ? "meta":""); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); TRT::trt->ms->printClusterResources(); ; ; do { { VizStr msgstr("Starting tfun main, good luck!\n\n"); ui->write(((Color)((myRank%4)+Green)), msgstr.close()); } VizStr::rewind(); } while(0); ; } virtual ~MainTRT() { ; TRT::trt->ms->printStatistic(); ; ; ; ; } }; enum _sc_name { _SC_START = 0x1000, _SC_CL_RUN_DATE, _SC_CL_CPU_NAME, _SC_CL_CPU_FLOPS, _SC_NPROCESSORS_CONFIG, _SC_CL_SIZE, _SC_CL_CLUSTER_FLOPS, _SC_CL_MPI_RANK, _SC_CL_MPI_IMPL, _SC_CL_MPI_OPTIONS, _SC_CL_EMULATION, _SC_CL_NODE_NAME, _SC_CL_OS_VERSION, _SC_CL_L1_CACHE_SIZE, _SC_CL_L2_CACHE_SIZE, _SC_CT_GCC_VERSION, _SC_CT_OPTIONS, _SC_CT_DEBUG, _SC_CT_CHECK, _SC_CT_THREAD_IMPL, _SC_RT_TASK_BOARD, _SC_RT_CELLS, _SC_RT_FEATURES, _SC_RT_THREAD_POOL, _SC_RT_MEMORY_POOL, _SC_RT_PARALLEL, _SC_RT_PROFILE, _SC_RT_TRACE, _SC_RT_DEBUG, _SC_ENV_STACK_SIZE, _SC_ENV_THREAD_PRIO, _SC_ENV_PTR_MODE, _SC_ENV_MEASURE, _SC_ENV_VERBOSE, _SC_SUMMARY }; # 5487 "../../opentss/trt" long sysconf(int name); extern TFrz mainResult; } # 5506 "../../opentss/trt" extern ts::TFunCtxt tfunmainTFunCtxt; struct tfunmainTArgDef { int argc; char **argv; ts::TFunCtxt* _fid; }; struct tfunmainTFunDef: public ts::TFun, tfunmainTArgDef { virtual ts::TFrz body() = 0; static tfunmainTFunDef* New(); }; int tfunmainCversion (int argc, char *argv[]); static inline ts::TFrz tfunmain (int argc, char *argv[]) { ts::TSLocker _l; ; tfunmainTFunDef *_tf = tfunmainTFunDef::New(); _tf->argc=argc; _tf->argv=argv ; _tf->stopAndContParent(); _tf = (tfunmainTFunDef*)tfunmainTFunDef::tryToReuseMemo(_tf,(tfunmainTArgDef*)_tf,sizeof(tfunmainTArgDef)); return _tf->retfrz; } int main(int argc, char *argv[]) __attribute__ ((weak)); # 2 "" 2 # 1 "lazy.cpp" # 1 "trf/trf_core.hpp" 1 class Expr; typedef enum { typeInt=0, typeChar, typeFloat, typeExpr, typeUninit } TypeOfTerm; # 1 "trf/trf_term.hpp" 1 class Term { public: TypeOfTerm type; Term():type(typeUninit) {}; Term(Term& rhs) { (*this)=rhs; } inline Term(const int i) : subexpr(__null) {setInt(i);} inline Term(const char c) {setChar(c);} inline Term(const float f) {setFloat(f);} inline Term(ts::TPtr expr) {setExpr(expr);} inline void setInt(const int i) { ival=i; type=typeInt; } inline void setChar(const char c) { cval=c; type=typeChar; } inline void setFloat(const float f) { fval=f; type=typeFloat; } inline void setExpr(ts::TPtr expr) { subexpr=expr; type=typeExpr; } inline int getInt () { {if (!(type==typeInt)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "type==typeInt" ,__PRETTY_FUNCTION__,"trf/trf_term.hpp",27); ((int*)0)[0]=0;}}; return ival; } inline char getChar () { {if (!(type==typeChar)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "type==typeChar" ,__PRETTY_FUNCTION__,"trf/trf_term.hpp",33); ((int*)0)[0]=0;}}; return cval; } inline float getFloat() { {if (!(type==typeFloat)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "type==typeFloat" ,__PRETTY_FUNCTION__,"trf/trf_term.hpp",38); ((int*)0)[0]=0;}}; return fval; } ts::TPtr getExpr() { {if (!(type==typeExpr)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "type==typeExpr" ,__PRETTY_FUNCTION__,"trf/trf_term.hpp",43); ((int*)0)[0]=0;}}; return subexpr; } Term& operator=(const Term& rhs) { type= rhs.type; ival = rhs.ival; cval=rhs.cval; fval=rhs.fval; if ( type == typeExpr ) subexpr=rhs.subexpr; return *this; } protected: int ival; char cval; float fval; ts::TPtr subexpr; }; # 12 "trf/trf_core.hpp" 2 # 1 "trf/trf_expr.hpp" 1 # 1 "trf/trf_tarr.hpp" 1 template class TArr : public ts::TExtData { bool isMobile; Type *data; public: TArr() : isMobile(false), data(__null) {} void TArr::clear() { if (!isMobile && data) free(data); } Type* getData() { return isMobile ? (Type*)extData() : data; } operator Type* () { return getData(); } operator const Type* () const { return ((TArr*)this)->getData(); } Type* alloc (long size){ {if (!(!isMobile)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "!isMobile" ,__PRETTY_FUNCTION__,"trf/trf_tarr.hpp",17); ((int*)0)[0]=0;}}; clear(); data = (Type*)malloc(sizeof(Type)*size); extDataSize() = size * sizeof(Type); return getData(); } uint getSize(){ return extDataSize()/sizeof(Type); } TArr (const TArr& ts) : isMobile(true) { TArr &s = (TArr&)ts; if ((data = s) != __null){ for (uint i=0; i > my_chunk; chunk = &my_chunk; } public: ts::TPtr< TArr > chunk; Expr::Expr () {create_chunk();} Expr::Expr (int num){ create_chunk(); Term *terms; Term aa(num); terms = chunk->alloc(1); terms[0] = aa; } Expr::Expr (Expr exp, uint index){ printf("Construct sub_expr\n"); {if (!(exp.get_len() >= index)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "exp.get_len() >= index" ,__PRETTY_FUNCTION__,"trf/trf_expr.hpp",40); ((int*)0)[0]=0;}}; uint len = exp.get_len() - index; create_chunk(); Term *terms; terms = chunk->alloc(len); for (uint i=0; igetData()[i + index]; } } Expr::Expr (Expr exp, uint index, uint length){ printf("Construct sub_expr2\n"); {if (!(exp.get_len() >= index + length)) {fprintf(stderr, "[%d] Assertion '%s' failed at '%s' %s:%d\n", ts::myRank, "exp.get_len() >= index + length" ,__PRETTY_FUNCTION__,"trf/trf_expr.hpp",56); ((int*)0)[0]=0;}}; create_chunk(); Term *terms; terms = chunk->alloc(length); for (uint i=0; igetData()[i + index]; } } Expr::Expr (const Expr& exp) : chunk(exp.chunk) {} Expr (ts::TPtr expr){ Term trm(expr); create_chunk(); Term *terms; terms = chunk->alloc(1); terms[0] = trm; } inline uint get_len(){ return chunk->getSize(); } inline Term elementAt(uint i){ return chunk->getData()[i]; } inline bool symbol_at(uint index){ return (chunk->getData()[index].type != typeExpr); } inline bool is_flat(){ uint len = get_len(); for (uint i; igetData()[i].type == typeExpr) return false; } return true; } inline bool is_empty() { return (this->get_len() == 0);} void Expr::print(){ uint len = this->get_len(); printf("Expr: size = %d val = ", len); Term cur_trm; for (uint i=0; igetData()[i]; switch (cur_trm.type){ case typeInt : printf("[%d]", cur_trm.getInt()); break; case typeChar: printf("[%c]", cur_trm.getChar()); break; case typeFloat: printf("[%f]", cur_trm.getFloat()); break; case typeExpr: printf("\033[%um\033[%um", 1, 36); printf("("); printf("\033[%um",0); cur_trm.getExpr()->print(); printf("\033[%um\033[%um", 1, 36); printf(")"); printf("\033[%um",0); break; case typeUninit: printf("[uninit]"); break; } } } void dump(){ this->print(); printf("\n"); } static Expr parentheses (ts::TPtr in) { Expr res(in); return res; }; static Expr concatenate (Expr exp1, Expr exp2){ Expr res; Term *terms; terms = res.chunk->alloc(exp1.get_len() + exp2.get_len()); uint gi=0; for (uint i=0; i& res), (n , res), /*static*/, int n ;, { ts::Freezer _f; ts::ParentTemporaryOn _p(_tf); _tf->n = n; } ; ts::TFrz< Expr > __res(_tf->res) ;, ts::TOut < Expr > res ;, res = __res() ;) TFUNIMPL(int, fib, (int n , ts::TObj < Expr >& res), (n , res), /*static*/, int n ;, { ts::Freezer _f; ts::ParentTemporaryOn _p(_tf); _tf->n = n; } ; ts::TFrz< Expr > __res(_tf->res) ;, ts::TOut < Expr > res ;, res = __res() ;) # 13 "lazy.cpp" { if (n <= 1){ tval # 12349 "lazy.ii" ts::TVar < Expr > # 15 "lazy.cpp" res_exp(n); res = (Expr&)res_exp; } else{ tval # 12357 "lazy.ii" ts::TVar < Expr > # 19 "lazy.cpp" res1, res2; fib(n-1, res1); fib(n-2, res2); tval # 12364 "lazy.ii" ts::TVar < Expr > # 22 "lazy.cpp" res_exp; res_exp = Arithm::_p_(res1, res2); res = (Expr&)res_exp; } return 0; } # 12374 "lazy.ii" # 29 "lazy.cpp" # 12378 "lazy.ii" # 29 "lazy.cpp" # 12382 "lazy.ii" TFUNDEF(int, make, (int n , ts::TObj < Expr >& res), (n , res), /*static*/, int n ;, { ts::Freezer _f; ts::ParentTemporaryOn _p(_tf); _tf->n = n; } ; ts::TFrz< Expr > __res(_tf->res) ;, ts::TOut < Expr > res ;, res = __res() ;) TFUNIMPL(int, make, (int n , ts::TObj < Expr >& res), (n , res), /*static*/, int n ;, { ts::Freezer _f; ts::ParentTemporaryOn _p(_tf); _tf->n = n; } ; ts::TFrz< Expr > __res(_tf->res) ;, ts::TOut < Expr > res ;, res = __res() ;) # 29 "lazy.cpp" { tval # 12387 "lazy.ii" ts::TVar < Expr > # 30 "lazy.cpp" exp(n); if (n == 1){ tval # 12393 "lazy.ii" ts::TVar < Expr > # 32 "lazy.cpp" res_exp(1); res = (Expr&)res_exp; } else{ tval # 12402 "lazy.ii" ts::TVar < Expr > # 37 "lazy.cpp" res_exp; tval # 12407 "lazy.ii" ts::TVar < Expr > # 38 "lazy.cpp" exp_n(n); tval # 12412 "lazy.ii" ts::TVar < Expr > # 39 "lazy.cpp" local, res_local; fib(n, res_local); tval # 12420 "lazy.ii" ts::TVar < Expr > # 43 "lazy.cpp" tmp; local = Expr::concatenate((Expr&)exp_n, res_local); make(n-1, res_exp); tval # 12431 "lazy.ii" ts::TVar < Expr > # 50 "lazy.cpp" sum; sum = Expr::concatenate((Expr&)local, (Expr&)res_exp); res = (Expr&)sum; } return 0; } # 12443 "lazy.ii" # 59 "lazy.cpp" # 12447 "lazy.ii" # 59 "lazy.cpp" # 12451 "lazy.ii" TFUNIMPL(int, tfunmain, (int argc , char * * argv), (argc , argv), /*static*/, int argc ; char * * argv ;, { ts::Freezer _f; ts::ParentTemporaryOn _p(_tf); _tf->argc = argc; } ; { ts::Freezer _f; ts::ParentTemporaryOn _p(_tf); _tf->argv = argv; } ;, , ) # 59 "lazy.cpp" { tval # 12456 "lazy.ii" ts::TVar < Expr > # 60 "lazy.cpp" res; make(21, res); ((Expr&)res).dump(); return 0; } # 12468 "lazy.ii"