Changeset 26534


Ignore:
Timestamp:
11/04/21 08:29:26 (3 years ago)
Author:
Mathieu Morlighem
Message:

CHG: checking for NaNs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/shared/io/Marshalling/Marshalling.cpp

    r26432 r26534  
    1010
    1111#include "./Marshalling.h"
     12#include "../../Numerics/isnan.h"
    1213
    1314WriteCheckpointFunctor::WriteCheckpointFunctor(char** pmarshalled_data_in) : MarshallHandle(MARSHALLING_WRITE){/*{{{*/
     
    8384void RegisterInputFunctor::call(IssmDouble & value){/*{{{*/
    8485        _assert_(this->double_count<size_max);
     86        _assert_(!xIsNan<IssmDouble>(value));
    8587        this->tape_codi->registerInput(value);
    8688        this->identifiers[this->double_count] = value.getIdentifier();
     
    9193                for(int i=0;i<size;i++){
    9294                        _assert_(this->double_count<size_max);
     95                        _assert_(!xIsNan<IssmDouble>(value[i]));
    9396                        this->tape_codi->registerInput(value[i]);
    9497                        this->identifiers[this->double_count] = value[i].getIdentifier();
     
    107110}/*}}}*/
    108111void RegisterOutputFunctor::call(IssmDouble & value){/*{{{*/
     112        _assert_(!xIsNan<IssmDouble>(value));
    109113        this->tape_codi->registerOutput(value);
    110114        this->double_count++;
     
    113117        if(value){
    114118                for(int i=0;i<size;i++){
     119                        _assert_(!xIsNan<IssmDouble>(value[i]));
    115120                        this->tape_codi->registerOutput(value[i]);
    116121                        this->double_count++;
     
    131136void SetAdjointFunctor::call(IssmDouble & value){/*{{{*/
    132137        _assert_(this->double_count<size_max);
     138        _assert_(!xIsNan<IssmDouble>(this->adjoint[this->double_count]));
    133139        value.gradient() = this->adjoint[this->double_count];
    134140        this->double_count++;
     
    138144                for(int i=0;i<size;i++){
    139145                        _assert_(this->double_count<size_max);
     146                        _assert_(!xIsNan<IssmDouble>(this->adjoint[this->double_count]));
    140147                        value[i].gradient() = this->adjoint[this->double_count];
    141148                        this->double_count++;
Note: See TracChangeset for help on using the changeset viewer.