[gecode-users] Freeze with MSVC 2015 optimized build

Filip Konvička filip.konvicka at logis.cz
Thu Sep 17 15:38:50 CEST 2015


Sure, it's the script from my original post.  I'm re-attaching it now.
I also used Gecode trunk (updated about September 1st) with Qt-5.5, 
built in my Cygwin environment with MSVC 2015 RTM x64 compiler.

Thanks,
Filip

> Hi Filip,
>
> If you tell me which script you tried, I can try here (even though Gist
> works for me with MSVC 2015 and Qt-5.5.0, using the trunk).
>
> Cheers
> Christian
>
> --
> Christian Schulte, www.gecode.org/~schulte
> Professor of Computer Science, KTH, cschulte at kth.se
> Expert Researcher, SICS, cschulte at sics.se
>
> -----Original Message-----
> From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
> Of Filip Konvicka
> Sent: Thursday, September 17, 2015 03:24 PM
> To: users at gecode.org
> Subject: Re: [gecode-users] Freeze with MSVC 2015 optimized build
>
>> I was trying to use the Qt installer but Qt does not seem to be
>> visible in the cygwin environment.  I'll try the source package as you
>> suggest, that sounds better to me.
>
> So in the end I finished using the pre-built version of Qt and I'm now able
> to run the script in Gist (Gist::dfs). The issue is still there.  I ran
> 'Next Solution' - this apparently runs the search in a separate thread but
> never finishes (and 'Stop' does not stop the search, you have to kill the
> program). Inspecting the nodes one by one freezes the program during the 3rd
> expansion, and in this case the program stops responding altogether.
>
> So my guess is this is really some tight loop somewhere in Gecode (maybe
> caused by a new optimization or bug in the new compiler?)
>
> Cheers,
> Filip
>
>
>
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
>

-------------- next part --------------
#pragma warning(push)
#pragma warning(disable : 4251 4355 4800)
#include <gecode/driver.hh>
#include <gecode/int.hh>
#include <gecode/minimodel.hh>
#pragma warning(pop)

//#include <gecode/gist.hh>

using namespace Gecode;

struct LayoutCalculator2 : public Space {
  double min_edge_width;
  double fit_to_width;

  IntVar      total_width;
  IntVar      scroll_area;

  IntVarArray start_times;
  IntVarArray widths;
  FloatVar    scaler;

  /// Constructor for cloning \a s
  LayoutCalculator2(bool share, LayoutCalculator2& s)
    : Space(share,s)
    , min_edge_width(s.min_edge_width)
    , fit_to_width(s.fit_to_width)
  {
    total_width.update(*this, share, s.total_width);
    scroll_area.update(*this, share, s.scroll_area);
    start_times.update(*this, share, s.start_times);
    widths.update(*this, share, s.widths);
    scaler.update(*this, share, s.scaler);
  }

  /// Copy during cloning
  virtual Space*
    copy(bool share) {
      return new LayoutCalculator2(share,*this);
  }

  /// Actual model
  LayoutCalculator2(double min_edge_width, double fit_to_width)
    : min_edge_width(min_edge_width)
    , fit_to_width(fit_to_width)
  {
    const int num_nodes = 2;
    total_width = IntVar(*this, 0, Gecode::Int::Limits::max);
    scroll_area = IntVar(*this, 0, Gecode::Int::Limits::max);
    start_times = IntVarArray(*this, num_nodes, 0, Gecode::Int::Limits::max);
    widths = IntVarArray(*this, num_nodes, 0, Gecode::Int::Limits::max);
    scaler = FloatVar(*this, 0, Gecode::Float::Limits::max);

    {
      FloatVar fl_width(*this, 0, Gecode::Float::Limits::max);
      rel(*this, max(FloatVal(228.),
                     8686.9666660000003
                     * scaler) <= fl_width);
      IntVar int_width(*this, 0, Gecode::Int::Limits::max);
      channel(*this, fl_width, int_width);
      rel(*this, int_width <= widths[0]);
    }
    {
      FloatVar fl_width(*this, 0, Gecode::Float::Limits::max);
      rel(*this, max(FloatVal(265.), 1. * scaler) <= fl_width);
      IntVar int_width(*this, 0, Gecode::Int::Limits::max);
      channel(*this, fl_width, int_width);
      rel(*this, int_width <= widths[0]);
      rel(*this, start_times[0] + widths[0] + (int)min_edge_width <= start_times[1]);
      rel(*this, start_times[1] + widths[1] <= total_width);
    }

    rel(*this, max(0, total_width - (int)fit_to_width) == scroll_area);

    // Minimize scroll area
    branch(*this, scroll_area, INT_VAL_MIN());
    // Maximize scaler
    //branch(*this, scaler, FLOAT_VAL_SPLIT_MAX());
    branch(*this, scaler, FLOAT_VAL_SPLIT_MAX());
    /*
    // Minimize total width (just assign)
    branch(*this, total_width, INT_VAL_MIN());
    // Maximize all start times (push right)
    branch(*this, start_times, INT_VAR_MAX_MIN(), INT_VAL_MAX());
    // Minimize widths
    branch(*this, widths, INT_VAR_MAX_MIN(), INT_VAL_SPLIT_MIN());
    */
  }
};


int main()
{
  LayoutCalculator2 init(50, 893);
  Gecode::Search::TimeStop t(1000);
  Gecode::Search::Options o;
  o.stop = &t;
  Gecode::dfs(&init, o);
  //Gist::dfs(&init);
  return 0;
}



More information about the users mailing list