source: trunk/ADOL-C/include/adolc/taping.h @ 608

Last change on this file since 608 was 608, checked in by kulshres, 4 years ago

merge branch 'master' of 'gitclone' into 'svn'

The following commits have been merged:

commit 48aee4916d2ed907b772dbd1c1d6ce46cb273651
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Mon Aug 10 21:28:49 2015 +0200

modernise configure.ac

disable static library building. this causes more
problems than it solves.

commit 47332811a4c5c27cb884f75792c910c813378ef4
Merge: 0ee77fd 0d4eeec
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Aug 6 22:33:46 2015 +0200

Merge branch 'edf-memory'

This is to reduce memory allocation and copying in ext_diff_fct

commit 0ee77fd33a1d6d55fcc67ad419937b2cb777ed4e
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Wed Aug 5 15:49:33 2015 +0200

Remove empty file from dist

this can be created during compilation

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 51505c34571aa61b4b21ebce6cdf1728ff56ddaa
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Tue Aug 4 17:36:26 2015 +0200

adouble(const adub&) should match operator=(const adub&)

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 03e49097aa0455337647d280cda530064987e6b9
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Fri Jul 3 11:17:53 2015 +0200

make a define for default contiguous locations

this is not needed during compilation of the library
only during compilation of user-code, if the user
wants to have all adouble* allocations to have
contiguous locations.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit f00cfb5d0dc8a8993581fd8c08dd8c6c5cd23248
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Wed Jul 1 11:56:39 2015 +0200

rename adolc_lie.h to drivers.h

the old name led to an include <adolc/lie/adolc_lie.h>
which looks highly redundant.
new name makes for include <adolc/lie/drivers.h>

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit fcf78bf8426a227750a0bcaa32ff65e57ef329b8
Author: franke <mirko.franke@…>
Date: Wed May 20 16:39:16 2015 +0200

added Lie drivers

commit 0d4eeec7b6212aa64c8997db8a511f81b604b3e1
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Fri Jun 26 14:19:41 2015 +0200

minimise extra memory requirement and copies in ext_diff

This should in theory reduce the amount of memory required
to run an external function with the old interface. It also
reduced some copying operations.

Fingers crossed that we've not broken checkpointing and/or
fixpoint iterations.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 8811f02a4d4a15946a18f7513ab17dada66509c3
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Fri May 22 12:41:45 2015 +0200

try to streamline data copies in ext_diff_v2

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

  • Property svn:keywords set to Author Date Id Revision
