<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Thanks Brad,<br>
<br>
I'll have a look into CppAD. Your solution seems like what I was
thinking: on the master thread, create a bunch of tapes (or deep
copies of a single tape) dedicated to each particular worker
thread. It would then seem that a similar approach is possible for
adolc. My main concern was avoiding a repetitive and unnecessary
re-taping on each thread. <br>
<br>
On another note, I am also trying to use MPI in a similar fashion
where I would communicate the tape created on one process to
another process. I was thinking of creating a derived mpi data
type and then a simple point-to-point communication. Now the
questions become: (1) how to do I get a reference to the created
tapes; (2) how do I determine the size of the taped function (once
I know where they are in memory is simple sizeof() might work?).
It seems like 'tapestats()' gives some of this info. But perhaps,
in the case of MPI, an easier approach might be to just re-tape on
each process and avoid tape communication altogether. <br>
<br>
Does anybody have any thoughts on how to simultaneous evaluate
derivatives at different values on a distributed system using
ADOL-C and MPI. In my case, the function remains the same and I am
just interested in computing derivatives at different independent
variable values.<br>
<br>
Regards,<br>
Ian.<br>
<br>
<br>
<br>
On 03/18/2014 01:11 PM, Brad Bell wrote:<br>
</div>
<blockquote cite="mid:53287E25.8060405@seanet.com" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<div class="moz-cite-prefix">You can do this in CppAD. First you
create the tape and then you use the assignment operator to make
multiple copies of it; each for use with a different thread; see<br>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://www.coin-or.org/CppAD/Doc/funconstruct.xml#Assignment%20Operator">http://www.coin-or.org/CppAD/Doc/funconstruct.xml#Assignment%20Operator</a><br>
<br>
In your case, you could have a vector of ADFun functions<br>
CppAD::vector< ADFun<Base> > g(n_thread)<br>
for(i_thread = 0; i_thread < n_thread; i_thread++)<br>
g[i_thread] = f;<br>
would make n_thread copies of the taped function. Note that the
default constructor is used for each ADFun g[i]. Also note that
any simple vector template class could be used in place of
CppAD::vector.<br>
<br>
P.S.<br>
Note that the multi-threaded example multi_newton example
retapes the function for each derivative evaluation; see<br>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://www.coin-or.org/CppAD/Doc/multi_newton_time.cpp.xml#use_ad">http://www.coin-or.org/CppAD/Doc/multi_newton_time.cpp.xml#use_ad</a><br>
You could modify this example to test having one tape, copying
it, and then reusing it.<br>
<br>
<br>
<br>
<br>
<br>
On 3/17/2014 2:49 PM, Ian Washington wrote:<br>
</div>
<blockquote cite="mid:%3C53276DF6.4000201@mcmaster.ca%3E"
type="cite">
<meta http-equiv="Context-Type" content="text/html;
charset=ISO-8859-1">
Hello all,<br>
<br>
I have a similar question related to using adolc and openmp,
somewhat based on <a moz-do-not-send="true"
href="http://list.coin-or.org/pipermail/adol-c/2014-February/000951.html">http://list.coin-or.org/pipermail/adol-c/2014-February/000951.html</a><br>
<br>
In my case, I have no openmp directives in the function to be
traced and all I want to do is evaluate a traced function at
different independent variable values in an openmp for loop.<br>
<br>
My question is:<br>
<br>
Is it possible to only trace the function on one thread and then
simultaneously evaluate the derivatives (at different values)
using multiple threads?<br>
<br>
I'm thinking this is not possible because the same memory
location would be simultaneously accessed and written to, and
thus I would need to have an independent function trace (i.e.,
independent memory location) for each thread. <br>
<br>
Off the top of my head I guess I could create a whole bunch of
function traces indexed by different tags and then just refer to
the appropriate tag depending on the particular thread, but this
seems quite inefficient. <br>
<br>
Does anybody have any thoughts on how I could do this ?<br>
<br>
Thanks,<br>
Ian.<br>
<br>
<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
</body>
</html>