Skip to content

Commit

Permalink
master: Adapt to xrst-2024.3.28 (use new template command).
Browse files Browse the repository at this point in the history
  • Loading branch information
bradbell committed Mar 28, 2024
1 parent 7de75c5 commit 0af2efa
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 112 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ IF( POLICY CMP0054 )
ENDIF( POLICY CMP0054 )
#
# cppad_version is used by version.sh to get the version number.
SET(cppad_version "20240323")
SET(cppad_version "20240324")
SET(cppad_url "https://coin-or.github.io/CppAD" )
SET(cppad_description "Differentiation of C++ Algorithms" )
IF( NOT DEFINED CMAKE_BUILD_TYPE)
Expand Down
1 change: 0 additions & 1 deletion appendix/whats_new/2003.xrst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

{xrst_begin 2003 app}
{xrst_spell
constructor constructor
ddouble
def
dodds
Expand Down
1 change: 0 additions & 1 deletion appendix/whats_new/2011.xrst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
pkgconfig
prefixdir
pthreads
requirements requirements
rosen
svn
tgz
Expand Down
1 change: 0 additions & 1 deletion appendix/whats_new/2021.xrst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
ocurred
pkgconfig
txt
values values
}

Release Notes for 2021
Expand Down
43 changes: 7 additions & 36 deletions example/multi_thread/bthread/get_started.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,19 @@
// SPDX-FileCopyrightText: Bradley M. Bell <[email protected]>
// SPDX-FileContributor: 2003-24 Bradley M. Bell
// ----------------------------------------------------------------------------