File size: 5.1 KB
Line 
1/*----------------------------------------------------------------------------
2 ADOL-C -- Automatic Differentiation by Overloading in C++
3 File:     taping.h
4 Revision: $Id: taping.h 608 2015-08-10 20:06:55Z kulshres $
5 Contents: all C functions directly accessing at least one of the four tapes
6           (operations, locations, constants, value stack)
7
8 Copyright (c) Andrea Walther, Andreas Griewank, Andreas Kowarz,
9               Hristo Mitev, Sebastian Schlenkrich, Jean Utke, Olaf Vogel
10 
11 This file is part of ADOL-C. This software is provided as open source.
12 Any use, reproduction, or distribution of the software constitutes
13 recipient's acceptance of the terms of the accompanying license file.
14 
15----------------------------------------------------------------------------*/
16#if !defined(ADOLC_TAPING_H)
17#define ADOLC_TAPING_H 1
18
19#include <adolc/internal/common.h>
20
21BEGIN_C_DECLS
22
23enum StatEntries {
24    NUM_INDEPENDENTS,                          /* # of independent variables */
25    NUM_DEPENDENTS,                              /* # of dependent variables */
26    NUM_MAX_LIVES,                                /* max # of live variables */
27    TAY_STACK_SIZE,               /* # of values in the taylor (value) stack */
28    OP_BUFFER_SIZE,   /* # of operations per buffer == OBUFSIZE (usrparms.h) */
29    NUM_OPERATIONS,                               /* overall # of operations */
30    OP_FILE_ACCESS,                        /* operations file written or not */
31    NUM_LOCATIONS,                                 /* overall # of locations */
32    LOC_FILE_ACCESS,                        /* locations file written or not */
33    NUM_VALUES,                                       /* overall # of values */
34    VAL_FILE_ACCESS,                           /* values file written or not */
35    LOC_BUFFER_SIZE,   /* # of locations per buffer == LBUFSIZE (usrparms.h) */
36    VAL_BUFFER_SIZE,      /* # of values per buffer == CBUFSIZE (usrparms.h) */
37    TAY_BUFFER_SIZE,     /* # of taylors per buffer <= TBUFSIZE (usrparms.h) */
38    NUM_EQ_PROD,                      /* # of eq_*_prod for sparsity pattern */
39    NO_MIN_MAX,  /* no use of min_op, deferred to abs_op for piecewise stuff */
40    NUM_SWITCHES,                   /* # of abs calls that can switch branch */
41    NUM_PARAM, /* no of parameters (doubles) interchangable without retaping */
42    STAT_SIZE                     /* represents the size of the stats vector */
43};
44
45enum TapeRemovalType {
46    ADOLC_REMOVE_FROM_CORE,
47    ADOLC_REMOVE_COMPLETELY
48};
49
50/* Returns statistics on the tape "tag". Use enumeration StatEntries for
51 * accessing the individual elements of the vector "tape_stats"! */
52ADOLC_DLL_EXPORT void tapestats(short tag, size_t *tape_stats);
53
54/* An all-in-one tape stats printing routine */
55ADOLC_DLL_EXPORT void printTapeStats(FILE *stream, short tag);
56
57ADOLC_DLL_EXPORT int removeTape(short tapeID, short type);
58
59ADOLC_DLL_EXPORT void enableBranchSwitchWarnings();
60ADOLC_DLL_EXPORT void disableBranchSwitchWarnings();
61
62ADOLC_DLL_EXPORT void enableMinMaxUsingAbs();
63ADOLC_DLL_EXPORT void disableMinMaxUsingAbs();
64/*
65 * free location block sorting/consolidation upon calls to ensureContiguousLocations
66 * happens when  the ratio between allocated and used locations exceeds gcTriggerRatio or
67 * the allocated locations exceed gcTriggerMaxSize
68 */
69ADOLC_DLL_EXPORT void setStoreManagerControl(double gcTriggerRatio, size_t gcTriggerMaxSize);
70
71END_C_DECLS
72
73/**
74 * Normally, theKeeper would take care of the initialization and finalization
75 * of ADOL-C. However, some compilers do not include the keeper code when
76 * linking. "initADOLC" should be called right after main(...), in this case.
77 * "initADOLC" will not initialize memory, but is only necessary to reference
78 * "theKeeper", such that this static instance is used at least once. :-(
79 */
80ADOLC_DLL_EXPORT void initADOLC();
81
82#if defined(__cplusplus)
83
84/* Initialization for the taping process. Creates buffers for this tape, sets
85 * files names, and calls appropriate setup routines.
86 * This functions return value is different from zero if a tape with with ID
87 * tnum is available only in core. The old tape gets overwritten by the new
88 * one in this case. */
89ADOLC_DLL_EXPORT int trace_on(short tnum, int keepTaylors = 0);
90
91/* special version including buffersize customization
92 *      obs - size of the operation buffer (number of elements)
93 *      lbs - size of the location buffer (number of elements)
94 *      vbs - size of the value buffer (number of elements)
95 *      tbs - size of the taylor buffer (number of elements)
96 * trace_on is the last point in time we want to allow the change of buffer
97 * sizes for a given tape */
98ADOLC_DLL_EXPORT int trace_on(short tnum, int keepTaylors,
99        uint obs, uint lbs, uint vbs, uint tbs, int skipFileCleanup=0);
100
101/* Stop Tracing. Cleans up, and turns off trace_flag. Flag not equal zero
102 * enforces writing of the three main tape files (op+loc+val). */
103ADOLC_DLL_EXPORT void trace_off(int flag = 0);
104
105ADOLC_DLL_EXPORT bool isTaping();
106
107ADOLC_DLL_EXPORT void skip_tracefile_cleanup(short tnum);
108
109ADOLC_DLL_EXPORT void set_nested_ctx(short tag, char nested);
110
111#include <vector>
112ADOLC_DLL_EXPORT void cachedTraceTags(std::vector<short>& result);
113
114#endif
115
116#endif /* ADOLC_TAPING_H */
Note: See TracBrowser for help on using the repository browser.