Esempio n. 1
0
/*
 * Gathers all the timing information from each PE and prints
 * it to a file. All information from a PE is printed as a row in a tab seperated file
 */
static void log_times(char * log_file)
{
  FILE * fp = NULL;

  for(uint64_t i = 0; i < TIMER_NTIMERS; ++i){
    timers[i].all_times = gather_rank_times(&timers[i]);
    timers[i].all_counts = gather_rank_counts(&timers[i]);
  }

  if(shmem_my_pe() == ROOT_PE)
  {
    int print_names = 0;
    if(file_exists(log_file) != 1){
      print_names = 1;
    }

    if((fp = fopen(log_file, "a+b"))==NULL){
      perror("Error opening log file:");
      exit(1);
    }

    if(print_names == 1){
      print_run_info(fp);
      print_timer_names(fp);
    }
    print_timer_values(fp);

    report_summary_stats();

    fclose(fp);
  }

}
Esempio n. 2
0
int
main(void)
{
	int col_num;
	int ret;

	print_run_info ();

	while (1) {
		ret = read_int ("Enter a column number (RETURN only to quit): ",
				&col_num);
		if (ret == 0) {
			printf("%s\n", spreadconv_convert_column_number (col_num));
			continue;
		}
		if (ret == 1)
			break;
	}

	return 0;
}