source: trunk/ADOL-C/src/storemanager.h @ 439

Last change on this file since 439 was 439, checked in by kulshres, 6 years ago

Merged 'ampi' changes from Jean Utke <utke@…>

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>
Acked-by: Andrea Walther <andrea.walther@…>

The following commits were merged:

commit a08916181e7dbe9608cab4419ad70c057f485270
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Nov 7 12:37:44 2013 +0100

If built with AMPI support rename the output library to libadolc_ampi

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>
Acked-by: Andrea Walther <andrea.walther@…>

commit 34c092c8a47c6c0d52bdc685164398b867a549ef
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Nov 7 09:25:55 2013 +0100

Revert "separate out AMPI implementation from the traditional library"

This may cause problems with incompatible versions of the compiler
that is behind mpicc/mpicxx and $CC/$CXX. (Although in my opinion
this is a broken setup).

This reverts commit 10253b63f309d4e858e9cab6a803be112b46b818.

commit 10253b63f309d4e858e9cab6a803be112b46b818
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Wed Nov 6 15:41:19 2013 +0100

separate out AMPI implementation from the traditional library

this allows for compilation with ampi enabled, but still be able to
use the library for non-mpi/ampi applications by simply linking to
libadolc. For mpi/ampi the user should link to libadolc_ampi and libadolc

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

commit 48922378ec069ed08d732ef8f30f0b751381714e
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Tue Nov 5 13:16:09 2013 +0100

Add authorships and missing file preambles

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

commit 69bfc3eb6618891bdbeb0e4990da971c3bd52c04
Author: Jean Utke <utke@…>
Date: Wed Oct 23 15:19:30 2013 -0500

adapt to interface changes done by Laurent

commit 8752b2db8b7d341e11d53fdc1eba85d28e7ff4b3
Author: Jean Utke <utke@…>
Date: Wed Oct 23 11:29:13 2013 -0500

flip to order so as to not try to access (potentially uninitialized) buffer when count is 0

commit 926d5f5fc68ccebadc4b6c4a842c23fd4beaa5bd
Author: Jean Utke <utke@…>
Date: Mon Oct 21 22:25:30 2013 -0500

cleanup these types

commit 44e478edf30c7e2abb8fc25c44baa3c23f983a17
Author: Jean Utke <utke@…>
Date: Mon Oct 21 15:39:34 2013 -0500

fix memory leak

commit fc1154661cd3558dedbfa199d0be81403ddabbf5
Merge: ea3e23a 5c5e99f
Author: Jean Utke <utke@…>
Date: Wed Oct 9 09:50:59 2013 -0500

Merge branch 'master' into ampi

commit ea3e23ae020d1953b8730a50f1c79a90f9e6928c
Author: Jean Utke <utke@…>
Date: Tue Oct 8 23:13:38 2013 -0500

should not use C++ style comments in C files

commit cfc83b0f48f18921b97ac315710340fdd3269cfa
Author: Jean Utke <utke@…>
Date: Tue Oct 8 22:49:49 2013 -0500

an immediate problem is the use of C++ style comments "" in a header file included by C sources.
while removing this problem we also simplify the logic.

commit 30e873e7b26314b784276b42c7de5dff99f6d560
Author: Jean Utke <utke@…>
Date: Tue Oct 8 14:37:29 2013 -0500

without this additional case the wrong "fixes" are applied to the clang compiler regardless if one is under cygwin or not - somebody who builds on cygwin should try to find out if these libtool "fixes" below still are truly needed...

commit ab0dbe49d5c328cff38a59dc484e9cc55120b050
Author: Jean Utke <utke@…>
Date: Fri Oct 4 15:43:20 2013 -0500

fix (un)packing for fos_forward and indentation

commit d74625e07355b3eead19f7347d098ee7d4f0ad5f
Author: Jean Utke <utke@…>
Date: Fri Oct 4 15:42:32 2013 -0500

set work modes

commit 97d60945babadd17a1d6f1d7163a2b40fb058429
Author: Jean Utke <utke@…>
Date: Fri Oct 4 11:06:38 2013 -0500

provide a setup for forward mode MPI_PROD and some logic for operation creation

commit b5e9158a4f94a448a4ee89bcb40c5c7f29b8694f
Author: Jean Utke <utke@…>
Date: Thu Oct 3 14:59:41 2013 -0500

need to deref ...

commit 440b728a2a464e416d24dfb2860e12ac832c3d45
Author: Jean Utke <utke@…>
Date: Thu Oct 3 11:33:48 2013 -0500

first stab at implementation

commit 6188fa5a97d3c128766b0239961fb5ee2280db64
Author: Jean Utke <utke@…>
Date: Thu Oct 3 11:33:06 2013 -0500

refactor taylor_begin to make sure the tape infos always have the buffer pointer for the forward run (and associated dimensions) regarless of Taylors being kept or not

commit 3b95b9d906bf4d0583c24aecf7d94440ed09a582
Author: Jean Utke <utke@…>
Date: Thu Oct 3 11:31:21 2013 -0500

comments only

commit af477e37a356d3c1c1bcc8fd7d9b59d80b395077
Author: Jean Utke <utke@…>
Date: Wed Oct 2 01:06:19 2013 -0500

ADOLC_TLM versions for forward mode

