My Project
Loading...
Searching...
No Matches
mod2.h File Reference
#include "singularconfig.h"
#include "misc/auxiliary.h"

Go to the source code of this file.

Macros

#define SINGULAR_MAJOR_VERSION   4
 
#define SINGULAR_MINOR_VERSION   4
 
#define SINGULAR_SUB_VERSION   0
 
#define SINGULAR_PATCHLEVEL   2
 
#define S_ROOT_DIR   ""
 
#define HAVE_GETTIMEOFDAY   1
 
#define TIME_WITH_SYS_TIME   1
 
#define HAVE_SYS_TIME_H   1
 
#define TIMER_RESOLUTION   1
 
#define SIQ   1
 
#define FAST_AND_DIRTY
 
#define HAVE_EIGENVAL   1
 
#define HAVE_GMS   1
 
#define HAVE_SIMPLEIPC   1
 
#define HAVE_PCV   1
 
#define HAVE_UNITS
 
#define HAVE_LIBPARSER
 
#define HAVE_VSPACE   1
 
#define PROFILER
 
#define HAVE_SPECTRUM   1
 
#define SINGULAR_VERSION   ((SINGULAR_MAJOR_VERSION*10000 + SINGULAR_MINOR_VERSION*1000 + SINGULAR_SUB_VERSION*100)+SINGULAR_PATCHLEVEL)
 
#define YYLPDEBUG   1
 
#define SEEK_END   2
 
#define SEEK_SET   0
 
#define LINKAGE
 
#define NO_INLINE
 
#define MDEBUG   0
 
#define OM_TRACK   4
 
#define OM_CHECK   1
 
#define OM_KEEP   0
 
#define OM_SING_KEEP   1000
 
#define KDEBUG   0
 
#define LDEBUG
 
#define RDEBUG
 
#define TEST
 
#define YYDEBUG   1
 
#define assume_violation(s, f, l)    dReportError("assume violation at %s:%d condition: %s", f,l,s)
 
#define assume(x)   _assume(x, __FILE__, __LINE__)
 
#define r_assume(x)   _r_assume(x, __FILE__, __LINE__)
 
#define _assume(x, f, l)
 
#define _r_assume(x, f, l)
 
#define __attribute__(x)   /*NOTHING*/
 
#define STRINGIFY(name)   #name
 
#define EXPANDED_STRINGIFY(name)   STRINGIFY(name)
 

Functions

void m2_end (int i)
 
static void HALT (void)
 
int dReportError (const char *fmt,...)
 
void dErrorBreak (void)
 

Macro Definition Documentation

◆ __attribute__

#define __attribute__ ( x)    /*NOTHING*/

Definition at line 427 of file mod2.h.

◆ _assume

