Ignore:
Timestamp:
10/03/12 09:09:23 (12 years ago)
Author:
Eric.Larour
Message:

CHG: modified the way we set keep for trace initialization in AD mode. This is now
decided by the AutodiffKeepEnum boolean, which is initialized by the autodiff class,
instead of this logic happening inside IoModel.cpp.
Also added test3020 which tests forward difference vs AD driver.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/IoModel.cpp

    r13505 r13516  
    212212        int         numberofvertices;
    213213        int         dummy;
    214         char*       driver=NULL;
     214        bool        keep=false;
    215215
    216216
     
    226226                #ifdef _HAVE_ADOLC_
    227227
    228                 /*Start the trace:  {{{
    229                  * to do so, figure out what kind of driver we are running. Then, according to ADOLC documentation,
    230                  * we'll need to activate keep.
    231                  *
    232                  * From ADOLC userdoc:
    233                  * The optional integer argument keep of trace on determines whether the numerical values of all active variables are
    234                  * recorded in a buffered temporary array or file called the taylor stack. This option takes effect if keep = 1 and
    235                  * prepares the scene for an immediately following gradient evaluation by a call to a routine implementing the reverse
    236                  * mode as described in the Section 4 and Section 5.
    237                  *
    238                  */
    239                 this->FetchData(&driver,AutodiffDriverEnum);
    240                 if (strlen(driver)<=3){
    241                         /*there is no "_reverse" string within the driver string: */
    242                         if(VerboseAutodiff())_pprintLine_("   trace activated with keep off");
    243                         trace_on(1);
    244                 }
    245                 else{
    246                         if (strncmp((const char*)(driver+3),"_reverse",8)==0){
    247                                 if(VerboseAutodiff())_pprintLine_("   trace activated with keep on");
    248                                 trace_on(1,1);
    249                         }
    250                         else{
    251                                 if(VerboseAutodiff())_pprintLine_("   trace activated with keep off");
    252                                 trace_on(1);
    253                         }
    254                 }
    255                 xDelete<char>(driver);
     228                /*Start trace: {{{*/
     229                this->FetchData(&keep,AutodiffKeepEnum);
     230                if(keep)trace_on(1,1);
     231                else    trace_on(1);
     232
    256233                /*}}}*/
    257234                /*build dataset made of independent objects: {{{*/
Note: See TracChangeset for help on using the changeset viewer.