commit 2ce670537a2e2960ecf6c24b533f817c1c630307
Author: Jean Utke <utke@…>
Date: Tue Oct 1 16:12:52 2013 -0500

improve the logic to avoid consolidation and add some debugging info to gauge how frequently consolidation happens

commit 8a1b237c3c20208f0f72a4406c48a536305bc2eb
Author: Jean Utke <utke@…>
Date: Tue Oct 1 11:08:07 2013 -0500

don't leave bad pointer values around

commit 4e04dbe83f222cd434b967a5876b28137c50ed02
Author: Jean Utke <utke@…>
Date: Mon Sep 30 15:45:44 2013 -0500

without these a build in a separate build directory fails because the preprocessor cannot find adolc/adolc_settings.h

commit 57fdb4f40899c34936d442d2d8880c42668aebe2
Author: Jean Utke <utke@…>
Date: Fri Sep 27 12:16:01 2013 -0500

add logic to prevent any attempts to clean up tape/trace files which can be useful if file operations take a long time, e.g. on slow parallel file systems

commit e2b09cf9dba2b48897a3ffac68af007c1aaf5317
Author: Jean Utke <utke@…>
Date: Tue Sep 24 16:00:08 2013 -0500

first stab at adding some control logic to the way the garbage collection works for free locations

commit d94bb3a5cef3abae2a56837fc276f2ada01d9fe5
Author: Jean Utke <utke@…>
Date: Tue Sep 17 13:24:03 2013 -0500

fix printing logic

commit de44b3d7a14d34fa9102b37bdf5fa7663bab9048
Author: Jean Utke <utke@…>
Date: Tue Sep 17 13:23:45 2013 -0500

typo

commit e90b19dc764e0de8620a45e997c68baebdfb4077
Author: Jean Utke <utke@…>
Date: Tue Sep 17 01:37:13 2013 -0500

because we have the guards in place avoiding the access of values that have not been set in the MPI_IN_PLACE case (shown by valgrind) we do not need to use calloc here

commit 908d9aefe2cb8fec12d747f8e67f9181e919f77c
Author: Jean Utke <utke@…>
Date: Mon Sep 16 21:59:34 2013 -0500

avoid writing uninitialized values to file

commit 7b925083fdf9cb8e465a0984942e1769055b0ae3
Author: Jean Utke <utke@…>
Date: Mon Sep 16 21:59:06 2013 -0500

get the proper output here

commit b5a4c1da51f55c8b0711940f9f58373a3ece1017
Author: Jean Utke <utke@…>
Date: Mon Sep 16 21:48:31 2013 -0500

if this is not zeroed out and we have MPI_IN_PLACE then for that root
segment the temp buffer will not receive anything but later on we will
do an adjoint increment which could go wrong; the alternative would be
to preempt the adjoint increment for that segment.

commit bb6cbecafbc3be1d783861dd764662b9d64bf8e2
Merge: 2d4a680 a2d2de1
Author: Jean Utke <utke@…>
Date: Thu Sep 12 15:05:50 2013 -0500

Merge commit 'a2d2de1c5def616fc04e15f624211856656e68a3' into ampi

Conflicts:

ADOL-C/src/ampisupport.cpp

commit 2d4a6801a51714e2c76b74fa857e1e3599d3a773
Author: Jean Utke <utke@…>
Date: Wed Sep 11 22:15:43 2013 -0500

change to avoid writing uninitialized data in the remainder part to the file - valgrind marks this - shouldn't be an actual problem but it doesn't cost much to make this clean

commit 086fd3030e9488ddfc7895cc9841ab84c3f05257
Author: Jean Utke <utke@…>
Date: Wed Sep 11 13:19:15 2013 -0500

avoid looking at the location for the all -null case when the buffer may be invalid

commit 722b71770bae88ca565a5e412260f6637d88f735
Author: Jean Utke <utke@…>
Date: Tue Sep 10 14:56:38 2013 -0500

take care of the all null counts case

commit f8529cdd961c0afd01c6a6bc493ae6bb2637841a
Author: Jean Utke <utke@…>
Date: Tue Sep 10 13:51:12 2013 -0500

make sense of the bit counts

commit da156dbe72f0b5e6cbba9fb9f9848c224c9f4502
Author: Jean Utke <utke@…>
Date: Tue Sep 10 13:39:40 2013 -0500

refactor assertion logic (done only for cases with non-userdefined types)

commit 47236cdc38958c8ee7dc51a6e87cf2b470e76335
Author: Jean Utke <utke@…>
Date: Mon Sep 9 10:29:11 2013 -0500

mpi_in_place is allowed only for rank root - openmpi complains and fails without this fix

commit d6f9c7196ebb4089e2e09ea125c8e33b6030039b
Author: Jean Utke <utke@…>
Date: Fri Sep 6 12:41:32 2013 -0500

replicate MPI_IN_PLACE chnages previously done for gather/scatter now for gatherv/scatterv

commit d4f5217add03d572660d7c094b0d30eab02eb091
Author: Jean Utke <utke@…>
Date: Fri Sep 6 10:02:04 2013 -0500

logic to deal with MPI_IN_PLACE

commit e1ae70b5c52ff9e99df79b63f06ca4a9655ad5b2
Author: Jean Utke <utke@…>
Date: Fri Sep 6 08:56:11 2013 -0500