#define _assume ( x,
f,
l )
Value:
do \
{ \
if (! (x)) \
{ \
assume_violation(#x, f, l); \
} \
} \
while (0)
int l
Definition cfEzgcd.cc:100
Variable x
Definition cfModGcd.cc:4090
FILE * f
Definition checklibs.c:9

Definition at line 390 of file mod2.h.

390#define _assume(x, f, l) \
391do \
392{ \
393 if (! (x)) \
394 { \
395 assume_violation(#x, f, l); \
396 } \
397} \
398while (0)

◆ _r_assume

#define _r_assume ( x,
f,
l )
Value:
do \
{ \
if (! (x)) \
{ \
assume_violation(#x, f, l); \
return 0; \
} \
} \
while (0)

Definition at line 400 of file mod2.h.

400#define _r_assume(x, f, l) \
401do \
402{ \
403 if (! (x)) \
404 { \
405 assume_violation(#x, f, l); \
406 return 0; \
407 } \
408} \
409while (0)

◆ assume

#define assume ( x)    _assume(x, __FILE__, __LINE__)

Definition at line 387 of file mod2.h.

◆ assume_violation

#define assume_violation ( s,
f,
l )    dReportError("assume violation at %s:%d condition: %s", f,l,s)

Definition at line 384 of file mod2.h.

384#define assume_violation(s,f,l) \
385 dReportError("assume violation at %s:%d condition: %s", f,l,s)

◆ EXPANDED_STRINGIFY

#define EXPANDED_STRINGIFY ( name)    STRINGIFY(name)

Definition at line 431 of file mod2.h.

◆ FAST_AND_DIRTY

#define FAST_AND_DIRTY

Definition at line 41 of file mod2.h.

◆ HAVE_EIGENVAL

#define HAVE_EIGENVAL   1

Definition at line 44 of file mod2.h.

◆ HAVE_GETTIMEOFDAY

#define HAVE_GETTIMEOFDAY   1

Definition at line 30 of file mod2.h.

◆ HAVE_GMS

#define HAVE_GMS   1

Definition at line 47 of file mod2.h.

◆ HAVE_LIBPARSER

#define HAVE_LIBPARSER

Definition at line 60 of file mod2.h.

◆ HAVE_PCV

#define HAVE_PCV   1

Definition at line 54 of file mod2.h.

◆ HAVE_SIMPLEIPC

#define HAVE_SIMPLEIPC   1

Definition at line 50 of file mod2.h.

◆ HAVE_SPECTRUM

#define HAVE_SPECTRUM   1

Definition at line 78 of file mod2.h.

◆ HAVE_SYS_TIME_H

#define HAVE_SYS_TIME_H   1

Definition at line 32 of file mod2.h.

◆ HAVE_UNITS

#define HAVE_UNITS

Definition at line 57 of file mod2.h.

◆ HAVE_VSPACE

#define HAVE_VSPACE   1

Definition at line 64 of file mod2.h.

◆ KDEBUG

#define KDEBUG   0

Definition at line 302 of file mod2.h.

◆ LDEBUG

#define LDEBUG

Definition at line 305 of file mod2.h.

◆ LINKAGE

#define LINKAGE

Definition at line 138 of file mod2.h.

◆ MDEBUG

#define MDEBUG   0

Definition at line 178 of file mod2.h.

◆ NO_INLINE

#define NO_INLINE

Definition at line 151 of file mod2.h.

◆ OM_CHECK

#define OM_CHECK   1

Definition at line 276 of file mod2.h.

◆ OM_KEEP

#define OM_KEEP   0

Definition at line 282 of file mod2.h.

◆ OM_SING_KEEP

#define OM_SING_KEEP   1000

Definition at line 288 of file mod2.h.

◆ OM_TRACK

#define OM_TRACK   4

Definition at line 272 of file mod2.h.

◆ PROFILER

#define PROFILER

Definition at line 71 of file mod2.h.

◆ r_assume

#define r_assume ( x)    _r_assume(x, __FILE__, __LINE__)

Definition at line 388 of file mod2.h.

◆ RDEBUG

#define RDEBUG

Definition at line 307 of file mod2.h.

◆ S_ROOT_DIR

#define S_ROOT_DIR   ""

Definition at line 23 of file mod2.h.

◆ SEEK_END

#define SEEK_END   2

Definition at line 109 of file mod2.h.

◆ SEEK_SET

#define SEEK_SET   0

Definition at line 113 of file mod2.h.

◆ SINGULAR_MAJOR_VERSION

#define SINGULAR_MAJOR_VERSION   4

Definition at line 19 of file mod2.h.

◆ SINGULAR_MINOR_VERSION

#define SINGULAR_MINOR_VERSION   4

Definition at line 20 of file mod2.h.

◆ SINGULAR_PATCHLEVEL

#define SINGULAR_PATCHLEVEL   2

Definition at line 22 of file mod2.h.

◆ SINGULAR_SUB_VERSION

#define SINGULAR_SUB_VERSION   0

Definition at line 21 of file mod2.h.

◆ SINGULAR_VERSION

#define SINGULAR_VERSION   ((SINGULAR_MAJOR_VERSION*10000 + SINGULAR_MINOR_VERSION*1000 + SINGULAR_SUB_VERSION*100)+SINGULAR_PATCHLEVEL)

Definition at line 85 of file mod2.h.

◆ SIQ

#define SIQ   1

Definition at line 38 of file mod2.h.

◆ STRINGIFY

#define STRINGIFY ( name)    #name

Definition at line 430 of file mod2.h.

◆ TEST

#define TEST

Definition at line 309 of file mod2.h.

◆ TIME_WITH_SYS_TIME

#define TIME_WITH_SYS_TIME   1

Definition at line 31 of file mod2.h.

◆ TIMER_RESOLUTION

#define TIMER_RESOLUTION   1

Definition at line 35 of file mod2.h.

◆ YYDEBUG

#define YYDEBUG   1

Definition at line 314 of file mod2.h.

◆ YYLPDEBUG

#define YYLPDEBUG   1

Definition at line 93 of file mod2.h.

Function Documentation

◆ dErrorBreak()

void dErrorBreak ( void )
extern

Definition at line 140 of file dError.cc.

141{}

◆ dReportError()

int dReportError ( const char * fmt,
... )
extern

Definition at line 44 of file dError.cc.

45{
46#if 0
47#ifdef HAVE_EXECINFO_H
48#define SIZE 50
49 void *buffer[SIZE+1]; int ret;
50#endif
51#endif
52
53 va_list ap;
54 va_start(ap, fmt);
55#ifndef MAKE_DISTRIBUTION
56 fprintf(stderr, "\n// ***dError: ");
57 vfprintf(stderr, fmt, ap);
58#if !defined(OM_NDEBUG)
59 #ifdef omPrintCurrentBackTraceMax
60 fprintf(stderr, " occurred at: \n");
62 #endif
63#endif
64
65#if 0
66#ifdef HAVE_EXECINFO_H
67 ret = backtrace( buffer, SIZE ); // execinfo.h
68 fprintf(stderr, "\nExecinfo backtrace (with %zd stack frames): \n", ret);
69
70#ifndef HAVE_GCC_ABI_DEMANGLE
71 backtrace_symbols_fd(buffer, ret, STDERR_FILENO); // execinfo.h
72#else
73 char **ptr = backtrace_symbols( buffer, ret ); // execinfo.h
74
75 int status;
76 char *demangledName;
77 char *s;
78 char *ss;
79 for (int i = 0; i < ret; i++)
80 {
81 status = -1;
82
83 s = ptr[i];
84// fprintf (stderr, " #%02d: %s\n", i, s);
85
86 ss = index(s, '(');
87 ss[0] = 0;
88 fprintf (stderr, " #%02d: '%s': ", i, s);
89 ss[0] = '('; s = ss + 1;
90
91 ss = index(s, '+');
92
93 if ( ss != NULL )
94 {
95 ss[0] = 0;
96 demangledName = abi::__cxa_demangle( s, NULL, NULL, &status ); // cxxabi.h!
97 if( status == 0 && demangledName != NULL )
98 fprintf (stderr, " '%s'", (demangledName[0] != 0)? demangledName: s);
99 else
100 fprintf (stderr, " '%s'", s);
101
102 malloc_free( demangledName );
103 ss[0] = '+';
104 s = ss + 1;
105 }
106
107 ss = index(s, ')');
108 if( s != ss)
109 {
110 ss[0] = 0;
111 fprintf (stderr, " + %s", s);
112 ss[0] = ')';
113 }
114
115 fprintf (stderr, " %s\n", ss + 2);
116 }
117 malloc_free (ptr);
118#endif
119#endif
120
121#undef SIZE
122#endif
123
124 dErrorBreak();
125#else
126 fprintf(stderr, "\n// !!! YOU HAVE FOUND A BUG IN SINGULAR.");
127 fprintf(stderr, "// !!! Please, email the input\n// and the following error message to singular@mathematik.uni-kl.de");
128 vfprintf(stderr, fmt, ap);
129#endif
130 return 0;
131}
int i
Definition cfEzgcd.cc:132
static void malloc_free(void *ptr)
Definition dError.cc:23
void dErrorBreak()
Definition dError.cc:140
const CanonicalForm int s
Definition facAbsFact.cc:51
Definition ap.h:40
#define NULL
Definition omList.c:12
static int index(p_Length length, p_Ord ord)
int * status
Definition si_signals.h:61
#define omPrintCurrentBackTraceMax(A, B)
Definition xalloc.h:265

◆ HALT()

static void HALT ( void )
inlinestatic

Definition at line 124 of file mod2.h.

124{ m2_end(2);}
void m2_end(int i)
Definition misc_ip.cc:1100

◆ m2_end()

void m2_end ( int i)

Definition at line 1100 of file misc_ip.cc.

1101{
1102 if (!m2_end_called)
1103 {
1105 EXTERN_VAR FILE* File_Log;
1108 if (File_Log!=NULL)
1109 {
1110 fclose(File_Log);
1111 File_Log=NULL;
1112 if (File_Log_written==FALSE) // remove empty logs
1113 {
1114 int pid=getpid();
1115 char buf[20];
1116 snprintf(buf,20,"/tmp/sing_log.%d",pid);
1117 remove(buf);
1118 }
1119 }
1121#ifdef HAVE_SIMPLEIPC
1122 for (int j = SIPC_MAX_SEMAPHORES-1; j >= 0; j--)
1123 {
1124 if (semaphore[j] != NULL)
1125 {
1126 while (sem_acquired[j] > 0)
1127 {
1128#if PORTABLE_SEMAPHORES
1129 sem_post(semaphore[j]->sig);
1130#else
1131 sem_post(semaphore[j]);
1132#endif
1133 sem_acquired[j]--;
1134 }
1135 }
1136 }
1137#endif // HAVE_SIMPLEIPC
1138 monitor(NULL,0);
1139#ifdef PAGE_TEST
1140 mmEndStat();
1141#endif
1144 {
1146 while(hh!=NULL)
1147 {
1148 //Print("close %s\n",hh->l->name);
1149 slPrepClose(hh->l);
1150 hh=(link_list)hh->next;
1151 }
1153
1154 idhdl h = currPack->idroot;
1155 while(h != NULL)
1156 {
1157 if(IDTYP(h) == LINK_CMD)
1158 {
1159 idhdl hh=h->next;
1160 //Print("kill %s\n",IDID(h));
1161 killhdl(h, currPack);
1162 h = hh;
1163 }
1164 else
1165 {
1166 h = h->next;
1167 }
1168 }
1169 hh=ssiToBeClosed;
1170 while(hh!=NULL)
1171 {
1172 //Print("close %s\n",hh->l->name);
1173 slClose(hh->l);
1174 hh=ssiToBeClosed;
1175 }
1176 }
1178 {
1179 if (i<=0)
1180 {
1181 //extern long all_farey;
1182 //extern long farey_cnt;
1183 //if (all_farey!=0L) printf("farey:%ld, cnt=%ld\n",all_farey,farey_cnt);
1184 if (TEST_V_QUIET)
1185 {
1186 if (i==0)
1187 printf("Auf Wiedersehen.\n");
1188 else
1189 printf("\n$Bye.\n");
1190 }
1191 //#ifdef sun
1192 // #ifndef __svr4__
1193 // _cleanup();
1194 // _exit(0);
1195 // #endif
1196 //#endif
1197 i=0;
1198 }
1199 else
1200 {
1201 printf("\nhalt %d\n",i);
1202 }
1203 }
1204 exit(i);
1205 }
1206}
int BOOLEAN
Definition auxiliary.h:87
#define TRUE
Definition auxiliary.h:100
#define FALSE
Definition auxiliary.h:96
Definition idrec.h:35
VAR BOOLEAN singular_in_batchmode
Definition cntrlc.cc:62
int j
Definition facHensel.cc:110
void monitor(void *F, int mode)
Definition febase.cc:68
void fe_reset_input_mode()
Definition fereadl.c:831
VAR FILE * File_Profiling
Definition fevoices.cc:32
VAR BOOLEAN File_Log_written
Definition fevoices.cc:34
VAR FILE * File_Log
Definition fevoices.cc:33
#define EXTERN_VAR
Definition globaldefs.h:6
VAR package currPack
Definition ipid.cc:57
void killhdl(idhdl h, package proot)
Definition ipid.cc:393
#define IDTYP(a)
Definition ipid.h:119
STATIC_VAR Poly * h
Definition janet.cc:971
volatile BOOLEAN m2_end_called
Definition misc_ip.cc:1098
#define TEST_V_QUIET
Definition options.h:133
VAR sipc_sem_t * semaphore[SIPC_MAX_SEMAPHORES]
Definition semaphore.c:24
VAR int sem_acquired[SIPC_MAX_SEMAPHORES]
Definition semaphore.c:25
int status int void * buf
Definition si_signals.h:69
#define SIPC_MAX_SEMAPHORES
Definition simpleipc.h:10
@ LINK_CMD
Definition tok.h:117