chiark / gitweb /
Report glpsol errors much better
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Wed, 26 Aug 2009 00:06:33 +0000 (01:06 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Wed, 26 Aug 2009 00:06:33 +0000 (01:06 +0100)
yarrg/web/routetrade

index b394a3527843e0cdeddd0ca7e7d1376506a45f3b..6fe34fee16d382e0eb0e954a2e9fa6f174f04e23 100644 (file)
@@ -410,7 +410,9 @@ if ($qa->{'debug'}) {
                qw(glpsol --cpxlp /dev/stdin -o /dev/stdout));
        print "<pre>\n" if $qa->{'debug'};
        my $found_section= 0;
+       my $glpsol_out= '';
        while (<$output>) {
+               $glpsol_out.= $_;
                print encode_entities($_) if $qa->{'debug'};
                if (m/^\s*No\.\s+Column name\s+St\s+Activity\s/) {
                        die if $found_section>0;
@@ -431,8 +433,9 @@ if ($qa->{'debug'}) {
                $flow->{OptCapital}= $flow->{OptQty} * $flow->{'org_price'};
        }
        print "</pre>\n" if $qa->{'debug'};
-       pipethrough_run_finish($output, 'glpsol');
-       die unless $found_section;
+       my $prerr= "\n=====\n$cplex\n=====\n$glpsol_out\n=====\n ";
+       pipethrough_run_finish($output,$prerr);
+       die $prerr unless $found_section;
 };
 
 $addcols->({ DoReverse => 1 }, qw(