50 #define STRINGIFY(x) STRINGIFY__(x) 51 #define STRINGIFY__(x) #x 56 #if defined(WITHPTHREADS) 57 #define FORMNAME "TFORM" 58 #elif defined(WITHMPI) 59 #define FORMNAME "ParFORM" 61 #define FORMNAME "FORM" 71 #define REPO_VERSION STRINGIFY(REPO_MAJOR_VERSION) "." STRINGIFY(REPO_MINOR_VERSION) 75 #define REPO_DATE __DATE__ 78 #define VERSIONSTR FORMNAME " " REPO_VERSION " (" REPO_DATE ", " REPO_REVISION ")" 80 #define VERSIONSTR FORMNAME " " REPO_VERSION " (" REPO_DATE ")" 82 #define MAJORVERSION REPO_MAJOR_VERSION 83 #define MINORVERSION REPO_MINOR_VERSION 90 #define VERSIONSTR__ STRINGIFY(MAJORVERSION) "." STRINGIFY(MINORVERSION) "Beta" 92 #define VERSIONSTR__ STRINGIFY(MAJORVERSION) "." STRINGIFY(MINORVERSION) 94 #define VERSIONSTR FORMNAME " " VERSIONSTR__ " (" PRODUCTIONDATE ")" 107 static void PrintHeader(
int with_full_info)
110 if ( PF.me == MASTER && !AM.silent ) {
114 char buffer1[250], buffer2[80], *s = buffer1, *t = buffer2;
116 for ( n = 0; n < 250; n++ ) buffer1[n] =
' ';
121 if ( strlen(VERSIONSTR) <= 100 ) {
122 strcpy(s,VERSIONSTR);
123 s += strlen(VERSIONSTR);
130 strncpy(s,VERSIONSTR,97);
138 s += sprintf(s,
" %d-bits",(WORD)(
sizeof(WORD)*16));
142 if ( with_full_info ) {
143 #if defined(WITHPTHREADS) || defined(WITHMPI) 144 #if defined(WITHPTHREADS) 145 int nworkers = AM.totalnumberofthreads-1;
146 #elif defined(WITHMPI) 147 int nworkers = PF.numtasks-1;
149 s += sprintf(s,
" %d worker",nworkers);
152 if ( nworkers != 1 ) {
158 sprintf(t,
"Run: %s",MakeDate());
164 length = (s-buffer1) + (t-buffer2);
165 if ( length+2 <= AC.LineLength ) {
166 for ( n = AC.LineLength-length; n > 0; n-- ) *s++ =
' ';
186 if ( length <= AC.LineLength ) {
187 MesPrint(
"%s",buffer1);
190 WORD oldLineLength = AC.LineLength;
191 AC.LineLength = length;
192 MesPrint(
"%s",buffer1);
193 AC.LineLength = oldLineLength;
211 #ifdef WITHINTERACTION 212 static UBYTE deflogname[] =
"formsession.log";
215 #define TAKEPATH(x) if(s[1]== '=' ){x=s+2;} else{x=*argv++;argc--;} 217 int DoTail(
int argc, UBYTE **argv)
219 int errorflag = 0, onlyversion = 1;
226 AM.HoldFlag = AM.qError = AM.Interact = AM.FileOnlyFlag = 0;
227 AM.InputFileName = AM.LogFileName = AM.IncDir = AM.TempDir = AM.TempSortDir =
228 AM.SetupDir = AM.SetupFile = AM.Path = 0;
234 while ( argc >= 1 ) {
236 if ( *s ==
'-' || ( *s ==
'/' && ( argc > 0 || AM.Interact ) ) ) {
240 AM.qError = 1;
break;
242 TAKEPATH(AM.LogFileName) break;
245 t = copy = strDup1(*argv,"Dotail");
246 while ( *t && *t != '=' ) t++;
248 if (
PutPreVar(copy,(UBYTE *)
"1",0,0) < 0 )
return(-1);
252 if (
PutPreVar(copy,t,0,0) < 0 )
return(-1);
255 M_free(copy,
"-d prevar");
256 argv++; argc--;
break;
258 AM.FileOnlyFlag = 1; AM.LogType = 0;
break;
260 AM.FileOnlyFlag = 1; AM.LogType = 1;
break;
262 AM.HoldFlag = 1;
break;
263 #ifdef WITHINTERACTION 265 AM.Interact = 1;
break;
268 TAKEPATH(AM.IncDir) break;
270 if ( s[1] == 'l' ) AM.LogType = 1;
274 AM.LogType = 1; break;
282 while ( *s >= '0' && *s <= '9' )
283 threadnum = 10*threadnum + *s++ - '0';
286 if ( PF.me == MASTER )
288 printf(
"Illegal value for option m or w: %s\n",t);
295 AM.ggWTimeStatsFlag = 1;
302 #ifdef WITHEXTERNALCHANNEL 305 if( (s[2]==
'p')&&(s[3]==
'e')&&(s[4]==
'\0') ){
309 if(initPresetExternalChannels(*argv++,AX.timeout)<1){
311 if ( PF.me == MASTER )
313 printf(
"Error initializing preset external channels\n");
320 if ( PF.me == MASTER )
322 printf(
"Illegal option in call of FORM: %s\n",s);
328 if ( ( s[1]==
'i' ) && ( s[2] ==
'p' ) && (s[3] ==
'e' )
329 && ( s[4] ==
'\0' ) ){
331 if ( PF.me == MASTER )
333 printf(
"Illegal option: Pipes not supported on this system.\n");
337 if ( PF.me == MASTER )
339 printf(
"Illegal option: %s\n",s);
351 AM.silent = 1;
break;
353 AC.CheckpointFlag = -1;
356 if ( ( s[1] ==
'o' ) && ( s[2] ==
'r' ) && ( s[3] ==
't' ) ) {
358 AM.TempSortDir = s+5;
361 AM.TempSortDir = *argv++;
365 else if ( s[1] ==
'i' ) {
369 TAKEPATH(AM.SetupDir)
373 TAKEPATH(AM.SetupFile) break;
378 TAKEPATH(AM.TempSortDir)
385 AM.PrintTotalSize = 1;
break;
389 if ( PF.me == MASTER )
392 if ( onlyversion )
return(1);
395 AP.PreDebug = PREPROONLY;
break;
399 while ( *s >=
'0' && *s <=
'9' )
400 AM.TimeLimit = 10*AM.TimeLimit + *s++ -
'0';
403 AM.ClearStore = 1;
break;
407 if ( PF.me == MASTER )
408 printf(
"Sorry, reading STDIN as input is currently not supported by ParFORM\n");
415 if ( FG.cTable[*s] == 1 ) {
416 AM.SkipClears = 0; t = s;
417 while ( FG.cTable[*t] == 1 )
418 AM.SkipClears = 10*AM.SkipClears + *t++ -
'0';
421 if ( PF.me == MASTER )
423 printf(
"Illegal numerical option in call of FORM: %s\n",s);
429 if ( PF.me == MASTER )
431 printf(
"Illegal option in call of FORM: %s\n",s);
437 else if ( argc == 0 && !AM.Interact ) AM.InputFileName = argv[-1];
440 if ( PF.me == MASTER )
442 printf(
"Illegal option in call of FORM: %s\n",s);
446 AM.totalnumberofthreads = threadnum;
447 if ( AM.InputFileName ) {
448 if ( AM.FromStdin ) {
449 printf(
"STDIN and the input filename cannot be specified simultaneously\n");
452 s = AM.InputFileName;
454 if ( s < AM.InputFileName+4 ||
455 s[-4] !=
'.' || s[-3] !=
'f' || s[-2] !=
'r' || s[-1] !=
'm' ) {
456 t = (UBYTE *)Malloc1((s-AM.InputFileName)+5,
"adding .frm");
457 s = AM.InputFileName;
458 AM.InputFileName = t;
459 while ( *s ) *t++ = *s++;
460 *t++ =
'.'; *t++ =
'f'; *t++ =
'r'; *t++ =
'm'; *t = 0;
462 if ( AM.LogType >= 0 && AM.LogFileName == 0 ) {
463 AM.LogFileName = strDup1(AM.InputFileName,
"name of logfile");
466 s[-3] =
'l'; s[-2] =
'o'; s[-1] =
'g';
469 #ifdef WITHINTERACTION 470 else if ( AM.Interact ) {
471 if ( AM.LogType >= 0 ) {
476 AM.LogFileName = deflogname;
480 else if ( AM.FromStdin ) {
486 if ( PF.me == MASTER )
488 printf(
"No filename specified in call of FORM\n");
491 if ( AM.Path == 0 ) AM.Path = (UBYTE *)getenv(
"FORMPATH");
497 AM.Path = strDup1(AM.Path,
"DoTail Path");
512 int oldNoShowInput = AC.NoShowInput;
514 if ( !AM.Interact ) {
515 if ( AM.FromStdin ) {
516 if ( OpenStream(0,INPUTSTREAM,0,PRENOACTION) == 0 ) {
517 Error0(
"Cannot open STDIN");
522 if ( OpenStream(AM.InputFileName,FILESTREAM,0,PRENOACTION) == 0 ) {
523 Error1(
"Cannot open file",AM.InputFileName);
526 if ( AC.CurrentStream->inbuffer <= 0 ) {
527 Error1(
"No input in file",AM.InputFileName);
532 while ( AM.SkipClears > 0 ) {
534 if ( c == ENDOFINPUT ) {
535 Error0(
"Not enough .clear instructions in input file");
539 if ( c == ENDOFINPUT )
540 Error0(
"Not enough .clear instructions in input file");
543 if ( c ==
' ' || c ==
'\t' )
continue;
546 if ( tolower(c) ==
'c' ) {
548 if ( tolower(c) ==
'l' ) {
550 if ( tolower(c) ==
'e' ) {
552 if ( tolower(c) ==
'a' ) {
554 if ( tolower(c) ==
'r' ) {
556 if ( FG.cTable[c] > 2 ) {
564 while ( c !=
'\n' && c !=
'\r' && c != ENDOFINPUT ) {
566 if ( c ==
'\\' ) c = GetInput();
569 else if ( c ==
'\n' || c ==
'\r' )
continue;
571 while ( ( c = GetInput() ) !=
'\n' && c !=
'\r' ) {
572 if ( c == ENDOFINPUT ) {
573 Error0(
"Not enough .clear instructions in input file");
578 AC.NoShowInput = oldNoShowInput;
580 if ( AM.LogFileName ) {
582 if ( PF.me != MASTER ) {
587 extern FILES **filelist;
588 int i = CreateHandle();
589 RWLOCKW(AM.handlelock);
590 filelist[i] = (FILES *)123;
591 UNRWLOCK(AM.handlelock);
596 if ( AC.CheckpointFlag != -1 ) {
597 if ( ( AC.LogHandle = CreateLogFile((
char *)(AM.LogFileName)) ) < 0 ) {
598 Error1(
"Cannot create logfile",AM.LogFileName);
603 if ( ( AC.LogHandle = OpenAddFile((
char *)(AM.LogFileName)) ) < 0 ) {
604 Error1(
"Cannot re-open logfile",AM.LogFileName);
628 UBYTE *emptystring = (UBYTE *)
".";
629 UBYTE *defaulttempfilename = (UBYTE *)
"xformxxx.str";
631 VOID ReserveTempFiles(
int par)
635 UBYTE *s, *t, *tenddir, *tenddir2, c;
638 if ( par == 0 || par == 1 ) {
639 if ( AM.TempDir == 0 ) {
640 sp = GetSetupPar((UBYTE *)
"tempdir");
641 if ( ( sp->flags & USEDFLAG ) != USEDFLAG ) {
642 AM.TempDir = (UBYTE *)getenv(
"FORMTMP");
643 if ( AM.TempDir == 0 ) AM.TempDir = emptystring;
645 else AM.TempDir = (UBYTE *)(sp->value);
647 if ( AM.TempSortDir == 0 ) {
648 if ( AM.havesortdir ) {
649 sp = GetSetupPar((UBYTE *)
"tempsortdir");
650 AM.TempSortDir = (UBYTE *)(sp->value);
653 AM.TempSortDir = (UBYTE *)getenv(
"FORMTMPSORT");
654 if ( AM.TempSortDir == 0 ) AM.TempSortDir = AM.TempDir;
662 s = AM.TempDir; i = 200;
663 while ( *s && *s !=
':' ) {
if ( *s ==
'\\' ) s++; s++; i++; }
665 FG.fname = (
char *)Malloc1(
sizeof(UBYTE)*(i+14),
"name for temporary files");
666 s = AM.TempDir; t = (UBYTE *)FG.fname;
667 while ( *s && *s !=
':' ) {
if ( *s ==
'\\' ) s++; *t++ = *s++; }
668 if ( (
char *)t > FG.fname && t[-1] != SEPARATOR && t[-1] != ALTSEPARATOR )
672 FG.fnamebase = t-(UBYTE *)(FG.fname);
674 s = AM.TempSortDir; i = 200;
675 while ( *s && *s !=
':' ) {
if ( *s ==
'\\' ) s++; s++; i++; }
677 FG.fname2 = (
char *)Malloc1(
sizeof(UBYTE)*(i+14),
"name for sort files");
678 s = AM.TempSortDir; t = (UBYTE *)FG.fname2;
679 while ( *s && *s !=
':' ) {
if ( *s ==
'\\' ) s++; *t++ = *s++; }
680 if ( (
char *)t > FG.fname2 && t[-1] != SEPARATOR && t[-1] != ALTSEPARATOR )
684 FG.fname2base = t-(UBYTE *)(FG.fname2);
687 s = defaulttempfilename;
693 M_free(FG.fname,
"name for temporary files");
698 FG.fname = calloc(128,1);
699 strcpy(FG.fname,
"/formswap/xxxxxxxxxxxxxxxxxxxxx");
701 t = (UBYTE *)FG.fname + 10;
702 FG.fnamebase = t-FG.fname;
707 FG.fname = calloc(128,1);
708 strcpy(FG.fname,
"/formswapx/xxxxxxxxxxxxxxxxxxxxx");
710 FG.fname[9] =
'0' + PF.me;
711 t = (UBYTE *)FG.fname + 11;
712 FG.fnamebase = t-FG.fname;
715 iii = sprintf((
char*)t,
"%d",PF.me);
721 while ( *s ) *t++ = *s++;
733 int num = ((int)GetPID())%100000;
740 t[-5] = (UBYTE)(
'0' + num%10);
741 t[-6] = (UBYTE)(
'0' + (num/10)%10);
742 t[-7] = (UBYTE)(
'0' + (num/100)%10);
743 t[-8] = (UBYTE)(
'0' + (num/1000)%10);
744 t[-9] = (UBYTE)(
'0' + num/10000);
745 if ( ( AC.StoreHandle = CreateFile((
char *)FG.fname) ) < 0 ) {
746 t[-5] =
'x'; t[-6] =
'x'; t[-7] =
'x'; t[-8] =
'x'; t[-9] =
'x';
754 if ( ( AC.StoreHandle = OpenFile((
char *)FG.fname) ) < 0 ) {
755 if ( ( AC.StoreHandle = CreateFile((
char *)FG.fname) ) >= 0 )
break;
757 else CloseFile(AC.StoreHandle);
759 if ( c ==
'x' ) t[-5] =
'0';
760 else if ( c ==
'9' ) {
763 if ( c ==
'x' ) t[-6] =
'0';
764 else if ( c ==
'9' ) {
767 if ( c ==
'x' ) t[-7] =
'0';
768 else if ( c ==
'9' ) {
772 MesPrint(
"Name space for temp files exhausted");
774 MesPrint(
"Please remove files of the type %s or try a different directory" 778 else t[-7] = (UBYTE)(c+1);
780 else t[-6] = (UBYTE)(c+1);
782 else t[-5] = (UBYTE)(c+1);
789 s = tenddir; t = tenddir2;
while ( *s ) *t++ = *s++;
795 AM.S0->file.name = (
char *)Malloc1(
sizeof(
char)*(i+14),
"name for temporary files");
796 s = (UBYTE *)AM.S0->file.name;
797 t = (UBYTE *)FG.fname2;
799 while ( *t ) { *s++ = *t++; i++; }
808 s = (UBYTE *)((
void *)(FG.fname2)); i = 0;
809 while ( *s ) { s++; i++; }
810 s = (UBYTE *)Malloc1(
sizeof(
char)*(i+1),
"name for stage4 file a");
811 AR.FoStage4[1].name = (
char *)s;
812 t = (UBYTE *)FG.fname2;
813 while ( *t ) *s++ = *t++;
814 s[-2] =
'4'; s[-1] =
'a'; *s = 0;
815 s = (UBYTE *)((
void *)(FG.fname)); i = 0;
816 while ( *s ) { s++; i++; }
817 s = (UBYTE *)Malloc1(
sizeof(
char)*(i+1),
"name for stage4 file b");
818 AR.FoStage4[0].name = (
char *)s;
819 t = (UBYTE *)FG.fname;
820 while ( *t ) *s++ = *t++;
821 s[-2] =
'4'; s[-1] =
'b'; *s = 0;
822 for ( j = 0; j < 3; j++ ) {
823 s = (UBYTE *)Malloc1(
sizeof(
char)*(i+1),
"name for scratch file");
824 AR.Fscr[j].name = (
char *)s;
825 t = (UBYTE *)FG.fname;
826 while ( *t ) *s++ = *t++;
827 s[-2] =
'c'; s[-1] = (UBYTE)(
'0'+j); *s = 0;
831 else if ( par == 2 ) {
832 s = (UBYTE *)((
void *)(FG.fname2)); i = 0;
833 while ( *s ) { s++; i++; }
834 s = (UBYTE *)Malloc1(
sizeof(
char)*(i+12),
"name for stage4 file a");
835 sprintf((
char *)s,
"%s.%d",FG.fname2,AT.identity);
836 s[i-2] =
'4'; s[i-1] =
'a';
837 AR.FoStage4[1].name = (
char *)s;
838 s = (UBYTE *)((
void *)(FG.fname)); i = 0;
839 while ( *s ) { s++; i++; }
840 s = (UBYTE *)Malloc1(
sizeof(
char)*(i+12),
"name for stage4 file b");
841 sprintf((
char *)s,
"%s.%d",FG.fname,AT.identity);
842 s[i-2] =
'4'; s[i-1] =
'b';
843 AR.FoStage4[0].name = (
char *)s;
844 if ( AT.identity == 0 ) {
845 for ( j = 0; j < 3; j++ ) {
846 s = (UBYTE *)Malloc1(
sizeof(
char)*(i+1),
"name for scratch file");
847 AR.Fscr[j].name = (
char *)s;
848 t = (UBYTE *)FG.fname;
849 while ( *t ) *s++ = *t++;
850 s[-2] =
'c'; s[-1] = (UBYTE)(
'0'+j); *s = 0;
863 ALLPRIVATES *DummyPointer = 0;
879 AB = (ALLPRIVATES **)&DummyPointer;
885 set_sub(AC.separators,AC.separators,AC.separators);
886 set_set(
',',AC.separators);
887 set_set(
'|',AC.separators);
889 AM.BracketFactors[0] = 8;
890 AM.BracketFactors[1] = SYMBOL;
891 AM.BracketFactors[2] = 4;
892 AM.BracketFactors[3] = FACTORSYMBOL;
893 AM.BracketFactors[4] = 1;
894 AM.BracketFactors[5] = 1;
895 AM.BracketFactors[6] = 1;
896 AM.BracketFactors[7] = 3;
901 AC.OutputSpaces = NORMALFORMAT;
903 AM.gIsFortran90 = AC.IsFortran90 = ISNOTFORTRAN90;
904 AM.gFortran90Kind = AC.Fortran90Kind = 0;
906 AC.exprfillwarning = 0;
909 AM.MaxStreamSize = MAXFILESTREAMSIZE;
910 AP.MaxPreAssignLevel = 4;
911 AC.iBufferSize = 512;
913 AP.MaxPreIfLevel = 10;
914 AP.cComChar = AP.ComChar =
'*';
915 AM.OffsetVector = -2*WILDOFFSET+MINSPEC;
917 AM.hparallelflag = AM.gparallelflag =
918 AC.parallelflag = AC.mparallelflag = PARALLELFLAG;
920 if ( PF.numtasks < 2 ) AM.hparallelflag |= NOPARALLEL_NPROC;
923 AM.resetTimeOnClear = 1;
924 AM.gnumextrasym = AM.ggnumextrasym = 0;
926 AM.SpectatorFiles = 0;
927 AM.NumSpectatorFiles = 0;
928 AM.SizeForSpectatorFiles = 0;
932 AP.ProcList.message =
"procedure";
934 AP.LoopList.message =
"doloop";
935 AP.LoopList.size =
sizeof(
DOLOOP);
936 AP.PreVarList.message =
"PreVariable";
937 AP.PreVarList.size =
sizeof(
PREVAR);
938 AC.SymbolList.message =
"symbol";
939 AC.SymbolList.size =
sizeof(
struct SyMbOl);
940 AC.IndexList.message =
"index";
941 AC.IndexList.size =
sizeof(
struct InDeX);
942 AC.VectorList.message =
"vector";
943 AC.VectorList.size =
sizeof(
struct VeCtOr);
944 AC.FunctionList.message =
"function";
945 AC.FunctionList.size =
sizeof(
struct FuNcTiOn);
946 AC.SetList.message =
"set";
947 AC.SetList.size =
sizeof(
struct SeTs);
948 AC.SetElementList.message =
"set element";
949 AC.SetElementList.size =
sizeof(WORD);
950 AC.ExpressionList.message =
"expression";
951 AC.ExpressionList.size =
sizeof(
struct ExPrEsSiOn);
952 AC.cbufList.message =
"compiler buffer";
953 AC.cbufList.size =
sizeof(
CBUF);
954 AC.ChannelList.message =
"channel buffer";
955 AC.ChannelList.size =
sizeof(
CHANNEL);
956 AP.DollarList.message =
"$-variable";
957 AP.DollarList.size =
sizeof(
struct DoLlArS);
958 AC.DubiousList.message =
"ambiguous variable";
959 AC.DubiousList.size =
sizeof(
struct DuBiOuS);
960 AC.TableBaseList.message =
"list of tablebases";
961 AC.TableBaseList.size =
sizeof(
DBASE);
965 AC.AutoSymbolList.message =
"autosymbol";
966 AC.AutoSymbolList.size =
sizeof(
struct SyMbOl);
967 AC.AutoIndexList.message =
"autoindex";
968 AC.AutoIndexList.size =
sizeof(
struct InDeX);
969 AC.AutoVectorList.message =
"autovector";
970 AC.AutoVectorList.size =
sizeof(
struct VeCtOr);
971 AC.AutoFunctionList.message =
"autofunction";
972 AC.AutoFunctionList.size =
sizeof(
struct FuNcTiOn);
973 AC.PotModDolList.message =
"potentially modified dollar";
974 AC.PotModDolList.size =
sizeof(WORD);
975 AC.ModOptDolList.message =
"moduleoptiondollar";
978 AO.FortDotChar =
'_';
980 AC.firstconstindex = 1;
981 AO.Optimize.mctsconstant.fval = 1.0;
982 AO.Optimize.horner = O_MCTS;
983 AO.Optimize.hornerdirection = O_FORWARDORBACKWARD;
984 AO.Optimize.method = O_GREEDY;
985 AO.Optimize.mctstimelimit = 0;
986 AO.Optimize.mctsnumexpand = 1000;
987 AO.Optimize.mctsnumkeep = 10;
988 AO.Optimize.mctsnumrepeat = 1;
989 AO.Optimize.greedytimelimit = 0;
990 AO.Optimize.greedyminnum = 10;
991 AO.Optimize.greedymaxperc = 5;
992 AO.Optimize.printstats = 0;
993 AO.Optimize.debugflags = 0;
994 AO.OptimizeResult.code = NULL;
1002 AC.doloopstacksize = 0;
1007 AC.varnames = MakeNameTree();
1008 AC.exprnames = MakeNameTree();
1009 AC.dollarnames = MakeNameTree();
1010 AC.autonames = MakeNameTree();
1011 AC.activenames = &(AC.varnames);
1018 #ifndef WITHPTHREADS 1032 CBUF *C = cbuf+AM.zbufnum;
1033 WORD one[5] = {4,1,1,3,0};
1036 AM.zerorhs = C->numrhs;
1037 AddNtoC(AM.zbufnum,1,&zero,17);
1039 AM.onerhs = C->numrhs;
1046 AC.Symbols = &(AC.SymbolList);
1047 AC.Indices = &(AC.IndexList);
1048 AC.Vectors = &(AC.VectorList);
1049 AC.Functions = &(AC.FunctionList);
1052 AddDollar((UBYTE *)
"$",DOLUNDEFINED,0,0);
1054 cbuf[AM.dbufnum].mnumlhs = cbuf[AM.dbufnum].numlhs;
1055 cbuf[AM.dbufnum].mnumrhs = cbuf[AM.dbufnum].numrhs;
1057 AddSymbol((UBYTE *)
"i_",-MAXPOWER,MAXPOWER,VARTYPEIMAGINARY,0);
1058 AddSymbol((UBYTE *)
"pi_",-MAXPOWER,MAXPOWER,VARTYPENONE,0);
1059 AddSymbol((UBYTE *)
"coeff_",-MAXPOWER,MAXPOWER,VARTYPENONE,0);
1060 AddSymbol((UBYTE *)
"num_",-MAXPOWER,MAXPOWER,VARTYPENONE,0);
1061 AddSymbol((UBYTE *)
"den_",-MAXPOWER,MAXPOWER,VARTYPENONE,0);
1062 AddSymbol((UBYTE *)
"xarg_",-MAXPOWER,MAXPOWER,VARTYPENONE,0);
1063 AddSymbol((UBYTE *)
"dimension_",-MAXPOWER,MAXPOWER,VARTYPENONE,0);
1064 AddSymbol((UBYTE *)
"factor_",-MAXPOWER,MAXPOWER,VARTYPENONE,0);
1065 AddSymbol((UBYTE *)
"sep_",-MAXPOWER,MAXPOWER,VARTYPENONE,0);
1074 for ( ; i < FIRSTUSERSYMBOL; i++ ) {
1075 sprintf(dumstr,
":%d:",i);
1076 AddSymbol((UBYTE *)dumstr,-MAXPOWER,MAXPOWER,VARTYPENONE,0);
1080 AddIndex((UBYTE *)
"iarg_",4,0);
1081 AddVector((UBYTE *)
"parg_",VARTYPENONE,0);
1083 AM.NumFixedFunctions =
sizeof(fixedfunctions)/
sizeof(
struct fixedfun);
1084 for ( i = 0; i < AM.NumFixedFunctions; i++ ) {
1085 ii = AddFunction((UBYTE *)fixedfunctions[i].
name 1086 ,fixedfunctions[i].commu
1087 ,fixedfunctions[i].tensor
1088 ,fixedfunctions[i].complx
1091 if ( fixedfunctions[i].tensor == GAMMAFUNCTION )
1092 functions[ii].flags |= COULDCOMMUTE;
1101 for ( ; i < FIRSTUSERFUNCTION-FUNCTION; i++ ) {
1102 sprintf(dumstr,
"::%d::",i);
1103 AddFunction((UBYTE *)dumstr,0,0,0,0,0,-1,-1);
1106 AM.NumFixedSets =
sizeof(fixedsets)/
sizeof(
struct fixedset);
1107 for ( i = 0; i < AM.NumFixedSets; i++ ) {
1108 ii = AddSet((UBYTE *)fixedsets[i].
name,fixedsets[i].dimension);
1109 Sets[ii].type = fixedsets[i].type;
1111 AM.RepMax = MAXREPEAT;
1112 #ifndef WITHPTHREADS 1113 AT.RepCount = (
int *)Malloc1((LONG)((AM.RepMax+3)*
sizeof(
int)),
"repeat buffers");
1114 AN.RepPoint = AT.RepCount;
1115 AT.RepTop = AT.RepCount + AM.RepMax;
1116 AN.polysortflag = 0;
1119 AC.NumWildcardNames = 0;
1120 AC.WildcardBufferSize = 50;
1121 AC.WildcardNames = (UBYTE *)Malloc1((LONG)AC.WildcardBufferSize,
"argument list names");
1122 #ifndef WITHPTHREADS 1123 AT.WildArgTaken = (WORD *)Malloc1((LONG)AC.WildcardBufferSize*
sizeof(WORD)/2
1124 ,
"argument list names");
1125 AT.WildcardBufferSize = AC.WildcardBufferSize;
1127 AT.nfac = AT.nBer = 0;
1132 AR.wranfnpair1 = NPAIR1;
1133 AR.wranfnpair2 = NPAIR2;
1137 AM.oldnumextrasymbols = strDup1((UBYTE *)
"OLDNUMEXTRASYMBOLS_",
"oldnumextrasymbols");
1138 PutPreVar((UBYTE *)
"VERSION_",(UBYTE *)STRINGIFY(MAJORVERSION),0,0);
1139 PutPreVar((UBYTE *)
"SUBVERSION_",(UBYTE *)STRINGIFY(MINORVERSION),0,0);
1140 PutPreVar((UBYTE *)
"DATE_",(UBYTE *)MakeDate(),0,0);
1141 PutPreVar((UBYTE *)
"random_",(UBYTE *)
"________",(UBYTE *)
"?a",0);
1142 PutPreVar((UBYTE *)
"optimminvar_",(UBYTE *)(
"0"),0,0);
1143 PutPreVar((UBYTE *)
"optimmaxvar_",(UBYTE *)(
"0"),0,0);
1144 PutPreVar(AM.oldnumextrasymbols,(UBYTE *)(
"0"),0,0);
1145 PutPreVar((UBYTE *)
"optimvalue_",(UBYTE *)(
"0"),0,0);
1146 PutPreVar((UBYTE *)
"optimscheme_",(UBYTE *)(
"0"),0,0);
1147 PutPreVar((UBYTE *)
"tolower_",(UBYTE *)(
"0"),(UBYTE *)(
"?a"),0);
1148 PutPreVar((UBYTE *)
"toupper_",(UBYTE *)(
"0"),(UBYTE *)(
"?a"),0);
1149 PutPreVar((UBYTE *)
"SYSTEMERROR_",(UBYTE *)(
"0"),0,0);
1156 pid = ( PF.me == MASTER ) ? GetPID() : (LONG)0;
1160 PutPreVar((UBYTE *)
"PID_",(UBYTE *)buf,0,0);
1163 AP.MaxPreTypes = 10;
1165 AP.PreTypes = (
int *)Malloc1(
sizeof(
int)*(AP.MaxPreTypes+1),
"preprocessor types");
1166 AP.inside.buffer = 0;
1169 AC.SortType = AC.lSortType = AM.gSortType = SORTLOWFIRST;
1172 AR.SortType = AC.SortType;
1175 AC.SetList.numtemp = AC.SetList.num;
1176 AC.SetElementList.numtemp = AC.SetElementList.num;
1178 GetName(AC.varnames,(UBYTE *)
"exp_",&AM.expnum,NOAUTO);
1179 GetName(AC.varnames,(UBYTE *)
"denom_",&AM.denomnum,NOAUTO);
1180 GetName(AC.varnames,(UBYTE *)
"fac_",&AM.facnum,NOAUTO);
1181 GetName(AC.varnames,(UBYTE *)
"invfac_",&AM.invfacnum,NOAUTO);
1182 GetName(AC.varnames,(UBYTE *)
"sum_",&AM.sumnum,NOAUTO);
1183 GetName(AC.varnames,(UBYTE *)
"sump_",&AM.sumpnum,NOAUTO);
1184 GetName(AC.varnames,(UBYTE *)
"term_",&AM.termfunnum,NOAUTO);
1185 GetName(AC.varnames,(UBYTE *)
"match_",&AM.matchfunnum,NOAUTO);
1186 GetName(AC.varnames,(UBYTE *)
"count_",&AM.countfunnum,NOAUTO);
1187 AM.termfunnum += FUNCTION;
1188 AM.matchfunnum += FUNCTION;
1189 AM.countfunnum += FUNCTION;
1191 AC.ThreadStats = AM.gThreadStats = AM.ggThreadStats = 1;
1192 AC.FinalStats = AM.gFinalStats = AM.ggFinalStats = 1;
1193 AC.StatsFlag = AM.gStatsFlag = AM.ggStatsFlag = 1;
1194 AC.ThreadsFlag = AM.gThreadsFlag = AM.ggThreadsFlag = 1;
1195 AC.ThreadBalancing = AM.gThreadBalancing = AM.ggThreadBalancing = 1;
1196 AC.ThreadSortFileSynch = AM.gThreadSortFileSynch = AM.ggThreadSortFileSynch = 0;
1197 AC.ProcessStats = AM.gProcessStats = AM.ggProcessStats = 1;
1198 AC.OldParallelStats = AM.gOldParallelStats = AM.ggOldParallelStats = 0;
1199 AC.OldFactArgFlag = AM.gOldFactArgFlag = AM.ggOldFactArgFlag = NEWFACTARG;
1200 AC.OldGCDflag = AM.gOldGCDflag = AM.ggOldGCDflag = 1;
1201 AC.WTimeStatsFlag = AM.gWTimeStatsFlag = AM.ggWTimeStatsFlag = 0;
1202 AM.gcNumDollars = AP.DollarList.num;
1203 AC.SizeCommuteInSet = AM.gSizeCommuteInSet = 0;
1204 AC.CommuteInSet = 0;
1206 AM.PrintTotalSize = 0;
1208 AO.NoSpacesInNumbers = AM.gNoSpacesInNumbers = AM.ggNoSpacesInNumbers = 0;
1209 AO.IndentSpace = AM.gIndentSpace = AM.ggIndentSpace = INDENTSPACE;
1211 AO.OptimizationLevel = 0;
1212 PUTZERO(AS.MaxExprSize);
1213 PUTZERO(AC.StoreFileSize);
1216 AC.inputnumbers = 0;
1218 AC.numpfirstnum = AC.sizepfirstnum = 0;
1220 AC.MemDebugFlag = 1;
1222 #ifdef WITHEXTERNALCHANNEL 1223 AX.currentExternalChannel=0;
1224 AX.killSignal=SIGKILL;
1225 AX.killWholeGroup=1;
1229 AX.shellname=strDup1((UBYTE *)
"/bin/sh -c",
"external channel shellname");
1230 AX.stderrname=strDup1((UBYTE *)
"/dev/null",
"external channel stderrname");
1241 #ifdef WITHEXTERNALCHANNEL 1247 initPresetExternalChannels((UBYTE*)getenv(
"FORM_PIPES"),AX.timeout);
1257 sprintf((
char*)buf,
"%d",PF.me);
1258 PutPreVar((UBYTE *)
"PARALLELTASK_",buf,0,0);
1259 sprintf((
char*)buf,
"%d",PF.numtasks);
1260 PutPreVar((UBYTE *)
"NPARALLELTASKS_",buf,0,0);
1263 PutPreVar((UBYTE *)
"PARALLELTASK_",(UBYTE *)
"0",0,0);
1264 PutPreVar((UBYTE *)
"NPARALLELTASKS_",(UBYTE *)
"1",0,0);
1267 PutPreVar((UBYTE *)
"NAME_",AM.InputFileName ? AM.InputFileName : (UBYTE *)
"STDIN",0,0);
1284 WORD *fi, i, one = 1;
1285 CBUF *C = cbuf+AC.cbufnum;
1289 sprintf((
char*)buf,
"%d",AM.totalnumberofthreads);
1290 PutPreVar((UBYTE *)
"NTHREADS_",buf,0,1);
1292 PutPreVar((UBYTE *)
"NTHREADS_",(UBYTE *)
"1",0,1);
1297 AR.SortType = AC.SortType = AC.lSortType = AM.gSortType;
1299 AC.OutputSpaces = NORMALFORMAT;
1302 AC.ncmod = AM.gncmod = 0;
1303 AC.modmode = AM.gmodmode = 0;
1304 AC.npowmod = AM.gnpowmod = 0;
1305 AC.halfmod = 0; AC.nhalfmod = 0;
1307 AC.lPolyFun = AM.gPolyFun = 0;
1308 AC.lPolyFunInv = AM.gPolyFunInv = 0;
1309 AC.lPolyFunType = AM.gPolyFunType = 0;
1310 AC.lPolyFunExp = AM.gPolyFunExp = 0;
1311 AC.lPolyFunVar = AM.gPolyFunVar = 0;
1312 AC.lPolyFunPow = AM.gPolyFunPow = 0;
1314 AC.lDefDim = AM.gDefDim = 4;
1315 AC.lDefDim4 = AM.gDefDim4 = 0;
1316 AC.lUnitTrace = AM.gUnitTrace = 4;
1317 AC.NamesFlag = AM.gNamesFlag = 0;
1318 AC.CodesFlag = AM.gCodesFlag = 0;
1319 AC.extrasymbols = AM.gextrasymbols = AM.ggextrasymbols = 0;
1320 AC.extrasym = (UBYTE *)Malloc1(2*
sizeof(UBYTE),
"extrasym");
1321 AM.gextrasym = (UBYTE *)Malloc1(2*
sizeof(UBYTE),
"extrasym");
1322 AM.ggextrasym = (UBYTE *)Malloc1(2*
sizeof(UBYTE),
"extrasym");
1323 AC.extrasym[0] = AM.gextrasym[0] = AM.ggextrasym[0] =
'Z';
1324 AC.extrasym[1] = AM.gextrasym[1] = AM.ggextrasym[1] = 0;
1325 AC.TokensWriteFlag = AM.gTokensWriteFlag = 0;
1327 AC.LineLength = AM.gLineLength = 79;
1331 AC.OutputSpaces = NORMALFORMAT;
1332 AM.gOutputSpaces = NORMALFORMAT;
1333 AC.OutNumberType = RATIONALMODE;
1334 AM.gOutNumberType = RATIONALMODE;
1336 AR.gzipCompress = GZIPDEFAULT;
1337 AR.FoStage4[0].ziobuffer = 0;
1338 AR.FoStage4[1].ziobuffer = 0;
1341 AC.bracketindexflag = 0;
1342 AT.bracketindexflag = 0;
1345 AM.gfunpowers = AC.funpowers = COMFUNPOWERS;
1346 AC.parallelflag = AM.gparallelflag;
1347 AC.properorderflag = AM.gproperorderflag = PROPERORDERFLAG;
1348 AC.ProcessBucketSize = AC.mProcessBucketSize = AM.gProcessBucketSize;
1349 AC.ThreadBucketSize = AM.gThreadBucketSize;
1350 AC.ShortStatsMax = 0;
1351 AM.gShortStatsMax = 0;
1352 AM.ggShortStatsMax = 0;
1354 GlobalSymbols = NumSymbols;
1355 GlobalIndices = NumIndices;
1356 GlobalVectors = NumVectors;
1357 GlobalFunctions = NumFunctions;
1358 GlobalSets = NumSets;
1359 GlobalSetElements = NumSetElements;
1360 AC.modpowers = (UWORD *)0;
1364 if ( i > 0 )
do { *fi++ = one; }
while ( --i >= 0 );
1374 for ( i = 8; i < 15; i++ ) AM.Ordering[i] = i;
1376 AC.lUniTrace[0] = SNUMBER;
1380 AC.lUniTrace[2] = 4;
1382 AC.lUniTrace[3] = 1;
1386 AT.MinVecArg[0] = 7+ARGHEAD;
1387 AT.MinVecArg[ARGHEAD] = 7;
1388 AT.MinVecArg[1+ARGHEAD] = INDEX;
1389 AT.MinVecArg[2+ARGHEAD] = 3;
1390 AT.MinVecArg[3+ARGHEAD] = 0;
1391 AT.MinVecArg[4+ARGHEAD] = 1;
1392 AT.MinVecArg[5+ARGHEAD] = 1;
1393 AT.MinVecArg[6+ARGHEAD] = -3;
1395 *t++ = 4+ARGHEAD+FUNHEAD;
1396 for ( i = 1; i < ARGHEAD; i++ ) *t++ = 0;
1400 for ( i = 2; i < FUNHEAD; i++ ) *t++ = 0;
1401 *t++ = 1; *t++ = 1; *t++ = 3;
1408 AT.comsym[1] = SYMBOL;
1419 AT.comfun[0] = FUNHEAD+4;
1420 AT.comfun[1] = FUNCTION;
1421 AT.comfun[2] = FUNHEAD;
1426 AT.comfun[FUNHEAD+1] = 1;
1427 AT.comfun[FUNHEAD+2] = 1;
1428 AT.comfun[FUNHEAD+3] = 3;
1430 AT.comind[1] = INDEX;
1436 AT.locwildvalue[0] = SUBEXPRESSION;
1437 AT.locwildvalue[1] = SUBEXPSIZE;
1438 for ( i = 2; i < SUBEXPSIZE; i++ ) AT.locwildvalue[i] = 0;
1439 AT.mulpat[0] = TYPEMULT;
1440 AT.mulpat[1] = SUBEXPSIZE+3;
1442 AT.mulpat[3] = SUBEXPRESSION;
1443 AT.mulpat[4] = SUBEXPSIZE;
1446 for ( i = 7; i < SUBEXPSIZE+5; i++ ) AT.mulpat[i] = 0;
1447 AT.proexp[0] = SUBEXPSIZE+4;
1448 AT.proexp[1] = EXPRESSION;
1449 AT.proexp[2] = SUBEXPSIZE;
1452 for ( i = 5; i < SUBEXPSIZE+1; i++ ) AT.proexp[i] = 0;
1453 AT.proexp[SUBEXPSIZE+1] = 1;
1454 AT.proexp[SUBEXPSIZE+2] = 1;
1455 AT.proexp[SUBEXPSIZE+3] = 3;
1456 AT.proexp[SUBEXPSIZE+4] = 0;
1457 AT.dummysubexp[0] = SUBEXPRESSION;
1458 AT.dummysubexp[1] = SUBEXPSIZE+4;
1459 for ( i = 2; i < SUBEXPSIZE; i++ ) AT.dummysubexp[i] = 0;
1460 AT.dummysubexp[SUBEXPSIZE] = WILDDUMMY;
1461 AT.dummysubexp[SUBEXPSIZE+1] = 4;
1462 AT.dummysubexp[SUBEXPSIZE+2] = 0;
1463 AT.dummysubexp[SUBEXPSIZE+3] = 0;
1465 AT.inprimelist = -1;
1466 AT.sizeprimelist = 0;
1468 AT.LeaveNegative = 0;
1470 AN.SplitScratch = 0;
1471 AN.SplitScratchSize = AN.InScratch = 0;
1472 AN.SplitScratch1 = 0;
1473 AN.SplitScratchSize1 = AN.InScratch1 = 0;
1474 AN.idfunctionflag = 0;
1476 AO.OutputLine = AO.OutFill = BufferForOutput;
1481 AP.ComChar = AP.cComChar;
1482 AC.cbufnum = AM.rbufnum;
1484 AP.PreAssignFlag = 0;
1495 static int exitInProgress = 0;
1496 static int trappedTerminate = 0;
1500 #ifdef INTSIGHANDLER 1501 static int onErrSig(
int i)
1503 static VOID onErrSig(
int i)
1506 if (exitInProgress){
1509 #ifdef INTSIGHANDLER 1515 trappedTerminate = 1;
1520 #ifdef INTSIGHANDLER 1521 static VOID setNewSig(
int i,
int (*handler)(
int))
1523 static VOID setNewSig(
int i,
void (*handler)(
int))
1528 if ( signal(i,SIG_IGN) !=SIG_IGN)
1533 VOID setSignalHandlers()
1536 setNewSig(SIGSEGV,onErrSig);
1537 setNewSig(SIGFPE,onErrSig);
1538 setNewSig(SIGILL,onErrSig);
1539 setNewSig(SIGEMT,onErrSig);
1540 setNewSig(SIGSYS,onErrSig);
1541 setNewSig(SIGPIPE,onErrSig);
1542 setNewSig(SIGLOST,onErrSig);
1543 setNewSig(SIGXCPU,onErrSig);
1544 setNewSig(SIGXFSZ,onErrSig);
1547 setNewSig(SIGTERM,onErrSig);
1548 setNewSig(SIGINT,onErrSig);
1549 setNewSig(SIGQUIT,onErrSig);
1550 setNewSig(SIGHUP,onErrSig);
1551 setNewSig(SIGALRM,onErrSig);
1552 setNewSig(SIGVTALRM,onErrSig);
1564 ALLPRIVATES *ABdummy[10];
1567 int main(
int argc,
char **argv)
1570 bzero((VOID *)(&A),
sizeof(A));
1573 setSignalHandlers();
1586 if (
PF_Init(&argc,&argv) ) exit(-1);
1610 if ( ( retval = DoTail(argc,(UBYTE **)argv) ) != 0 ) {
1611 if ( retval > 0 ) Terminate(0);
1614 if ( DoSetups() ) Terminate(-2);
1619 if ( OpenInput() ) Terminate(-3);
1623 if ( TryEnvironment() ) Terminate(-2);
1624 if ( TryFileSetups() ) Terminate(-2);
1625 if ( MakeSetupAllocs() ) Terminate(-2);
1629 if ( AM.totalnumberofthreads == 0 ) AM.totalnumberofthreads = 1;
1630 AS.MultiThreaded = 0;
1632 if ( AM.totalnumberofthreads > 1 ) AS.MultiThreaded = 1;
1633 ReserveTempFiles(1);
1634 StartAllThreads(AM.totalnumberofthreads);
1637 ReserveTempFiles(0);
1640 if ( !AM.FromStdin ) PrintHeader(1);
1643 if ( AM.TimeLimit > 0 ) alarm(AM.TimeLimit);
1661 VOID CleanUp(WORD par)
1668 for ( i = 0; i < 3; i++ ) {
1669 if ( AR.Fscr[i].handle >= 0 ) {
1670 if ( AR.Fscr[i].name ) {
1675 CloseFile(AR.Fscr[i].handle);
1676 remove(AR.Fscr[i].name);
1678 AR.Fscr[i].handle = - 1;
1679 AR.Fscr[i].POfill = 0;
1687 if ( AC.StoreHandle >= 0 && par <= 0 ) {
1689 if ( trappedTerminate ) {
1692 SeekFile(AC.StoreHandle,&pos,SEEK_END);
1693 if ( ISNOTZEROPOS(pos) ) {
1694 CloseFile(AC.StoreHandle);
1698 CloseFile(AC.StoreHandle);
1699 if ( par >= 0 || AR.StoreData.Handle < 0 || AM.ClearStore ) {
1704 CloseFile(AC.StoreHandle);
1705 if ( par >= 0 || AR.StoreData.Handle < 0 || AM.ClearStore > 0 ) {
1711 ClearSpectators(CLEARMODULE);
1721 if ( AC.LogHandle >= 0 && par <= 0 ) {
1722 WORD lh = AC.LogHandle;
1725 if ( PF.me == MASTER )
1736 static int firstterminate = 1;
1738 VOID Terminate(
int errorcode)
1740 if ( errorcode && firstterminate ) {
1743 MesPrint(
"Program terminating in thread %w at &");
1744 #elif defined(WITHMPI) 1745 MesPrint(
"Program terminating in process %w at &");
1747 MesPrint(
"Program terminating at &");
1754 #ifdef WITHEXTERNALCHANNEL 1759 closeAllExternalChannels();
1760 AX.currentExternalChannel=0;
1762 AX.killSignal=SIGKILL;
1763 AX.killWholeGroup=1;
1766 if(AX.currentPrompt){
1767 M_free(AX.currentPrompt,
"external channel prompt");
1772 M_free(AX.shellname,
"external channel shellname");
1776 M_free(AX.stderrname,
"external channel stderrname");
1782 if ( !WhoAmI() && !errorcode ) {
1783 TerminateAllThreads();
1786 if ( AC.FinalStats ) {
1787 if ( AM.PrintTotalSize ) {
1788 MesPrint(
"Max. space for expressions: %19p bytes",&(AS.MaxExprSize));
1793 if ( AM.HoldFlag && PF.me == MASTER ) {
1794 WriteFile(AM.StdOut,(UBYTE *)(
"Hit any key "),12);
1799 if ( AM.HoldFlag ) {
1800 WriteFile(AM.StdOut,(UBYTE *)(
"Hit any key "),12);
1810 P_term(errorcode? 0: 1);
1821 VOID PrintRunningTime()
1823 #if (defined(WITHPTHREADS) && (defined(WITHPOSIXCLOCK) || defined(WINDOWS))) || defined(WITHMPI) 1828 #if defined(WITHPTHREADS) 1830 workertime = GetWorkerTimes();
1833 if ( PF.me == MASTER ) {
1835 mastertime = AM.SumTime +
TimeCPU(1);
1837 totaltime = mastertime+workertime;
1839 MesPrint(
" %l.%2i sec + %l.%2i sec: %l.%2i sec out of %l.%2i sec",
1840 mastertime/1000,(WORD)((mastertime%1000)/10),
1841 workertime/1000,(WORD)((workertime%1000)/10),
1842 totaltime/1000,(WORD)((totaltime%1000)/10),
1843 wallclocktime/100,(WORD)(wallclocktime%100));
1847 LONG mastertime = AM.SumTime +
TimeCPU(1);
1850 MesPrint(
" %l.%2i sec out of %l.%2i sec",
1851 mastertime/1000,(WORD)((mastertime%1000)/10),
1852 wallclocktime/100,(WORD)(wallclocktime%100));
1862 LONG GetRunningTime()
1864 #if defined(WITHPTHREADS) && (defined(WITHPOSIXCLOCK) || defined(WINDOWS)) 1873 LONG workertime = GetWorkerTimes();
1874 mastertime = AM.SumTime +
TimeCPU(1);
1875 return(mastertime+workertime);
1881 return(AM.SumTime +
TimeCPU(1));
1883 #elif defined(WITHMPI) 1884 LONG mastertime, t = 0;
1886 if ( PF.me == MASTER ) {
1887 mastertime = AM.SumTime +
TimeCPU(1);
1888 t = mastertime + workertime;
1892 return(AM.SumTime +
TimeCPU(1));
void DeleteRecoveryFile()
int PF_Init(int *argc, char ***argv)
WORD Compare1(WORD *, WORD *, WORD)
int PutPreVar(UBYTE *, UBYTE *, UBYTE *, int)
LONG PF_GetSlaveTimes(void)
LONG PF_BroadcastNumber(LONG x)
int PF_Terminate(int errorcode)
void PF_FlushStdOutBuffer(void)