/[escript]/trunk/esysUtils/src/blocktimer.h
ViewVC logotype

Contents of /trunk/esysUtils/src/blocktimer.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2078 - (show annotations)
Thu Nov 20 16:10:10 2008 UTC (10 years, 5 months ago) by phornby
File MIME type: text/plain
File size: 998 byte(s)
Two changes.

1. Move blocktimer from escript to esysUtils.
2. Make it possible to link to paso as a DLL or .so.

Should have no effect on 'nix's

In respect of 1., blocktimer had begun to spring up everywhere, so
for the moment I thought it best to move it to the only other library that
pops up all over the place.

In respect of 2., paso needed to be a DLL in order to use the windows intelc /fast
option, which does aggressive multi-file optimisations. Even in its current form, it either
vectorises or parallelises  hundreds more loops in the esys system than appear in the pragmas.

In achieving 2. I have not been too delicate in adding

PASO_DLL_API

declarations to the .h files in paso/src. Only toward the end of the process of
the conversion, when the number of linker errors dropped below 20, say, did I choosy about what
functions in a header I declared PASO_DLL_API. As a result, there are likely to be many routines
declared as external functions symbols that are in fact internal to the paso DLL. 
Why is this an issue?  It prevents the intelc compiler from getting aggressive on the paso module.
With pain there is sometimes gain. At least all the DLL rules in windows give good
(non-microsoft) compiler writers a chance to really shine.

So, if you should see a PASO_DLL_API on a function in a paso header file,
and think to yourself, "that function is only called in paso, why export it?", then feel free to
delete the PASO_DLL_API export declaration.

Here's hoping for no breakage.....
1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2008 by University of Queensland
5 * Earth Systems Science Computational Center (ESSCC)
6 * http://www.uq.edu.au/esscc
7 *
8 * Primary Business: Queensland, Australia
9 * Licensed under the Open Software License version 3.0
10 * http://www.opensource.org/licenses/osl-3.0.php
11 *
12 *******************************************************/
13
14
15 #ifndef blocktimer_h
16 #define blocktimer_h
17
18 #include <stdio.h>
19 #include <search.h>
20 #include "system_dep.h"
21
22 /* Enable the block timer (or remove this and use -DBLOCKTIMER) */
23 /* # define BLOCKTIMER */
24
25 # define NUM_TIMERS 1024
26
27 ESYSUTILS_DLL_API
28 void blocktimer_initialize();
29 ESYSUTILS_DLL_API
30 void blocktimer_increment(__const char *name, double start_time);
31 ESYSUTILS_DLL_API
32 int blocktimer_getOrCreateTimerId(__const char *name);
33 ESYSUTILS_DLL_API
34 void blocktimer_reportSortByName();
35 ESYSUTILS_DLL_API
36 void blocktimer_reportSortByTime();
37 ESYSUTILS_DLL_API
38 double blocktimer_time();
39
40
41 #endif

  ViewVC Help
Powered by ViewVC 1.1.26