various fixes to the tapedoc so the ouput makes actual sense

commit a2d2de1c5def616fc04e15f624211856656e68a3
Author: Anton Bovin <fatherdeus@…>
Date: Fri Sep 6 00:51:42 2013 -0500

support for embedding structs in other structs

commit 4d58d15e603eb3f35c22d00b80e56ab27c16df84
Merge: bb6e202 128b649
Author: Anton Bovin <fatherdeus@…>
Date: Fri Sep 6 00:39:42 2013 -0500

Merge branch 'ampi' of http://git.mcs.anl.gov/adol-c into ampi

commit bb6e20218a68a31e3a30392af4ac63bf2bfaeb60
Author: Anton Bovin <fatherdeus@…>
Date: Wed Sep 4 14:26:45 2013 -0500

changed some code for efficiency and neatness, fixed allocateTempActiveBuf, implemented releaseTempActiveBuf

commit 128b649f628ed0d59641b70e95f652930d635ee7
Author: Jean Utke <utke@…>
Date: Wed Aug 28 22:37:06 2013 -0500

tapedoc forward / reverse implementation

commit 847f3f83d2ae109e44d613b68ad1441c09951096
Author: Jean Utke <utke@…>
Date: Wed Aug 28 22:35:55 2013 -0500

can't enforce the locint in the interface - it is defined to be unsigned and that may not match right away to the use; have to hope that locint size matches int size

commit 57b0b0c0cdcc326eca307ccbc923ea5fe3da83e1
Author: Jean Utke <utke@…>
Date: Tue Aug 27 17:42:12 2013 -0500

implement (part I) the variant to the external function with an expanded signature

  • remove crud from BUFFER template - locking down the first pointer type just gives trouble in the implementation and doesn't really add any more sanity to the buffer class
  • remove crud from the edf initialization
  • adapt checkpointing to the above
  • refactor the edf call to share prior and post call logic of the plain EDF variant with the newly expanded one

commit 36523c6e5c4284498b3309447e17866767a50b15
Author: Jean Utke <utke@…>
Date: Tue Aug 27 17:38:34 2013 -0500

add a variant to the external function with an expanded signature

commit 749a20f85d5722aa7b28ec2343ce5db98925521e
Author: Jean Utke <utke@…>
Date: Tue Aug 27 17:37:49 2013 -0500

allow for a putting a specified number of locations and thus make sure we have enough space...

commit 5e95f0533a68b8457fce2b479af902dffaddbee4
Author: Jean Utke <utke@…>
Date: Tue Aug 27 17:36:50 2013 -0500

add a variant to the external function with an expanded signature

commit be68973e63698c93f6f03b336b387ff67571db17
Author: ubuntu <fatherdeus@fatherdeus.(none)>
Date: Wed Aug 21 14:38:21 2013 -0500

function pointers for active buffer functions

commit 5f8137dc79155b59f0f72ba864604c585ab3dc2d
Merge: 452b268 309fc69
Author: ubuntu <fatherdeus@fatherdeus.(none)>
Date: Wed Aug 21 11:29:48 2013 -0500

Merge branch 'ampi' of http://git.mcs.anl.gov/adol-c into ampi

commit 452b26882f0d27bc393bbaa71a4b0751e1d34f7a
Author: ubuntu <fatherdeus@fatherdeus.(none)>
Date: Wed Aug 21 11:29:22 2013 -0500

functions to allocate and copy buffers containing active values

commit 309fc69e68a3c0a9cf9840cbdc72432180a0dcf7
Author: Jean Utke <utke@…>
Date: Wed Aug 21 00:31:02 2013 -0500

remaining function pointers

commit 4338c2042d4e6b8ad1d12f3426546cf19492e516
Author: Jean Utke <utke@…>
Date: Wed Aug 21 00:05:42 2013 -0500

8 more function pointers

commit 6eebfd181d5810e1d409f3972550397328e54e12
Author: Jean Utke <utke@…>
Date: Tue Aug 20 23:40:21 2013 -0500

9 more function pointers

commit 393ca02a79ed7dc362892855feb57c6924d986b3
Author: Jean Utke <utke@…>
Date: Tue Aug 20 18:02:05 2013 -0500

6 more function pointers

commit 45751dcfb55c2035c208bbde1dfc4ba57e2d67cf
Author: Jean Utke <utke@…>
Date: Tue Aug 20 17:39:13 2013 -0500

12 more function pointers used

commit 25730c27ce1f62e2ca6546be13bfbb2af10955f7
Author: Jean Utke <utke@…>
Date: Tue Aug 20 15:50:53 2013 -0500

start using the function pointers - here done for the bcast push/pop as a sanity test before we expand to all of them.

commit 3b18d41c7024881aa79c7a6b38c7452841e2494a
Author: loremipsum14 <fatherdeus@…>
Date: Fri Aug 16 15:47:15 2013 -0500

testing function for temp adouble buffer

commit 2685286e7e355b63aaa6fa7e95f3d85cbbe78265
Author: loremipsum14 <fatherdeus@…>
Date: Fri Aug 16 13:30:17 2013 -0500

removed MPI_LB/UB, shortened type-mapping function names

