| 1 | #ifndef helpers_h | 
|---|
| 2 | #define helpers_h | 
|---|
| 3 | /** \file helpers.h | 
|---|
| 4 | * Header file for \ref helpers.c | 
|---|
| 5 | * | 
|---|
| 6 | * Contains declarations of the functions implemented in \ref helpers.c and one | 
|---|
| 7 | * inline function which gets current time via an MPI call: GetTime(). | 
|---|
| 8 | * | 
|---|
| 9 | Project: ParallelCarParrinello | 
|---|
| 10 | Jan Hamaekers | 
|---|
| 11 | 2000 | 
|---|
| 12 |  | 
|---|
| 13 | File: helpers.h | 
|---|
| 14 | $Id: helpers.h,v 1.9 2007/02/09 09:13:48 foo Exp $ | 
|---|
| 15 | */ | 
|---|
| 16 |  | 
|---|
| 17 | #include<stddef.h> /* fuer size_t */ | 
|---|
| 18 |  | 
|---|
| 19 | void debug(struct Problem *P, const char *output); | 
|---|
| 20 | /* Eigene malloc, die bei einem Fehler an Error output uebergibt */ | 
|---|
| 21 | void* Malloc(size_t size, const char* output); | 
|---|
| 22 |  | 
|---|
| 23 | char* MallocString(size_t size, const char* output); | 
|---|
| 24 |  | 
|---|
| 25 | /* Eigene malloc, die bei einem Fehler erzeugten (ein int rein) output  an Error uebergibt */ | 
|---|
| 26 | void* Malloci(size_t size, const char* output, int i); | 
|---|
| 27 |  | 
|---|
| 28 | /* Eigene malloc, die bei einem Fehler erzeugten (zwei int rein) output  an Error uebergibt */ | 
|---|
| 29 | void* Mallocii(size_t size, const char* output, int i, int j); | 
|---|
| 30 |  | 
|---|
| 31 | /* Dasselbe wie oben mit realloc */ | 
|---|
| 32 | void* Realloc(void* pointer, size_t size, const char* output); | 
|---|
| 33 | void* Realloci(void* pointer, size_t size, const char* output, int i); | 
|---|
| 34 | void* Reallocii(void* pointer, size_t size, const char* output, int i, int j); | 
|---|
| 35 | void Free (void *ptr); | 
|---|
| 36 |  | 
|---|
| 37 | void GetRGB(int i, unsigned int max, double* rgb); | 
|---|
| 38 |  | 
|---|
| 39 | /** Get current time. | 
|---|
| 40 | * Uses MPI_Wtime() to get current system time, synchronously for all processes. | 
|---|
| 41 | * \return current time | 
|---|
| 42 | */ | 
|---|
| 43 | static inline /*@unused@*/ double GetTime(void) | 
|---|
| 44 | { | 
|---|
| 45 | double t; | 
|---|
| 46 | t = MPI_Wtime(); | 
|---|
| 47 | return t; | 
|---|
| 48 | }; | 
|---|
| 49 |  | 
|---|
| 50 | void InitSpeedMeasure(struct Problem *P); | 
|---|
| 51 | void SpeedMeasure(struct Problem *P, enum TimeTypes TT, enum TimeDoTypes TOT); | 
|---|
| 52 | void CompleteSpeedMeasure(struct Problem *P); | 
|---|
| 53 | void StartParallel (struct Problem *P, char **argv); | 
|---|
| 54 | void WaitForOtherProcs(struct Problem *P, int out); | 
|---|
| 55 | /*void SetArrayToDouble0(double *a, int n);*/ | 
|---|
| 56 | void RemoveEverything(struct Problem *P); | 
|---|
| 57 | #endif | 
|---|