/*
{xrst_begin bthread_get_started.cpp}
{xrst_spell
fun fun
}
Getting Started Using Boost Multi-Threading With CppAD
######################################################
in_parallel
***********
see :ref:`ta_parallel_setup@in_parallel` .
thread_number
*************
see :ref:`ta_parallel_setup@thread_num` .
ADFun Constructor
*****************
If you use the :ref:`fun_construct@Sequence Constructor` for the original
function, you will need to clear the Taylor coefficient memory associated
with the function using :ref:`capacity_order-name` ; e.g. ::
CppAD::ADFun fun(ax, ay);
fun.capacity_order(0);
If you do not free the Taylor coefficient memory in ``fun`` ,
the function assignments will allocate zero order Taylor coefficients for each
function in ``fun_thread`` using thread zero. Depending on what you do in
parallel mode, you may attempt to free that memory using another thread.
For example, if you change USE_DEFAULT_ADFUN_CONSTRUCTOR to 0, you will
get the message::
Attempt to return memory for a different thread while in parallel mode
Source Code
***********
{xrst_literal
// BEGIN C++
// END C++
}
{xrst_template ,
example/multi_thread/get_started.xrst
@Name@ , Boost
@####@ , #####
@DEFAULT@ , USE_DEFAULT_ADFUN_CONSTRUCTOR
@Dir@ , bthread
}
{xrst_end bthread_get_started.cpp}
------------------------------------------------------------------------------
Expand Down
45 changes: 45 additions & 0 deletions example/multi_thread/get_started.xrst
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{xrst_comment: This template file has the following parameters:
@Name@ : is the name of this threading system
@####@ : is the underlining for the name of the threading system
@DEFAULT@ : is macro a macro name. If it is 1 (0),
the ADFun default ctor is used (is not used)
@Dir@ : is the subdirectory of multi_thread that contins the source code
for this get_started.cpp
}

Getting Started Using @Name@ Threads With CppAD
######################@####@###################

in_parallel
***********
see :ref:`ta_parallel_setup@in_parallel` .

thread_number
*************
see :ref:`ta_parallel_setup@thread_num` .

ADFun Constructor
*****************
If you use the :ref:`fun_construct@Sequence Constructor` for the original
function, you will need to clear the Taylor coefficient memory associated
with the function using :ref:`capacity_order-name` ; e.g. ::

CppAD::ADFun fun(ax, ay);
fun.capacity_order(0);

If you do not free the Taylor coefficient memory in ``fun`` ,
the function assignments will allocate zero order Taylor coefficients for each
function in ``fun_thread`` using thread zero. Depending on what you do in
parallel mode, you may attempt to free that memory using another thread.
For example, if you change @DEFAULT@ from 1 to 0, you will
get the message::

Attempt to return memory for a different thread while in parallel mode

Source Code
***********
{xrst_literal
example/multi_thread/@Dir@/get_started.cpp
// BEGIN C++
// END C++
}
42 changes: 7 additions & 35 deletions example/multi_thread/openmp/get_started.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,13 @@
fun fun
}
Getting Started Using OpenMP With CppAD
#######################################
in_parallel
***********
see :ref:`ta_parallel_setup@in_parallel` .
thread_number
*************
see :ref:`ta_parallel_setup@thread_num` .
ADFun Constructor
*****************
If you use the :ref:`fun_construct@Sequence Constructor` for the original
function, you will need to clear the Taylor coefficient memory associated
with the function using :ref:`capacity_order-name` ; e.g. ::
CppAD::ADFun fun(ax, ay);
fun.capacity_order(0);
If you do not free the Taylor coefficient memory in ``fun`` ,
the function assignments will allocate zero order Taylor coefficients for each
function in ``fun_thread`` using thread zero. Depending on what you do in
parallel mode, you may attempt to free that memory using another thread.
For example, if you change USE_DEFAULT_ADFUN_CONSTRUCTOR to 0, you will
get the message::
Attempt to return memory for a different thread while in parallel mode
Source Code
***********
{xrst_literal
// BEGIN C++
// END C++
}
{xrst_template ,
example/multi_thread/get_started.xrst
@Name@ , OpenMP
@####@ , ######
@DEFAULT@ , USE_DEFAULT_ADFUN_CONSTRUCTOR
@Dir@ , openmp
}
{xrst_end openmp_get_started.cpp}
------------------------------------------------------------------------------
Expand Down
42 changes: 7 additions & 35 deletions example/multi_thread/pthread/get_started.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,13 @@
posix
}
Getting Started Using Posix Threads With CppAD
##############################################
in_parallel
***********
see :ref:`ta_parallel_setup@in_parallel` .
thread_number
*************
see :ref:`ta_parallel_setup@thread_num` .
ADFun Constructor
*****************
If you use the :ref:`fun_construct@Sequence Constructor` for the original
function, you will need to clear the Taylor coefficient memory associated
with the function using :ref:`capacity_order-name` ; e.g. ::
CppAD::ADFun fun(ax, ay);
fun.capacity_order(0);
If you do not free the Taylor coefficient memory in ``fun`` ,
the function assignments will allocate zero order Taylor coefficients for each
function in ``fun_thread`` using thread zero. Depending on what you do in
parallel mode, you may attempt to free that memory using another thread.
For example, if you change USE_DEFAULT_ADFUN_CONSTRUCTOR to 0, you will
get the message::
Attempt to return memory for a different thread while in parallel mode
Source Code
***********
{xrst_literal
// BEGIN C++
// END C++
}
{xrst_template ,
example/multi_thread/get_started.xrst
@Name@ , Posix
@####@ , #####
@DEFAULT@ , USE_DEFAULT_ADFUN_CONSTRUCTOR
@Dir@ , pthread
}
{xrst_end pthread_get_started.cpp}
------------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion introduction/exp_eps.xrst
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ Exercises
-----------------------------------------------------------------------------
{xrst_begin exp_eps_rev1}
{xrst_spell
forward forward
rcll
}

Expand Down
2 changes: 1 addition & 1 deletion user_guide.xrst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

{xrst_comment BEGIN: Before changing see new_release.sh and check_version.sh}

cppad-20240323: CppAD User's Manual
cppad-20240324: CppAD User's Manual
###################################

.. image:: {xrst_dir coin.png}
Expand Down

0 comments on commit 0af2efa

Please sign in to comment.