commit 3f8441b1125cda2837fbe145cced1df8623c7ae2
Merge: d8d5114 20cb519
Author: loremipsum14 <fatherdeus@…>
Date: Thu Aug 15 13:30:20 2013 -0500

Merge branch 'ampi' of http://git.mcs.anl.gov/adol-c into ampi

commit d8d51145a61710a0a7cf0bfc68e7627e14314273
Author: loremipsum14 <fatherdeus@…>
Date: Thu Aug 15 13:29:23 2013 -0500

MPI_LB in pack/unpack, functions to map types for MPI transfer, derived types in getAdjointCount and pushBcastInfo

commit 20cb519f2f9b1b3d4b3a4a02c049a5d88c5fa32c
Author: Jean Utke <utke@…>
Date: Wed Aug 14 17:24:18 2013 -0500

barrier implementation

commit ac8ecf84328d445aafcd89eaee135cfb0297fcb1
Author: Jean Utke <utke@…>
Date: Wed Aug 14 01:05:10 2013 -0500

allreduce implementation

commit e6c42d9d7a3013bc4399af538ad581cfd33c853a
Author: Jean Utke <utke@…>
Date: Tue Aug 13 16:48:28 2013 -0500

allgatherv

commit 2781198180e1a5b8eed05fb6e495f8dc85420469
Author: Jean Utke <utke@…>
Date: Tue Aug 13 15:14:41 2013 -0500

adapt to interface change

commit f0b3cc09bc68bd50a72c5e804dca22e88b952163
Merge: 19f3a87 c8feb7d
Author: Jean Utke <utke@…>
Date: Tue Aug 13 13:09:30 2013 -0500

Merge branch 'ampi' of ssh://login.mcs.anl.gov/home/utke/GitMain/CodeReps/adolc into ampi

commit 19f3a87916a9b1e5f66dee1d40d5c0aa70a8d7de
Author: Jean Utke <utke@…>
Date: Tue Aug 13 13:09:05 2013 -0500

all gather implementation in tapedoc fo_rev

commit 2ee66f85083514a5c8734ccbd22f05a6562edbe9
Author: Jean Utke <utke@…>
Date: Tue Aug 13 13:08:45 2013 -0500

allgather support

commit cc09426611e2233d328904f086382ae2a5dccc3b
Author: Jean Utke <utke@…>
Date: Tue Aug 13 13:08:17 2013 -0500

op code of allgather

commit c8feb7d8b40d27dc971389c04df1e7cdc69ac92b
Author: loremipsum14 <fatherdeus@…>
Date: Tue Aug 13 13:03:28 2013 -0500

rawData_DType inputs, split popReduceInfo

commit 5d02100e8aba88d9a0164c69a536d0e1f8cd3802
Merge: 2f3a3b6 50e4db6
Author: loremipsum14 <fatherdeus@…>
Date: Mon Aug 12 14:29:11 2013 -0500

Merge branch 'ampi' of http://git.mcs.anl.gov/adol-c into ampi

commit 2f3a3b6811cb15dcc4bb53f554670c4111bf83ba
Author: loremipsum14 <fatherdeus@…>
Date: Mon Aug 12 12:01:00 2013 -0500

equality operation on buffers

commit 50e4db6227d7bf55d1aaf2b57117b2e0acbb61b4
Author: Jean Utke <utke@…>
Date: Mon Aug 12 10:13:47 2013 -0500

gather/scatter tapedoc

commit f352d54b1d50ddbfa4402b3b1ce6455a92deb8e5
Author: Jean Utke <utke@…>
Date: Mon Aug 12 10:13:33 2013 -0500

gather/scatter reverse mode

commit 849fbd87c3bb9ee8a210122dc9ab94fe65b724f7
Author: Jean Utke <utke@…>
Date: Mon Aug 12 10:13:12 2013 -0500

G/S push pop; renamed ADTOOL_AMPI_popGSVcommSizeForRootOrNull to ADTOOL_AMPI_popGScommSizeForRootOrNull following the AMPI change; op code mapping and gather/scatter forward implementation

commit 81c81a81dc382adfee32c16e4d616cc4d4f499c3
Author: Jean Utke <utke@…>
Date: Mon Aug 12 10:11:24 2013 -0500

add gather/scatter opcodes

commit 9236071e0f2bbeb2c2bafafc620c32499b13d4ca
Author: Jean Utke <utke@…>
Date: Fri Aug 9 12:41:11 2013 -0500

unify the AMPI tape resets in taping.c - can remove from tapedoc

commit cc0f25695026e5b18fede40a913239c543da172d
Author: Jean Utke <utke@…>
Date: Fri Aug 9 11:32:15 2013 -0500

need to reorder includes to get config.h

commit 8d8af07a872c79185d9ef6ef098627214a91e8fd
Author: Jean Utke <utke@…>
Date: Fri Aug 9 10:15:53 2013 -0500

wrap this

commit a27587851798129d7a1b53ecba10649a8e1b2067
Author: Jean Utke <utke@…>
Date: Thu Aug 8 14:00:54 2013 -0500

