- if (!hpc_ticks_inited) {
- char* trace_filename;
- int comma;
- Info *tmpModule;
-
- assert(hpc_inited);
- hpc_ticks_inited = 1;
-
- trace_filename = (char *) malloc(strlen(prog_name) + 6);
- sprintf(trace_filename, "%s.rix", prog_name);
- rixFile = fopen(trace_filename,"w+");
-
- comma = 0;
-
- fprintf(rixFile,"START %s\n",prog_name);
- fprintf(rixFile,"[");
- tmpModule = modules;
- for(;tmpModule != 0;tmpModule = tmpModule->next) {
- if (comma) {
- fprintf(rixFile,",");
- } else {
- comma = 1;
- }
- fprintf(rixFile,"(\"%s\",%u)",
- tmpModule->modName,
- tmpModule->tickCount);
-#if DEBUG_HPC
- fprintf(stderr,"(tracer)%s: %u (offset=%u)\n",
- tmpModule->modName,
- tmpModule->tickCount,
- tmpModule->tickOffset);
-#endif
- }
- fprintf(rixFile,"]\n");
- fflush(rixFile);
+ assert(hpc_inited != 0);
+ if (rixFile != NULL) {
+ send_ThreadId(current_tso);
+ fprintf(rixFile,"%d\n",globIx);