| 1 |
// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root |
| 2 |
// SPDX-License-Identifier: LGPL-2.1-or-later |
| 3 |
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
| 4 |
// vi: set et ts=4 sw=2 sts=2: |
| 5 |
/****************************************************************************/ |
| 6 |
/* */ |
| 7 |
/* File: stat.c */ |
| 8 |
/* */ |
| 9 |
/* Purpose: DDD statistical evaluation */ |
| 10 |
/* */ |
| 11 |
/* Author: Klaus Birken */ |
| 12 |
/* Rechenzentrum Uni Stuttgart */ |
| 13 |
/* Universitaet Stuttgart */ |
| 14 |
/* Allmandring 30 */ |
| 15 |
/* 70550 Stuttgart */ |
| 16 |
/* internet: [email protected] */ |
| 17 |
/* */ |
| 18 |
/* History: 95/01/16 kb begin */ |
| 19 |
/* */ |
| 20 |
/* Remarks: */ |
| 21 |
/* */ |
| 22 |
/****************************************************************************/ |
| 23 |
|
| 24 |
/****************************************************************************/ |
| 25 |
/* */ |
| 26 |
/* include files */ |
| 27 |
/* system include files */ |
| 28 |
/* application include files */ |
| 29 |
/* */ |
| 30 |
/****************************************************************************/ |
| 31 |
|
| 32 |
/* standard C library */ |
| 33 |
#include <config.h> |
| 34 |
#include <cstdlib> |
| 35 |
#include <cstdio> |
| 36 |
#include <stdarg.h> |
| 37 |
|
| 38 |
#include <dune/uggrid/parallel/ddd/dddi.h> |
| 39 |
|
| 40 |
|
| 41 |
/****************************************************************************/ |
| 42 |
/* */ |
| 43 |
/* defines in the following order */ |
| 44 |
/* */ |
| 45 |
/* compile time constants defining static data size (i.e. arrays) */ |
| 46 |
/* other constants */ |
| 47 |
/* macros */ |
| 48 |
/* */ |
| 49 |
/****************************************************************************/ |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
/****************************************************************************/ |
| 54 |
/* */ |
| 55 |
/* definition of exported global variables */ |
| 56 |
/* */ |
| 57 |
/****************************************************************************/ |
| 58 |
|
| 59 |
/* Storage for statistical data (compile with option -DStatistics) |
| 60 |
Caution: statistics should be used via macros in dddi.h! */ |
| 61 |
|
| 62 |
#ifdef Statistics |
| 63 |
STAT_DATA stat_data; |
| 64 |
#endif |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
/****************************************************************************/ |
| 69 |
/* */ |
| 70 |
/* definition of variables global to this source file only (static!) */ |
| 71 |
/* */ |
| 72 |
/****************************************************************************/ |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
/****************************************************************************/ |
| 78 |
/* */ |
| 79 |
/* routines */ |
| 80 |
/* */ |
| 81 |
/****************************************************************************/ |
| 82 |
START_UGDIM_NAMESPACE |
| 83 |
|
| 84 |
void ddd_StatInit (void) |
| 85 |
{ |
| 86 |
#ifdef Statistics |
| 87 |
stat_data.curr_module = 0; |
| 88 |
#endif |
| 89 |
} |
| 90 |
|
| 91 |
|
| 92 |
void ddd_StatExit (void) |
| 93 |
{} |
| 94 |
|
| 95 |
|
| 96 |
/****************************************************************************/ |
| 97 |
|
| 98 |
|
| 99 |
double DDD_StatClock (int module, int index) |
| 100 |
{ |
| 101 |
STAT_SET_MODULE(module); |
| 102 |
return(STAT_GETTIMER(index)); |
| 103 |
} |
| 104 |
|
| 105 |
long DDD_StatCount (int module, int index) |
| 106 |
{ |
| 107 |
STAT_SET_MODULE(module); |
| 108 |
return(STAT_GETCOUNT(index)); |
| 109 |
} |
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
const char *DDD_StatClockDesc (int module, int index) |
| 114 |
{ |
| 115 |
STAT_SET_MODULE(module); |
| 116 |
return("<NIY>"); |
| 117 |
} |
| 118 |
|
| 119 |
const char *DDD_StatCountDesc (int module, int index) |
| 120 |
{ |
| 121 |
STAT_SET_MODULE(module); |
| 122 |
return("<NIY>"); |
| 123 |
} |
| 124 |
|
| 125 |
|
| 126 |
/****************************************************************************/ |
| 127 |
|
| 128 |
END_UGDIM_NAMESPACE |