Changeset 2045 for stable


Ignore:
Timestamp:
Aug 13, 2014 11:05:38 AM (5 years ago)
Author:
tkr
Message:

Adding ability to set maximum wallclock running time

Location:
stable/1.15/Clp
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • stable/1.15/Clp/configure

    r2039 r2045  
    2075020750COINUTILS_PCLIBS=
    2075120751COINUTILS_PCREQUIRES=
    20752 COINUTILS_DATA=
    2075320752
    2075420753
     
    2126621265OSI_PCLIBS=
    2126721266OSI_PCREQUIRES=
    21268 OSI_DATA=
    2126921267
    2127021268
     
    2177721775OSITESTS_PCLIBS=
    2177821776OSITESTS_PCREQUIRES=
    21779 OSITESTS_DATA=
    2178021777
    2178121778
     
    2225822255SAMPLE_PCLIBS=
    2225922256SAMPLE_PCREQUIRES=
    22260 SAMPLE_DATA=
    2226122257
    2226222258
     
    2273922735NETLIB_PCLIBS=
    2274022736NETLIB_PCREQUIRES=
    22741 NETLIB_DATA=
    2274222737
    2274322738
     
    2365423649GLPK_PCLIBS=
    2365523650GLPK_PCREQUIRES=
    23656 GLPK_DATA=
    2365723651
    2365823652
     
    2418924183MUMPS_PCLIBS=
    2419024184MUMPS_PCREQUIRES=
    24191 MUMPS_DATA=
    2419224185
    2419324186
     
    2490624899
    2490724900# Provide some information about the compiler.
    24908 echo "$as_me:24908:" \
     24901echo "$as_me:24901:" \
    2490924902     "checking for Fortran 77 compiler version" >&5
    2491024903ac_compiler=`set X $ac_compile; echo $2`
     
    2541425407ac_save_FFLAGS=$FFLAGS
    2541525408FFLAGS="$FFLAGS $ac_verb"
    25416 (eval echo $as_me:25416: \"$ac_link\") >&5
     25409(eval echo $as_me:25409: \"$ac_link\") >&5
    2541725410ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
    2541825411echo "$ac_f77_v_output" >&5
     
    2549225485ac_save_FFLAGS=$FFLAGS
    2549325486FFLAGS="$FFLAGS $ac_cv_prog_f77_v"
    25494 (eval echo $as_me:25494: \"$ac_link\") >&5
     25487(eval echo $as_me:25487: \"$ac_link\") >&5
    2549525488ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
    2549625489echo "$ac_f77_v_output" >&5
     
    2908129074BLAS_PCLIBS=
    2908229075BLAS_PCREQUIRES=
    29083 BLAS_DATA=
    2908429076
    2908529077
  • stable/1.15/Clp/src/ClpModel.cpp

    r2035 r2045  
    131131     dblParam_[ClpObjOffset] = 0.0;
    132132     dblParam_[ClpMaxSeconds] = -1.0;
     133     dblParam_[ClpMaxWallSeconds] = -1.0;
    133134     dblParam_[ClpPresolveTolerance] = 1.0e-8;
    134135
     
    768769     dblParam_[ClpObjOffset] = rhs.dblParam_[ClpObjOffset];
    769770     dblParam_[ClpMaxSeconds] = rhs.dblParam_[ClpMaxSeconds];
     771     dblParam_[ClpMaxWallSeconds] = rhs.dblParam_[ClpMaxWallSeconds];
    770772     dblParam_[ClpPresolveTolerance] = rhs.dblParam_[ClpPresolveTolerance];
    771773#ifndef CLP_NO_STD
     
    11061108          if(value >= 0)
    11071109               value += CoinCpuTime();
     1110          else
     1111               value = -1.0;
     1112          break;
     1113
     1114     case ClpMaxWallSeconds:
     1115          if(value >= 0)
     1116               value += CoinWallclockTime();
    11081117          else
    11091118               value = -1.0;
     
    28072816          dblParam_[ClpMaxSeconds] = -1.0;
    28082817}
     2818void
     2819ClpModel::setMaximumWallSeconds(double value)
     2820{
     2821     if(value >= 0)
     2822          dblParam_[ClpMaxWallSeconds] = value + CoinWallclockTime();
     2823     else
     2824          dblParam_[ClpMaxWallSeconds] = -1.0;
     2825}
    28092826// Returns true if hit maximum iterations (or time)
    28102827bool
     
    28162833          hitMax = (CoinCpuTime() >= dblParam_[ClpMaxSeconds]);
    28172834     }
     2835     if (dblParam_[ClpMaxWallSeconds] >= 0.0 && !hitMax) {
     2836          hitMax = (CoinWallclockTime() >= dblParam_[ClpMaxWallSeconds]);
     2837     }
    28182838     return hitMax;
    28192839}
     
    28242844     if (problemStatus_ == 3) {
    28252845          secondaryStatus_ = 0;
    2826           if (CoinCpuTime() >= dblParam_[ClpMaxSeconds] && dblParam_[ClpMaxSeconds] >= 0.0)
     2846          if ((CoinCpuTime() >= dblParam_[ClpMaxSeconds] && dblParam_[ClpMaxSeconds] >= 0.0) ||
     2847              (CoinWallclockTime() >= dblParam_[ClpMaxWallSeconds] && dblParam_[ClpMaxWallSeconds] >= 0.0))
    28272848               secondaryStatus_ = 9;
    28282849     }
     
    33203341     dblParam_[ClpObjOffset] = rhs->dblParam_[ClpObjOffset];
    33213342     dblParam_[ClpMaxSeconds] = rhs->dblParam_[ClpMaxSeconds];
     3343     dblParam_[ClpMaxWallSeconds] = rhs->dblParam_[ClpMaxWallSeconds];
    33223344     dblParam_[ClpPresolveTolerance] = rhs->dblParam_[ClpPresolveTolerance];
    33233345#ifndef CLP_NO_STD
  • stable/1.15/Clp/src/ClpModel.hpp

    r1941 r2045  
    387387     }
    388388     void setMaximumSeconds(double value);
     389     void setMaximumWallSeconds(double value);
    389390     /// Returns true if hit maximum iterations (or time)
    390391     bool hitMaximumIterations() const;
  • stable/1.15/Clp/src/ClpParameters.hpp

    r1665 r2045  
    5959         the objective function. */
    6060     ClpObjOffset,
    61      /// Maximum time in seconds - after this action is as max iterations
     61     /// Maximum time in seconds - after, this action is as max iterations
    6262     ClpMaxSeconds,
     63     /// Maximum wallclock running time in seconds - after, this action is as max iterations
     64     ClpMaxWallSeconds,
    6365     /// Tolerance to use in presolve
    6466     ClpPresolveTolerance,
  • stable/1.15/Clp/src/OsiClp/OsiClpSolverInterface.cpp

    r2035 r2045  
    16211621bool OsiClpSolverInterface::isIterationLimitReached() const
    16221622{
    1623   const int stat = modelPtr_->status();
    1624   return (stat == 3);
     1623  const int status = modelPtr_->status();
     1624  const int secondaryStatus = modelPtr_->secondaryStatus();
     1625  return (status == 3 && secondaryStatus == 0);
    16251626}
    16261627
Note: See TracChangeset for help on using the changeset viewer.