make execution of all push code conditional on
if (ADOLC_CURRENT_TAPE_INFOS.traceFlag) {

commit 78931b814d30d12fdcdc123654aef6b2bc418b45
Author: loremipsum14 <fatherdeus@…>
Date: Wed Aug 7 11:03:09 2013 -0500

moved type definitions here from AdjoinableMPI

commit 956af6b1405fa7809d564e40c47bc3d76a28c317
Merge: a340b5a a46e84a
Author: Jean Utke <utke@…>
Date: Tue Aug 6 15:58:14 2013 -0500

Merge branch 'ampi' into newAmpi

commit a340b5a7881eb3f628956ec7b757ae1eb5452f7f
Author: loremipsum14 <fatherdeus@…>
Date: Tue Aug 6 15:30:38 2013 -0500

added support for derived types

commit a46e84ab7d80300e4e3b8ae5e1590099876d96af
Merge: c20ab6a 4f5f245
Author: Jean Utke <utke@…>
Date: Tue Aug 6 14:28:29 2013 -0500

Merge branch 'master' into ampi

commit c20ab6aa59954fcf5f14111065b3c053a991052a
Merge: 6e3d93c dedbda2
Author: Jean Utke <utke@…>
Date: Tue Aug 6 14:20:49 2013 -0500

Merge branch 'ampi' of git.mcs.anl.gov:adol-c into ampi

Conflicts:

ADOL-C/src/ampisupport.cpp
ADOL-C/src/fo_rev.c
ADOL-C/src/oplate.h
ADOL-C/src/tapedoc/tapedoc.c

commit 6e3d93c40409549d59cf68a210780599fabfd990
Merge: 121013a 889d1d2
Author: Jean Utke <utke@…>
Date: Fri Jul 12 15:32:33 2013 -0500

Merge commit '889d1d22d15f0f198e6477cabfc70e247bfefd42' into HEAD

Conflicts:

ADOL-C/src/ampisupport.cpp
ADOL-C/src/fo_rev.c
ADOL-C/src/oplate.h
ADOL-C/src/tapedoc/tapedoc.c

commit dedbda2f8fdde0a636014995a78de2e65531ba84
Author: loremipsum14 <fatherdeus@…>
Date: Fri Jul 12 15:01:20 2013 -0500

conflicting defs in fo_rev fixed

commit 3102a1e1f1be083800ff37f891e77b3f1d604d1e
Merge: e2c8379 121013a
Author: loremipsum14 <fatherdeus@…>
Date: Thu Jul 11 17:22:35 2013 -0500

commit again after merge

commit e2c837904af0a90f8188ebc367935c80b76eeb93
Merge: 889d1d2 d1739a3
Author: loremipsum14 <fatherdeus@…>
Date: Thu Jul 11 17:10:46 2013 -0500

Merge ssh://login.mcs.anl.gov/home/utke/GitMain/CodeReps/adolc into ampi

commit 889d1d22d15f0f198e6477cabfc70e247bfefd42
Author: loremipsum14 <fatherdeus@…>
Date: Thu Jul 11 16:50:48 2013 -0500

removed int rank from tapedoc.c

commit 550bc68878cd2b2a3058ae8c0602058676609603
Author: loremipsum14 <fatherdeus@…>
Date: Thu Jul 11 16:26:50 2013 -0500

Functions for Bcast+Reduce, cases for fo_rev.c, cases for tapedoc.c, opcodes for oplate.h

commit 121013af05b9f5695142a568be82d5475ce5e042
Author: Jean Utke <utke@…>
Date: Tue Jul 9 15:32:43 2013 -0500

gatherv/scatterv

commit a854ae8c0d95783a8a1ba7febef62243e17aa0cf
Author: Jean Utke <utke@…>
Date: Tue Jul 9 15:32:19 2013 -0500

implementation for new ADTOOL interfaces and reference to new opcodes

commit c7d0709360ddbaeaef7d56b23c8f68558ef6535f
Author: Jean Utke <utke@…>
Date: Tue Jul 9 15:31:38 2013 -0500

new opcodes

commit d44dd7d2fbbbdd50d01eff25425815132bc29938
Author: Jean Utke <utke@…>
Date: Wed Mar 13 12:13:07 2013 -0500

replace active flag with active type

commit 8e638844f395784b619870e279380d0bab1849bb
Author: Michel Schanen <schanen@…>
Date: Wed Feb 27 09:53:31 2013 +0100

Fix to the popSRinfo signature

commit 46e8b0208497d260b69ff631f0c43b062fb7672e
Author: Michel Schanen <schanen@…>
Date: Wed Feb 27 09:47:00 2013 +0100

AMPI interface changes due to dco

commit 6411cf3d8fdecb6703996b49422f8cc5742a543a
Merge: 36d5c8c 86aa51a
Author: Jean Utke <utke@…>
Date: Fri Jan 25 09:29:34 2013 -0600

Merge branch '2.3.x_ISSM' into ampi

commit 36d5c8cdb76f1694465957dfdad9b8e397c9a298
Merge: d891bd7 fc0e23e
Author: Jean Utke <utke@…>
Date: Fri Jan 25 09:22:26 2013 -0600

Merge branch 'master' into ampi

commit d891bd7432731a3777226a21e0c4fe5284b829d6
Merge: 120a0ba 032b76f
Author: Jean Utke <utke@…>
Date: Fri Jan 25 08:58:55 2013 -0600

Merge branch '2.3.x_ISSM' into ampi

commit 120a0ba02bf99bf2a04e312510e60702e1c4b164
Author: Jean Utke <utke@…>
Date: Thu Jan 24 14:36:55 2013 -0600

be consistent about using the adjointBuf

commit f899a455d1bd53faf0326976522238ca4ee72c66
Author: Jean Utke <utke@…>
Date: Thu Jan 24 12:13:09 2013 -0600

additions or irecv-send-wait

commit ac36a673810f5926be10eb66508eb01a72fce35f
Author: Jean Utke <utke@…>
Date: Thu Jan 24 10:02:38 2013 -0600

adapt for modified adtools interfaces; use the generic tape to keep MPI opaque types opaque

commit a0389f9f53849bfff2094621fa262c0bf68d87c9
Author: Jean Utke <utke@…>
Date: Wed Jan 2 17:15:37 2013 -0600

it is rp_A (not rp_T) and of course we needed the implementation of the increment and the decrement

commit ea9b3cd404ad4dd7e2d47a12e30d4b17496c8f8c
Author: Jean Utke <utke@…>
Date: Wed Jan 2 17:14:32 2013 -0600

we put more on the trace now

commit 2ac3e09235779a60e348483bde31496e84addca6
Author: Jean Utke <utke@…>
Date: Wed Jan 2 17:14:13 2013 -0600

undo a previous change

commit d51e220310d57285af9d667ef590215ac88b4f66
Author: Jean Utke <utke@…>
Date: Wed Jan 2 16:01:49 2013 -0600

need to set the count - of course

commit 903ab9374046ba9f7e4be44cf95d1d66e0942e84
Author: Jean Utke <utke@…>
Date: Wed Dec 19 12:47:17 2012 -0600

need to get the request in tapedoc too

commit 37d8b9a62a7d98a050fe3f718fb670f4366bc36a
Author: Jean Utke <utke@…>
Date: Wed Dec 19 12:46:34 2012 -0600

trace the request as an identifier to retrieve the AMPI request from the book keeping

commit 7c6cdbb18e92a3b0c7ee1c970f0d635cc9c6b895
Author: Jean Utke <utke@…>
Date: Wed Dec 19 12:43:37 2012 -0600

provide the declarations at one spot

commit 099a86d565e53a0afba519897c905fc313100dd5
Author: Jean Utke <utke@…>
Date: Wed Dec 19 12:41:23 2012 -0600

always set this because ampisupport needs it to get a hold of the buffer

commit ed510c7268d528e755de572bbd8c340be4d4f1d2
Author: Jean Utke <utke@…>
Date: Wed Dec 19 12:40:09 2012 -0600

use predefine locs count and defend against 0 alloc

commit 6b01cb33829b53099733086535b8c4b02e55f9af
Author: Jean Utke <utke@…>
Date: Wed Dec 19 12:30:41 2012 -0600

need this lib now

commit f2d4e3d1a7ce3f59e53d5b77c260621190f3e7be
Author: Jean Utke <utke@…>
Date: Wed Dec 19 12:30:08 2012 -0600

define the max locations per op code as a constant variable

commit f991c57c7a986d780f93d7203fdf34fad6628a86
Author: Jean Utke <utke@…>
Date: Wed Dec 19 12:27:27 2012 -0600

make this a little bit safer by enforcing NULL values for 0 size memory allocation;
the standard is noncommittal on this but offers NULL return as a possibility

commit f7863e21a6b98972d2239d268867ded147c8be9b
Author: Jean Utke <utke@…>
Date: Tue Dec 18 12:46:46 2012 -0600

fix up the output

commit 1cca12375b30cad22a96b04e45cdf369a011a9f2
Author: Jean Utke <utke@…>
Date: Tue Dec 18 12:46:28 2012 -0600

implement these

commit 8f023ffc33d70e21d6c9e3bfe4336b59244a7552
Author: Jean Utke <utke@…>
Date: Tue Dec 18 01:41:56 2012 -0600

cannot lump things into a placeholder opcode

commit 431fe76495a46dc97966a3a8503db288537832d6
Author: Jean Utke <utke@…>
Date: Mon Dec 17 16:12:03 2012 -0600

tapedoc conditional for AMPI and replace local hardwired macro with a configured macro

commit fbc846618106386e994c2bc661db1df9ace8930c
Author: Jean Utke <utke@…>
Date: Wed Dec 12 17:01:36 2012 -0600

baseline AMPI interpretation

commit 44bd31406cfffb2d84ac9af8cc447d9f11c7daaa
Author: Jean Utke <utke@…>
Date: Wed Dec 12 16:54:04 2012 -0600

add a preprocessor macro - make the checks dependent on the enable-ampi

commit 9c0f564ff64bfbc4eb06a4e9bc39cebc4590bca8
Author: Jean Utke <utke@…>
Date: Wed Dec 12 16:22:05 2012 -0600

increase the locint head space from 5 to 10 to allow for extra info

commit cf3aadbb3bbe1636e8b41241350814495257f215
Author: Jean Utke <utke@…>
Date: Wed Dec 12 16:21:27 2012 -0600

push the opcode and get raw data pointer

commit 2f8cd8603d411bf741fbedeb48bf59916bb7b37b
Author: Jean Utke <utke@…>
Date: Wed Dec 12 08:53:34 2012 -0600

extras

commit dd349bfdb2d91e163d3124a5ed5f03d5d6581e98
Author: Jean Utke <utke@…>
Date: Tue Dec 11 18:08:24 2012 -0600

ampi support in configuration output

commit feecf333d1785fbeb514a774ecfae2b380a2d317
Author: Jean Utke <utke@…>
Date: Tue Dec 11 18:03:54 2012 -0600

debug should be with opt level 0

commit f909b4bd395616d576aa37e6ddd61a4a75486312
Author: Jean Utke <utke@…>
Date: Tue Dec 11 11:54:34 2012 -0600

baseline

commit a7e6d0695be7910ec3c7ed2e3757a8d62e6f6fac
Author: Jean Utke <utke@…>
Date: Tue Dec 11 11:52:49 2012 -0600

ignoring things

  • Property svn:keywords set to Id
File size: 8.2 KB
Line 
1// -*- c++ -*- hello emacs...
2/*----------------------------------------------------------------------------
3 ADOL-C--  Automatic Differentiation by Overloading in C++ - simplified
4 File:     storemanager.h
5 Revision: $Id: storemanager.h 439 2013-12-02 13:30:22Z kulshres $
6 Contents: storemanager.h contains definitions of abstract interface
7           class StoreManager and some derived classes implementing the
8           desired functionality.
9
10 Copyright (c) 2006 Johannes Willkomm <johannes.willkomm@rwth-aachen.de>
11               2011-2013 Kshitij Kulshreshtha <kshitij@math.upb.de>
12               2012 Benjamin Letschert <letschi@mail.upb.de>
13               2013 Jean Utke <utke@mcs.anl.gov>
14
15 This file is part of ADOL-C.
16
17 The classes StoreManagerXYZ basically takes the global double *store pointer
18 into their obhut and implement next_loc and free_loc.
19
20 They basic idea is taken from "The C++ Programming Language" by Bjarne
21 Stroustrup, from the chapter 19 on iterators and allocators.
22
23 To understand how and why they work do the following:
24 1) Have a look at StoreManagerInSitu and convince yourself that it is
25    exactly the same as the solution presented in the Stroustrup book,
26    except that we always have just one big array instead of a linked
27    list of chunks.
28
29    This means in particular that we have to copy the values from the
30    old array into the lower half of the new one (we always double the size).
31
32 2) Have a look at StoreManagerLocint and convince yourself that these do
33    the same as StoreManagerInSitu except that the linked list of free
34    slots is maintained in a completely different portion of memory. This
35    means the values in freed slots remain untouched until they are
36    allocated again.
37
38
39 3) Have a look a class StoreManagerLocintBlock. This class uses a list of
40    of free blocks of different sizes instead of free locations.
41
42 class StoreManagerInSitu
43 An unsafe implementation is provided as well, but commented out.
44 It does not use the indexFeld array which saves between
45 25% and 50% memory relative to the above safe implementation.
46
47 It is most closely modelled after the example found in the
48 Stroustrup book.
49
50 It appears that it works very well, if one does not use the
51 trace_on(tag, 1); ... trace_off(); reverse(); way of using ADOL-C.
52 If the first sweep is forward it works fine.
53 Therefore I left it in here as a comment so an interested user
54 with acute main memory scarcity may give it a try.
55           
56
57 History:
58          20120427 bl:     add blocking store management
59          20110208 kk:     incorporated in ADOL-C; moved some code arround
60          20060507 jw:     begin
61
62----------------------------------------------------------------------------*/
63
64#ifndef ADOL_C__STOREMANAGER_H
65#define ADOL_C__STOREMANAGER_H
66
67#include <adolc/common.h>
68#include <list>
69
70class StoreManager {
71protected:
72  static size_t const initialSize = 4;
73  double myGcTriggerRatio;
74  size_t myGcTriggerMaxSize;
75public:
76  StoreManager() : myGcTriggerRatio(1.5), myGcTriggerMaxSize(initialSize) {}
77  virtual ~StoreManager() {}
78  virtual locint next_loc() = 0;
79  virtual void free_loc(locint) = 0;
80  virtual void ensure_block(size_t n) = 0;
81  void setStoreManagerControl(double gcTriggerRatio, size_t gcTriggerMaxSize) { myGcTriggerRatio=gcTriggerRatio; myGcTriggerMaxSize=gcTriggerMaxSize;}
82  double gcTriggerRatio() const {return myGcTriggerRatio;}
83  size_t gcTriggerMaxSize() const {return myGcTriggerMaxSize;}
84
85//   // effectively the current size of the store array
86  virtual size_t maxSize() const = 0;
87
88//   // the number of slots currently in use
89  virtual size_t size() const = 0;
90};
91
92class StoreManagerLocint : public StoreManager {
93protected:
94  double * &storePtr;
95  locint * indexFree;
96  locint head;
97  size_t &maxsize;
98  size_t &currentfill;
99private:
100  void grow();
101public:
102
103  StoreManagerLocint(double * &storePtr, size_t &size, size_t &numlives);
104  StoreManagerLocint(const StoreManagerLocint *const stm, double * &storePtr, size_t &size, size_t &numLives);
105
106  virtual ~StoreManagerLocint();
107  virtual inline size_t size() const { return currentfill; }
108
109  virtual inline size_t maxSize() const { return maxsize; }
110
111  virtual inline bool realloc_on_next_loc() const { 
112      return (head == 0);
113  }
114
115  virtual locint next_loc();
116  virtual void free_loc(locint loc); 
117  virtual void ensure_block(size_t n) {}
118};
119
120class StoreManagerLocintBlock : public StoreManager {
121protected:
122    double * &storePtr;
123    struct FreeBlock {
124        locint next; // next location
125        size_t size; // number of following free locations
126        FreeBlock(): next(0), size(0) {}
127        FreeBlock(const struct FreeBlock &block) :
128            next(block.next),size(block.size) {}
129        bool operator<(const struct FreeBlock& b) const {
130            return (next < b.next);
131        }
132    };
133
134    std::list<struct FreeBlock> indexFree;
135    size_t &maxsize;
136    size_t &currentfill;
137
138    void consolidateBlocks();
139#ifdef ADOLC_LOCDEBUG
140    unsigned int ensure_blockCallsSinceLastConsolidateBlocks;
141#endif
142private:
143    /**
144     * when minGrow is specified we asssume that we have already
145     * search the blocks and found no block with minGrow locations in it
146     */
147    void grow(size_t minGrow=0 );
148public:
149    StoreManagerLocintBlock(double * &storePtr, size_t &size, size_t &numlives);
150    StoreManagerLocintBlock(const StoreManagerLocintBlock *const stm, double * &storePtr, size_t &size, size_t &numLives);
151
152    virtual ~StoreManagerLocintBlock();
153    virtual inline size_t size() const { return currentfill; }
154
155    virtual inline size_t maxSize() const { return maxsize; }
156
157    virtual locint next_loc();
158    virtual void free_loc(locint loc);
159    virtual void ensure_block(size_t n);
160};
161
162#if 0
163/* This implementation is unsafe in that using tace_on with keep=1 and
164   reverse mode directly afterwards will yield incorrect results.
165   For all other purposes it seem to work just fine, so it's left here
166   for reference as a comment.
167*/
168
169/* unsafe - use with care */
170
171class StoreManagerInSitu : public StoreManager {
172  //  static size_t const initialeGroesse = 512;
173protected:
174  double * &storePtr;
175  struct Link {
176    struct Link *next;
177  };
178  Link *head;
179  size_t groesse;
180  size_t anzahl;
181public:
182  size_t maxIndexUsed;
183
184  StoreManager(double * &storePtr) :
185    storePtr(storePtr),
186    head(0),
187    groesse(initialeGroesse),
188    anzahl(0),
189    maxIndexUsed(0)
190  {
191    // while a place in store is unused we want to place
192    // a Link stucture (i.e. a pointer) there
193    assert(sizeof(double) >= sizeof(void*));
194    assert(sizeof(double) >= sizeof(Link));
195    std::cerr << "StoreManager::StoreManager()\n";
196  }
197
198  virtual ~StoreManager() {
199    if (storePtr) {
200      delete [] storePtr;
201      storePtr = 0;
202    }
203    std::cerr << "StoreManager::~StoreManager()\n";
204  }
205
206  virtual inline size_t size() const { return anzahl; }
207
208  virtual inline size_t maxSize() const { return groesse; }
209
210  virtual locint next_loc(size_t n = 1) {
211    assert(n == 1);
212    if (head == 0) {
213      grow();
214    }
215    assert(head);
216    double * const dPtr = reinterpret_cast<double*>(head);
217    head = head->next;
218    ++anzahl;
219    locint const result = dPtr - storePtr;
220    maxIndexUsed = std::max((locint)maxIndexUsed, result);
221    return result;
222  }
223
224  virtual void free_loc(locint loc) {
225    assert(loc < groesse);
226    Link *returned = reinterpret_cast<Link*>(storePtr + loc);
227    returned->next = head;
228    head = returned;
229    --anzahl;
230  }
231private:
232  void grow() {
233    size_t const alteGroesse = groesse;
234    groesse *= 2;
235    assert(alteGroesse == initialeGroesse or size() == alteGroesse);
236    std::cerr << "StoreManager::grow(): increase size to " << groesse << "\n";
237    double *const oldStore = storePtr;
238    std::cerr << "StoreManager::grow(): allocate " << groesse * sizeof(double) << " B\n";
239    storePtr = new double[groesse];
240    size_t i = 0;
241    if (alteGroesse != initialeGroesse) { // nicht beim ersten Mal
242      std::cerr << "StoreManager::grow(): copy values\n";
243      for ( ; i < alteGroesse; ++i) {
244        storePtr[i] = oldStore[i];
245      }
246      std::cerr << "StoreManager::grow(): free " << alteGroesse * sizeof(double) << " B\n";
247      delete [] oldStore;
248    }
249    head = reinterpret_cast<Link*>(storePtr + i);
250    for ( ; i < groesse-1; ++i) {
251      reinterpret_cast<Link*>(storePtr + i)->next
252        = reinterpret_cast<Link*>(storePtr + i + 1);
253    }
254    reinterpret_cast<Link*>(storePtr + i)->next = 0;
255  }
256
257};
258#endif /* 0 */
259
260#endif /* ADOL_C__STOREMANAGER_H */
261
Note: See TracBrowser for help on using the repository browser.