[20498] | 1 | Index: ../trunk-jpl/m4/issm_options.m4
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/m4/issm_options.m4 (revision 19489)
|
---|
| 4 | +++ ../trunk-jpl/m4/issm_options.m4 (revision 19490)
|
---|
| 5 | @@ -721,6 +721,7 @@
|
---|
| 6 | AC_SUBST([ADOLCLIB])
|
---|
| 7 | fi
|
---|
| 8 | AM_CONDITIONAL([ADOLC], [test x$HAVE_ADOLC = xyes])
|
---|
| 9 | + AM_COND_IF(ADOLC,[CXXFLAGS+=" -std=c++11"])
|
---|
| 10 | dnl }}}
|
---|
| 11 | dnl adolc-version{{{
|
---|
| 12 | AC_ARG_WITH([adolc-version],
|
---|
| 13 | Index: ../trunk-jpl/externalpackages/adolc/install-withampi.sh
|
---|
| 14 | ===================================================================
|
---|
| 15 | --- ../trunk-jpl/externalpackages/adolc/install-withampi.sh (revision 19489)
|
---|
| 16 | +++ ../trunk-jpl/externalpackages/adolc/install-withampi.sh (revision 19490)
|
---|
| 17 | @@ -4,7 +4,7 @@
|
---|
| 18 | #Some cleanup
|
---|
| 19 | rm -rf install src
|
---|
| 20 |
|
---|
| 21 | -git clone -b ampi git://git.mcs.anl.gov/adol-c.git src
|
---|
| 22 | +git clone https://gitlab.com/adol-c/adol-c.git src
|
---|
| 23 | #git reset --hard b254b2a001a1b7a024a9184cd087ae06eb975cad
|
---|
| 24 |
|
---|
| 25 | #Compile ADOL-C
|
---|
| 26 | Index: ../trunk-jpl/src/c/shared/Numerics/isnan.h
|
---|
| 27 | ===================================================================
|
---|
| 28 | --- ../trunk-jpl/src/c/shared/Numerics/isnan.h (revision 19489)
|
---|
| 29 | +++ ../trunk-jpl/src/c/shared/Numerics/isnan.h (revision 19490)
|
---|
| 30 | @@ -12,13 +12,13 @@
|
---|
| 31 | #endif
|
---|
| 32 |
|
---|
| 33 | /*If include cmath instead of math, isnan on linux64 murdo does not work: */
|
---|
| 34 | -#include <math.h>
|
---|
| 35 | +#include <cmath>
|
---|
| 36 |
|
---|
| 37 | template <class T> int xIsNan(const T& X) {
|
---|
| 38 | #ifdef _INTEL_WIN_
|
---|
| 39 | return (X!=X)?1:0;
|
---|
| 40 | #else
|
---|
| 41 | - return isnan(X);
|
---|
| 42 | + return std::isnan(X);
|
---|
| 43 | #endif
|
---|
| 44 | }
|
---|
| 45 |
|
---|
| 46 | Index: ../trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp
|
---|
| 47 | ===================================================================
|
---|
| 48 | --- ../trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp (revision 19489)
|
---|
| 49 | +++ ../trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp (revision 19490)
|
---|
| 50 | @@ -231,16 +231,12 @@
|
---|
| 51 | IssmDouble* adoubleEDFin=xNew<IssmDouble>(n*(n+1)); // packed inputs, i.e. matrix and right hand side
|
---|
| 52 | for(int i=0; i<n*n;i++)adoubleEDFin[i] =A[i]; // pack matrix
|
---|
| 53 | for(int i=0; i<n; i++)adoubleEDFin[i+n*n]=B[i]; // pack the right hand side
|
---|
| 54 | - IssmPDouble* pdoubleEDFin=xNew<IssmPDouble>(n*(n+1)); // provide space to transfer inputs during call_ext_fct
|
---|
| 55 | - IssmPDouble* pdoubleEDFout=xNew<IssmPDouble>(n); // provide space to transfer outputs during call_ext_fct
|
---|
| 56 | // call the wrapped solver through the registry entry we retrieve from parameters
|
---|
| 57 | call_ext_fct(xDynamicCast<GenericParam<Adolc_edf> * >(parameters->FindParamObject(AdolcParamEnum))->GetParameterValue().myEDF_for_solverx_p,
|
---|
| 58 | - n*(n+1), pdoubleEDFin, adoubleEDFin,
|
---|
| 59 | - n, pdoubleEDFout,X);
|
---|
| 60 | + n*(n+1), adoubleEDFin,
|
---|
| 61 | + n, X);
|
---|
| 62 | // for(int i=0; i<n; i++) {ADOLC_DUMP_MACRO(X[i]);}
|
---|
| 63 | xDelete(adoubleEDFin);
|
---|
| 64 | - xDelete(pdoubleEDFin);
|
---|
| 65 | - xDelete(pdoubleEDFout);
|
---|
| 66 | }
|
---|
| 67 | /*}}}*/
|
---|
| 68 | #endif
|
---|
| 69 | Index: ../trunk-jpl/src/c/cores/ad_core.cpp
|
---|
| 70 | ===================================================================
|
---|
| 71 | --- ../trunk-jpl/src/c/cores/ad_core.cpp (revision 19489)
|
---|
| 72 | +++ ../trunk-jpl/src/c/cores/ad_core.cpp (revision 19490)
|
---|
| 73 | @@ -115,9 +115,6 @@
|
---|
| 74 | /*Branch according to AD driver: */
|
---|
| 75 | femmodel->parameters->FindParam(&driver,AutodiffDriverEnum);
|
---|
| 76 |
|
---|
| 77 | - /* these are always needed regardless of the interpreter */
|
---|
| 78 | - anEDF_for_solverx_p->dp_x=xNew<double>(anEDF_for_solverx_p->max_n);
|
---|
| 79 | - anEDF_for_solverx_p->dp_y=xNew<double>(anEDF_for_solverx_p->max_m);
|
---|
| 80 |
|
---|
| 81 | if (strcmp(driver,"fos_forward")==0){ /*{{{*/
|
---|
| 82 |
|
---|
| 83 | @@ -142,9 +139,6 @@
|
---|
| 84 | anEDF_for_solverx_p->fos_forward=EDF_fos_forward_for_solverx;
|
---|
| 85 | #endif
|
---|
| 86 |
|
---|
| 87 | - /*allocate the space for the parameters to invoke the EDF fos_forward:*/
|
---|
| 88 | - anEDF_for_solverx_p->dp_X=xNew<double>(anEDF_for_solverx_p->max_n);
|
---|
| 89 | - anEDF_for_solverx_p->dp_Y=xNew<double>(anEDF_for_solverx_p->max_m);
|
---|
| 90 |
|
---|
| 91 | /*call driver: */
|
---|
| 92 | fos_forward(my_rank,num_dependents,num_independents, 0, xp, tangentDir, theOutput, jacTimesTangentDir );
|
---|
| 93 | @@ -189,9 +183,6 @@
|
---|
| 94 | #endif
|
---|
| 95 | // anEDF_for_solverx_p->fov_reverse=EDF_fov_reverse_for_solverx;
|
---|
| 96 |
|
---|
| 97 | - /*allocate the space for the parameters to invoke EDF fov_forward:*/
|
---|
| 98 | - anEDF_for_solverx_p->dpp_X=xNew<double>(anEDF_for_solverx_p->max_n, tangentDirNum);
|
---|
| 99 | - anEDF_for_solverx_p->dpp_Y=xNew<double>(anEDF_for_solverx_p->max_m, tangentDirNum);
|
---|
| 100 |
|
---|
| 101 | /*seed matrix: */
|
---|
| 102 | seed=xNewZeroInit<double>(num_independents,tangentDirNum);
|
---|
| 103 | @@ -251,9 +242,6 @@
|
---|
| 104 | anEDF_for_solverx_p->fos_reverse_iArr=fos_reverse_mumpsSolveEDF;
|
---|
| 105 | #endif
|
---|
| 106 |
|
---|
| 107 | - /*allocate the space for the parameters to invoke the EDF fos_reverse :*/
|
---|
| 108 | - anEDF_for_solverx_p->dp_U=xNew<double>(anEDF_for_solverx_p->max_m);
|
---|
| 109 | - anEDF_for_solverx_p->dp_Z=xNew<double>(anEDF_for_solverx_p->max_n);
|
---|
| 110 |
|
---|
| 111 | /*call driver: */
|
---|
| 112 | fos_reverse(my_rank,num_dependents,num_independents, aWeightVector, weightVectorTimesJac );
|
---|
| 113 | @@ -295,9 +283,6 @@
|
---|
| 114 | anEDF_for_solverx_p->fov_reverse=EDF_fov_reverse_for_solverx;
|
---|
| 115 | #endif
|
---|
| 116 |
|
---|
| 117 | - /*allocate the space for the parameters to invoke the EDF fos_reverse :*/
|
---|
| 118 | - anEDF_for_solverx_p->dpp_U=xNew<double>(weightNum,anEDF_for_solverx_p->max_m);
|
---|
| 119 | - anEDF_for_solverx_p->dpp_Z=xNew<double>(weightNum,anEDF_for_solverx_p->max_n);
|
---|
| 120 |
|
---|
| 121 | /*seed matrix: */
|
---|
| 122 | weights=xNewZeroInit<double>(weightNum,num_dependents);
|
---|
| 123 | @@ -330,17 +315,6 @@
|
---|
| 124 | } /*}}}*/
|
---|
| 125 | else _error_("driver: " << driver << " not yet supported!");
|
---|
| 126 |
|
---|
| 127 | - /* delete the allocated space for the parameters:*/
|
---|
| 128 | - xDelete(anEDF_for_solverx_p->dp_x);
|
---|
| 129 | - xDelete(anEDF_for_solverx_p->dp_X);
|
---|
| 130 | - xDelete(anEDF_for_solverx_p->dpp_X);
|
---|
| 131 | - xDelete(anEDF_for_solverx_p->dp_y);
|
---|
| 132 | - xDelete(anEDF_for_solverx_p->dp_Y);
|
---|
| 133 | - xDelete(anEDF_for_solverx_p->dpp_Y);
|
---|
| 134 | - xDelete(anEDF_for_solverx_p->dp_U);
|
---|
| 135 | - xDelete(anEDF_for_solverx_p->dpp_U);
|
---|
| 136 | - xDelete(anEDF_for_solverx_p->dp_Z);
|
---|
| 137 | - xDelete(anEDF_for_solverx_p->dpp_Z);
|
---|
| 138 |
|
---|
| 139 | if(VerboseAutodiff())_printf0_(" end AD core\n");
|
---|
| 140 |
|
---|