<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hello everyone,<br>
<br>
I have been trying to use Adol-C in combination with OpenMP, and I
got a bit confused between the manual and the example.<br>
The sequential version of the code runs fine, the openmp part
without automatic differentiation seems to be correct as well.<br>
<br>
I built Adol-C 2.4.0 and Colpack 1.0.9 with OpenMP enabled.<br>
(during the make for Adol-C I encountered an error about a missing
adolc_openmp.h, copying the file into src/ seemed to solve the
issue)<br>
<br>
The tape is something like<br>
<br>
<i> trace_on(tag_L);</i><i><br>
</i><i>
for(i=0; i < n; i++)</i><i><br>
</i><i>
m_x_ad[i] <<= 1e0;</i><i><br>
</i><i>
for(i=0; i < m; i++)</i><i><br>
</i><i>
m_lambda_ad[i] <<= 1e0;</i><i><br>
</i><i>
m_objfactor_ad <<= 1e0;</i><i><br>
</i><i>
evalObjective(n,m_x_ad,m_objvalue_ad);</i><i><br>
</i><i>
m_lagvalue_ad = m_objvalue_ad * m_objfactor_ad;</i><i><br>
</i><i>
evalConstraints(n,m_x_ad,m,m_g_ad);</i><i><br>
</i><i>
for(i=0; i < m; i++)</i><i><br>
</i><i>
m_lagvalue_ad += m_g_ad[i] * m_lambda_ad[i];</i><i><br>
</i><i>
m_lagvalue_ad >>= dummy;</i><i><br>
</i><i>
trace_off();</i><br>
<br>
<i> // build sparsity pattern</i><i><br>
</i><i> m_row_hess_total = NULL;</i><i><br>
</i><i> m_col_hess_total = NULL;</i><i><br>
</i><i> m_val_hess = NULL;</i><i><br>
</i><i> m_options_hess[0] = 0;</i><i><br>
</i><i> m_options_hess[1] = 1; </i><i><br>
</i><i><br>
</i><i> // full Hessian wrt (x,lambda,objfactor)</i><i><br>
</i><i> sparse_hess(tag_L, n+m+1, 0, m_xlf,
&m_nnz_hess_total, &m_row_hess_total,
&m_col_hess_total, &m_val_hess, m_options_hess);</i><br>
<br>
and somewhere in the function evalConstraints I have an openMP loop<br>
<br>
<i> #pragma omp parallel for default(none) shared(...)
schedule(dynamic) </i><br>
<i> for (int i=0; ....)</i><i><br>
</i><i> {</i><i><br>
</i><i> ...</i><i><br>
</i><i> }</i><br>
<br>
I added the #include <adolc/adolc_openmp.h>, and the
ADOLC_OPENMP macro at the end of the pragma.<br>
Is it supposed to be enough ?<br>
<br>
Currently I get these errors during the call to evalConstraints
(before the actual call to sparse_hessian)<br>
<br>
<i>bocop: tape_handling.cpp:1373: virtual void
StoreManagerLocintBlock::free_loc(locint): Assertion `loc <
maxsize' failed.</i><i><br>
</i><br>
<br>
Any help would be greatly appreciated,<br>
<br>
Pierre Martinon<br>
</body>
</html>