Changeset 13501


Ignore:
Timestamp:
10/02/12 14:15:21 (12 years ago)
Author:
Eric.Larour
Message:

CHG: active keep on in trace for reverse drivers

File:
1 edited

Legend:

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

    r13445 r13501  
    212212        int         numberofvertices;
    213213        int         dummy;
     214        char*       driver=NULL;
    214215
    215216
     
    225226                #ifdef _HAVE_ADOLC_
    226227
    227                 /*Start the trace: */
    228                 trace_on(1);
    229 
    230                 /*build dataset made of independent objects: */
     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 (strcmp((const char*)(driver+3),"_reverse")==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);
     256                /*}}}*/
     257                /*build dataset made of independent objects: {{{*/
    231258                this->independent_objects=new DataSet();
    232259                this->FetchData(&num_independent_objects,AutodiffNumIndependentObjectsEnum);
     
    250277                        xDelete<int>(names);
    251278                        xDelete<int>(types);
    252                 }
     279                } /*}}}*/
     280
    253281                #else
    254282                /*if we asked for AD computations, we have a problem!: */
Note: See TracChangeset for help on using the changeset viewer.