Changeset 27924


Ignore:
Timestamp:
09/22/23 11:18:18 (18 months ago)
Author:
Mathieu Morlighem
Message:

BUG: checking for inf in gradient

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

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/cores/controladm1qn3_core.cpp

    r27767 r27924  
    488488        Gnorm = sqrt(Gnorm);
    489489        _assert_(!xIsNan(Gnorm));
     490        _assert_(!xIsInf(Gnorm));
    490491
    491492        /*Print info*/
  • issm/trunk-jpl/src/c/cores/transient_core.cpp

    r27869 r27924  
    517517        /*Broadcast gradient to other ranks (make sure to sum all gradients)*/
    518518        ISSM_MPI_Allreduce(Xb,G,Xsize,ISSM_MPI_PDOUBLE,ISSM_MPI_SUM,IssmComm::GetComm());
     519        #ifdef _ISSM_DEBUG_
     520        for(int i=0; i<Xsize; i++){
     521                if(xIsNan(Xb[i])) _error_("Found NaN in gradient at position "<<i);
     522                if(xIsInf(Xb[i])) _error_("Found Inf in gradient at position "<<i);
     523        }
     524        #endif
    519525
    520526        /*Cleanup and return misfit*/
Note: See TracChangeset for help on using the changeset viewer.