/* ------------------------------------------------------------------------
- * $Id: main.c,v 1.1 2000/04/05 10:06:36 simonmar Exp $
+ * $Id: main.c,v 1.3 2004/08/13 13:11:23 simonmar Exp $
*
* Copyright (C) 1995-2000 University of Oxford
*
* form, be without fee and subject to these same conditions.
* --------------------------------------------------------------------- */
-#include "config.h"
+#include "ghcconfig.h"
#include <stdio.h>
double bsp_g = 9.3;
int bsp_p;
-FILE *log;
+FILE *logFile;
extern void printDaVinci(int);
Pgm,ProfileData,usage);
exit(1);
}
- if (!(log=fopen("ghcprof.log","w"))) {
+ if (!(logFile=fopen("ghcprof.log","w"))) {
fprintf(stderr,"%s: unable to open log file for writing\n",Pgm);
exit(1);
}
/* printf("Ending initialisation of daVinci\n"); */
- if (Verbose) fprintf(log,"%s: opened profile file \"%s\".\n",Pgm,ProfileData);
+ if (Verbose) fprintf(logFile,"%s: opened profile file \"%s\".\n",Pgm,ProfileData);
readRawProfile(fptr,&NoNodes,MaxNoNodes);
fclose(fptr);
- if (Verbose) fprintf(log,"%s: %d nodes in profile.\n",Pgm,NoNodes);
+ if (Verbose) fprintf(logFile,"%s: %d nodes in profile.\n",Pgm,NoNodes);
if (NoNodes<=0) {
- fprintf(log,"%s: no call-graph profile data in \"%s\".\n"
+ fprintf(logFile,"%s: no call-graph profile data in \"%s\".\n"
"Re-run your program using the appropriate profiling flags\n",
Pgm,ProfileData);
exit(1);
TotalH = Mat(object_cost,costs,root,0).hrel_max;
TotalSyncs = Mat(object_cost,costs,root,0).syncs;
if (Verbose) printConnectivityMatrix(graph,costs,root);
- fflush(log);
+ fflush(logFile);
graphToDaVinci(root,&graph,&costs,0);
fflush(stdout);
undo_stack = calloc(NoDeletes,sizeof(int));
select_nodes[0]=root;
while (fgets(davinci_stdin, MAX_PROFILE_LINE_LENGTH, stdin) && going) {
cmd = parseDaVinciCmd(davinci_stdin);
- if (Verbose) fprintf(log,"From davinci=\"%s\"\n",davinci_stdin);
+ if (Verbose) fprintf(logFile,"From davinci=\"%s\"\n",davinci_stdin);
switch (cmd.type) {
case DAVINCI_OK:
continue;
break;
}
fflush(stdout);
- fflush(log);
+ fflush(logFile);
}
return 0;