if(options.debug>=4)System.out.println(trace_file_vpid+"START_APP_RUN_TYPE: app "+app_name+", run "+run);
if(options.debug>=4)System.out.println("  VPID "+trace_file_vpid+" START_APP_RUN_TYPE: app "+app_name+", run "+run);
  static private TraceRecord readTraceRecord(DataInputStream input_file)  {    TraceRecord tr = null;        try {      int record_format = input_file.readInt();      if (record_format == TraceRecord.COUNTER_TYPE) {	TraceCounterRecord tcr = new TraceCounterRecord(n_counters);	int encoding    = input_file.readInt();	tcr.buffer_code = encoding >> 16;	tcr.vpid         = encoding & 0x00FF;	tcr.tid          = input_file.readInt();	tcr.local_tid    = input_file.readInt();	if(options.debug>=5)	  System.out.print(tcr.buffer_code+" VPID "+tcr.vpid+" TID "+tcr.tid+" LTID "+tcr.local_tid);	tcr.start_wall_time   = input_file.readLong();	// translate end wall time to relative wall time.	tcr.counters[0] = input_file.readLong() - tcr.start_wall_time;	if(options.debug>=5){	  System.out.print(" SWT "+tcr.start_wall_time);System.out.print(" RWT "+tcr.counters[0]);	}	for (int i=1; i<=tcr.n_counters; i++) {	  tcr.counters[i] = input_file.readLong();	  if(options.debug>=5)System.out.print(" "+i+": "+tcr.counters[i]);	}	if(options.debug>=5)System.out.println();	// first Trace Counter Record read 	if (trace_file_vpid == -1) {	  trace_file_vpid = tcr.vpid;				// cache vpid	  trace_file_start_wall_time = tcr.start_wall_time;	  TraceCounterRecord.start_time = tcr.start_wall_time;	  if (debug>=3) {	    System.out.println(trace_file_vpid+" start wall clock time "+trace_file_start_wall_time);	  }	} else { // check that all vpid in a trace file are the same!	  if (trace_file_vpid != tcr.vpid) {	    System.out.println("***readTraceRecord: trace_file_vpid "+trace_file_vpid+" != record vpid "+tcr.vpid+"!***");	    System.exit(-1);	  }	}	tr = tcr;      } else if (record_format == TraceRecord.START_APP_TYPE) {	String app_name = Utilities.getStringFromDataInputStream(input_file);	if(options.debug>=1)System.out.println(trace_file_vpid+"START_APP_TYPE: app "+app_name);	tr = new TraceStartAppRecord(trace_file_vpid, app_name);      } else if (record_format == TraceRecord.COMPLETE_APP_TYPE) {	String app_name = Utilities.getStringFromDataInputStream(input_file);	if(options.debug>=4)System.out.println(trace_file_vpid+"COMPLETE_APP_TYPE: app "+app_name);	tr = new TraceCompleteAppRecord(trace_file_vpid, app_name);	      } else if (record_format == TraceRecord.START_APP_RUN_TYPE) {	int  run = input_file.readInt();	String app_name = Utilities.getStringFromDataInputStream(input_file);	if(options.debug>=4)System.out.println(trace_file_vpid+"START_APP_RUN_TYPE: app "+app_name+", run "+run);	tr = new TraceStartAppRunRecord(trace_file_vpid, app_name, run);      } else if (record_format == TraceRecord.COMPLETE_APP_RUN_TYPE) {	int  run = input_file.readInt();	String app_name = Utilities.getStringFromDataInputStream(input_file);	if(options.debug>=4)System.out.println(trace_file_vpid+"COMPLETE_APP_RUN_TYPE: app "+app_name+", run "+run);	Integer Index = (Integer)completeApplicationRunIndex.get(app_name);	tr = new TraceCompleteAppRunRecord(trace_file_vpid, app_name, run);      } else {	System.out.println("***TraceFileReader.readTraceRecord() record format "+record_format+" unknown!***");	//	System.exit(-1);      }    } catch (EOFException e) {      if(options.debug>=4)System.out.println("!!!EOF in readTraceRecord!!!");      return null;    } catch (IOException e) {      System.out.println("*** IO Exception in readTraceRecord!***");      System.exit(-1);    }    return tr;  }