#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cerrno>
#include <ctime>
#include <cmath>
#include <fstream>
#include <iostream>
#include <sstream>
#include "proto.h"
#include "globals.h"
#include "cglobals.h"
#include "cmakeVars.h"
Defines | |
#define | DOPRINT 0 |
Functions | |
bool | read_simdata () |
void | getsnaplocation () |
void | setup_io () |
void | read_parameterfile () |
void | get_parameter_value (char *key, char *line) |
int | get_int_file (FILE *file) |
int | get_next_int (char *line) |
double | get_double_file (FILE *file) |
int | get_doubles_file (FILE *file, int number, double results[]) |
void | get_string_file (FILE *file, char *string) |
double | get_next_double (char *line) |
void | get_next_string (char *instring, char *outstring) |
int | get_file_line (FILE *file, char *line) |
int | get_int_stdin () |
double | get_double_stdin () |
void | get_string_stdin (char *string) |
void | get_stdin_line (char *line) |
size_t | my_fread (void *ptr, size_t size, size_t nmemb, FILE *stream) |
double | second (void) |
double | timediff (double t0, double t1) |
void | printTimingsInfo (const char *function_name, double dtime) |
FILE * | open_file_write (char *filename) |
FILE * | open_file_append (char *filename) |
FILE * | open_file_read (char *filename) |
void | pgp_set_name_term (const char *name) |
string | getLocation () |
int get_file_line | ( | FILE * | file, | |
char * | line | |||
) |
return 0 on error (e.g. end of file) return 1 on success
string getLocation | ( | ) |
return the base hyplot location. Get it from the header file generated by cmake
size_t my_fread | ( | void * | ptr, | |
size_t | size, | |||
size_t | nmemb, | |||
FILE * | stream | |||
) |
This catches I/O errors occuring for fread(). In this case we better stop.
bool read_simdata | ( | void | ) |
read
double second | ( | void | ) |
returns the number of cpu-ticks in seconds that have elapsed, or the wall-clock time obtained with MPI_Wtime().
void setup_io | ( | void | ) |
calls the appropriate c++ routines that check the number of files on the disk and set some global variables.
double timediff | ( | double | t0, | |
double | t1 | |||
) |
returns the time difference between two measurements obtained with second(). The routine takes care of the possible overflow of the tick counter on 32bit systems, but depending on the system, this may not always work properly. Similarly, in some MPI implementations, the MPI_Wtime() function may also overflow, in which case a negative time difference would be returned. The routine returns instead a time difference equal to 0.