#ifndef helpers_h #define helpers_h /** \file helpers.h * Header file for \ref helpers.c * * Contains declarations of the functions implemented in \ref helpers.c and one * inline function which gets current time via an MPI call: GetTime(). * Project: ParallelCarParrinello Jan Hamaekers 2000 File: helpers.h $Id: helpers.h,v 1.9 2007/02/09 09:13:48 foo Exp $ */ #include /* fuer size_t */ void debug(struct Problem *P, const char *output); /* Eigene malloc, die bei einem Fehler an Error output uebergibt */ void* Malloc(size_t size, const char* output); char* MallocString(size_t size, const char* output); /* Eigene malloc, die bei einem Fehler erzeugten (ein int rein) output an Error uebergibt */ void* Malloci(size_t size, const char* output, int i); /* Eigene malloc, die bei einem Fehler erzeugten (zwei int rein) output an Error uebergibt */ void* Mallocii(size_t size, const char* output, int i, int j); /* Dasselbe wie oben mit realloc */ void* Realloc(void* pointer, size_t size, const char* output); void* Realloci(void* pointer, size_t size, const char* output, int i); void* Reallocii(void* pointer, size_t size, const char* output, int i, int j); void Free (void *ptr); void GetRGB(int i, unsigned int max, double* rgb); /** Get current time. * Uses MPI_Wtime() to get current system time, synchronously for all processes. * \return current time */ static inline /*@unused@*/ double GetTime(void) { double t; t = MPI_Wtime(); return t; }; void InitSpeedMeasure(struct Problem *P); void SpeedMeasure(struct Problem *P, enum TimeTypes TT, enum TimeDoTypes TOT); void CompleteSpeedMeasure(struct Problem *P); void StartParallel (struct Problem *P, char **argv); void WaitForOtherProcs(struct Problem *P, int out); /*void SetArrayToDouble0(double *a, int n);*/ void RemoveEverything(struct Problem *P); #endif