Changeset 23266


Ignore:
Timestamp:
09/12/18 10:39:24 (7 years ago)
Author:
Mathieu Morlighem
Message:

BUG: fixing handling of external functions in codipack

Location:
issm/trunk-jpl/src/c/toolkits
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/toolkits/gsl/DenseGslSolve.cpp

    r23251 r23266  
    254254
    255255#ifdef _HAVE_CODIPACK_
    256 void SolverxSeq_codi_b(codi::DataStore* data) {/*{{{*/
    257   IssmDouble::TapeType& tape = IssmDouble::getGlobalTape();
     256void SolverxSeq_codi_b(void* tape_in,void* data_in,void* ra) {/*{{{*/
     257
     258        /*recast data_in and tape*/
     259        codi::DataStore* data = (codi::DataStore*)data_in;
     260        //IssmDouble::TapeType& tape = (IssmDouble::TapeType&)tape_in;
     261        IssmDouble::TapeType& tape = IssmDouble::getGlobalTape();
    258262
    259263  IssmDouble::Real* valueATrans;
     
    291295}
    292296/*}}}*/
    293 void SolverxSeq_codi_delete(codi::DataStore* data) {/*{{{*/
     297void SolverxSeq_codi_delete(void* tape_in,void* data_in) {/*{{{*/
     298
     299        /*recast data_in*/
     300        codi::DataStore* data = (codi::DataStore*)data_in;
     301
    294302  IssmDouble::Real* valueATrans;
    295303  IssmDouble::GradientData* indexATrans;
     
    365373    dataHandler->addData(n);
    366374
    367     tape.pushExternalFunction(&SolverxSeq_codi_b, dataHandler, &SolverxSeq_codi_delete);
     375    tape.pushExternalFunctionHandle(&SolverxSeq_codi_b, dataHandler, &SolverxSeq_codi_delete);
    368376  } else {
    369377    // if the tape is active valueX is stored in the dataHandler and deleted in the reverse sweep
  • issm/trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp

    r23255 r23266  
    480480
    481481#ifdef _HAVE_CODIPACK_
    482 void MumpsSolve_codi_b(codi::DataStore* data) {/*{{{*/
     482void MumpsSolve_codi_b(void* tape_in,void* data_in,void* ra) {/*{{{*/
     483
     484        /*recast data_in and tape*/
     485  codi::DataStore* data = (codi::DataStore*)data_in;
     486  //IssmDouble::TapeType& tape = (IssmDouble::TapeType&)tape_in;
    483487  IssmDouble::TapeType& tape = IssmDouble::getGlobalTape();
     488
    484489
    485490  IssmDouble::Real* valueATrans;
     
    524529}
    525530/*}}}*/
    526 void MumpsSolve_codi_delete(codi::DataStore* data) {/*{{{*/
     531void MumpsSolve_codi_delete(void* tape_in,void* data_in) {/*{{{*/
     532
     533        /*recast data_in*/
     534        codi::DataStore* data = (codi::DataStore*)data_in;
     535
    527536  IssmDouble::Real* valueATrans;
    528537  IssmDouble::GradientData* indexATrans;
     
    616625    dataHandler->addData(parameters); // we assume here that parameters is still intact when the reverse run is called
    617626
    618          tape.pushExternalFunction(&MumpsSolve_codi_b, dataHandler, &MumpsSolve_codi_delete);
    619     //tape.pushExternalFunctionHandle(&MumpsSolve_codi_b, dataHandler, &MumpsSolve_codi_delete);
     627         //tape.pushExternalFunction(&MumpsSolve_codi_b, dataHandler, &MumpsSolve_codi_delete);
     628    tape.pushExternalFunctionHandle(&MumpsSolve_codi_b,(void*)dataHandler, &MumpsSolve_codi_delete);
    620629  } else {
    621630    // if the tape is active valueB is stored in the dataHandler and deleted in the reverse sweep
Note: See TracChangeset for help on using the changeset viewer.