[ADOL-C] conditional assignments in tapeless mode

Kshitij Kulshreshtha kshitij at math.upb.de
Fri Sep 17 10:51:25 EDT 2010


As on 2010-09-17 16:29, Alfonso Callejo Goena did write:
> Hi all,
> 
> I have already implemented ADOL-C in a multibody simulation program, and
> now I'm trying to test the tapeless mode to see if it improves the
> program efficiency.
> The thing is that the "condassign" functions, which solve the problem of
> having conditional statements in the code, seem to work only with the
> tape mode. In fact, if one looks into adouble.h, the "condassign"
> functions aren't declared if the tapeless macro ADOLC_TAPELESS is
> set. By the way, the compiler throws a "condassign: identifier not
> found" error.
> Am I overlooking something? 
> 

Hello Alfonso,

the tapeless mode is forward only, so if your code needs reverse mode it
is not recommended to use tapeless. In forward mode tapeless will bring
some gain only if the tape is too large and must be written to disk. You
may try tweaking the buffer sizes in ADOL-C/src/usrparms.h file before
compiling ADOL-C and see if that brings you some speed. These
buffersizes may be in total as big as the physical memory your system
has free.

In the tapeless mode you really don't need any condassign calls at all.
You can simply use the form

var = cond ? val1 : val2;

The condassign is used in the taped version internally to write these
condition checks onto the tape since the operator ?: cannot be
overloaded. In tapeless mode this is not required as nothing extra needs
to be done.

Regards.
-- 
Kshitij Kulshreshtha

Institut für Mathematik,
Universität Paderborn,
Warburger Straße 100,
33098 Paderborn.

Büro: A3.235

Privatanschrift:
Arnikaweg 62
33100 Paderborn.



More information about the ADOL-C mailing list