Error: can't open /tmp/at1228520.sol

Hello,

My PC ran out of memory for running a large-scale model on it and I decided to move to a powerful linux server.

I installed AMPL on this server successfully, as after running a simplistic model on it I get optimal results back.

ampl: include t1.run;
Gurobi 10.0.1: optimal solution; objective 4
0 simplex iterations
OF = 4
x1 = 0
x2 = 4

However, when I want to run my large-scale model, I run into the following error that I do not know how to resolve.

ampl: include csephund.run;
Error at _cmdno 2 executing “solve” command
(file csephund.run, line 8, offset 116):
can’t open /tmp/at1228520.sol

I appreciate your help.

A message like “can’t open /tmp/at1228520.sol” means that the solver stopped running before it could write the file that contains the solution. This can happen because the solver program ran out of memory, but it could also be a crash for some other reason. The message does not provide any help in determining the cause, so it is necessary to run some tests to learn what is happening.

For an initial test, add the AMPL statement

option show_stats 1, times 1, gentimes 1;

to the beginning of csephund.run. Then execute include csephund.run again, and post all of the output that appears. This will provide useful information about the size and memory requirements of the problem you are attempting to solve.

Also, it will be helpful if you can upload csephund.run with your reply. You can do this by clicking the upload icon at the top of the Discourse editor window.

Here is the output:

ampl: include csephund.run;
                               incremental     total
#phase          seconds         memory          memory
#execute        0.029433        8144344         8144344
 csephund.run:9(158)   solve ...
#compile        0.000485        140984          8285328
##genmod times:
##seq      seconds    cum. sec.    mem. inc.  name
 89        1e-06        1e-06            0  derstage
 93        6e-06        7e-06            0  sstatus
 107        3e-06        1e-05            0  G
 108        4e-06      1.4e-05            0  K
 109        3e-06      1.7e-05            0  II
 110        6e-06      2.3e-05            0  JJ
 111        3e-06      2.6e-05            0  I
 112        5e-06      3.1e-05            0  J
 113        2e-06      3.3e-05            0  RS
 114        3e-06      3.6e-05            0  rrs
 115        3e-06      3.9e-05            0  NRS
 116        3e-06      4.2e-05            0  Ng
 117        5e-06      4.7e-05            0  H
 118        5e-06      5.2e-05            0  L
 119        6e-06      5.8e-05            0  A
 120        5e-06      6.3e-05            0  AS
 121        3e-06      6.6e-05            0  ASp
 122        5e-06      7.1e-05            0  ASpc
 123        6e-06      7.7e-05            0  AT
 124      2.9e-05     0.000106            0  Al
 125        7e-05     0.000176        32800  AN
 126        5e-06     0.000181            0  IA
 127        4e-06     0.000185            0  Ap6
 128        4e-06     0.000189            0  Ap6a
 129        4e-06     0.000193            0  Ap6b
 130        4e-06     0.000197            0  Ap6c
 131        4e-06     0.000201            0  Ap6d
 132        4e-06     0.000205            0  Ap6e
 133        2e-06     0.000207            0  Ap6f
 134        3e-06      0.00021            0  Ap6g
 135        4e-06     0.000214            0  Ap378
 136        3e-06     0.000217            0  Ap378a
 137        3e-06      0.00022            0  Ap1428
 138        5e-06     0.000225            0  Ap1428a
 139        2e-06     0.000227            0  Ap1428b
 140        4e-06     0.000231            0  Ap1428z
 141        5e-06     0.000236            0  Ap1456
 142        4e-06      0.00024            0  Ap1456a
 143        5e-06     0.000245            0  Ap1456b
 144        3e-06     0.000248            0  Ap1456c
 145        4e-06     0.000252            0  Ap823
 146        3e-06     0.000255            0  Ap823a
 147        4e-06     0.000259            0  Ap823b
 148        3e-06     0.000262            0  Ap823c
 149        4e-06     0.000266            0  Ap823d
 150        5e-06     0.000271            0  Ap823e
 151        4e-06     0.000275            0  Ap104
 152        5e-06      0.00028            0  Ap1076
 153        2e-06     0.000282            0  Ap1076a
 154        4e-06     0.000286            0  Ap1076b
 155        3e-06     0.000289            0  Ap1076c
 156        4e-06     0.000293            0  An6
 157        3e-06     0.000296            0  An6a
 158        4e-06       0.0003            0  An6b
 159        5e-06     0.000305            0  An6c
 160        4e-06     0.000309            0  An6d
 161        4e-06     0.000313            0  An6e
 162        5e-06     0.000318            0  An6f
 163        2e-06      0.00032            0  An6g
 164        3e-06     0.000323            0  An378
 165        3e-06     0.000326            0  An378a
 166        3e-06     0.000329            0  An1428
 167        4e-06     0.000333            0  An1428a
 168        5e-06     0.000338            0  An1428b
 169        4e-06     0.000342            0  An1428z
 170        3e-06     0.000345            0  An1456
 171        4e-06     0.000349            0  An1456a
 172        4e-06     0.000353            0  An1456b
 173        5e-06     0.000358            0  An1456c
 174        3e-06     0.000361            0  An823
 175        4e-06     0.000365            0  An823a
 176        4e-06     0.000369            0  An823b
 177        5e-06     0.000374            0  An823c
 178        4e-06     0.000378            0  An823d
 179        3e-06     0.000381            0  An823e
 180        4e-06     0.000385            0  An104
 181        3e-06     0.000388            0  An1076
 182        4e-06     0.000392            0  An1076a
 183        3e-06     0.000395            0  An1076b
 184        4e-06     0.000399            0  An1076c
 185        3e-06     0.000402            0  ay
 186     0.000141     0.000543        81976  b
 187      5.2e-05     0.000595            0  c
 188        5e-06       0.0006            0  T
 189      5.1e-05     0.000651            0  alpha
 190      5.2e-05     0.000703            0  beta
 191        4e-06     0.000707            0  S
 192        8e-06     0.000715            0  cc
 193        4e-06     0.000719            0  ic01
 194        3e-06     0.000722            0  icS1
 195        4e-06     0.000726            0  pmin
 196        3e-06     0.000729            0  pmax
 197        4e-06     0.000733            0  emin
 198        3e-06     0.000736            0  emax
 199        4e-06      0.00074            0  e0
 200        3e-06     0.000743            0  ens
 201      0.00203     0.002773            0  pd
 202      5.9e-05     0.002832            0  ppmin
 203      5.2e-05     0.002884            0  ppmax
 204      5.1e-05     0.002935            0  ur
 205      5.3e-05     0.002988            0  dr
 206     0.000208     0.003196        98376  plmax
 207        7e-06     0.003203            0  sr
 208      5.1e-05     0.003254            0  Toff
 209      5.1e-05     0.003305            0  Ton
 210        5e-06      0.00331            0  cap
 211        3e-06     0.003313            0  capy
 212        4e-06     0.003317            0  capa
 213        4e-06     0.003321            0  v
 214        4e-06     0.003325            0  o
 215      7.7e-05     0.003402            0  x
 216     0.000227     0.003629            0  branchdirct
 217     0.004937     0.008566      3523552  pwu
 218        9e-06     0.008575            0  voll
 219      3.4e-05     0.008609            0  nu
 220        4e-06     0.008613            0  M
 221     0.005967      0.01458      4089344  P
 223     0.001683     0.016263      1048592  Pw
 225     0.001654     0.017917      1048592  Ir
 227     0.001556     0.019473      1048592  Y
 229      0.00155     0.021023      1048592  Z
 231     0.001892     0.022915       918848  Ip
 233     0.012785       0.0357     10245808  Pp
 235     0.003214     0.038914      2097168  Ppp
 237      50.5544      50.5933  23893098048  Q
 239     0.001849      50.5952            0  Gr
 241        2e-05      50.5952            0  E
 243     0.008472      50.6037      4133352  Pl
 245     0.000969      50.6046            0  theta
 247     0.001183      50.6058       524296  Psh
 249     0.003038      50.6089      3145760  nuv
 251     0.002489      50.6113      2097168  xtilde
 253     0.022866      50.6342      1568360  OF
 255     0.000227      50.6344            0  n1
 257      4.8e-05      50.6345        38920  n1a
 259      9.3e-05      50.6346        13384  n1aa
 261      2.1e-05      50.6346            0  n2a
 263      1.4e-05      50.6346            0  n2a1
 265      1.2e-05      50.6346            0  n2a2
 267      1.3e-05      50.6346            0  n2a3
 269      1.3e-05      50.6347            0  n2a4
 271      1.2e-05      50.6347            0  n2a5
 273      1.1e-05      50.6347            0  n2a6
 275      3.3e-05      50.6347        38400  n2a7
 277      3.3e-05      50.6347        33024  n2a8
 279      1.3e-05      50.6348            0  n2a9
 281        1e-05      50.6348            0  n2a10
 283      1.3e-05      50.6348            0  n2a11
 285      1.1e-05      50.6348            0  n2a12
 287        9e-06      50.6348            0  n2a13
 289      1.3e-05      50.6348            0  n2a14
 291      1.3e-05      50.6348            0  n2a15
 293      1.1e-05      50.6348            0  n2a16
 295      1.1e-05      50.6348            0  n2a17
 297      1.2e-05      50.6349            0  n2a18
 299      1.2e-05      50.6349            0  n2a19
 301      1.1e-05      50.6349            0  n2a20
 303        1e-05      50.6349            0  n2a21
 305      1.2e-05      50.6349            0  n2a22
 307      1.1e-05      50.6349            0  n2a23
 309        1e-05      50.6349            0  n2a24
 311      1.7e-05      50.6349            0  n2a25
 313      3.4e-05       50.635        38400  n2a26
 315      1.2e-05       50.635            0  n2a27
 317        9e-06       50.635            0  n2a28
 319     0.001239      50.6362       581120  n2b
 321     0.000982      50.6372       327880  n2c
 323     0.003907      50.6411      1064016  n3a
 325     0.001438      50.6426       345600  n3aa
 327      3.8e-05      50.6426        38400  n4
 329        6e-06      50.6426            0  n5p
 331     0.000191      50.6428        55312  n5bp
 333     0.000189       50.643       125976  n5bpp
 335     0.000101      50.6431        38400  n5
 337        5e-06      50.6431            0  n6
 339      6.94436      57.5875     10119760  n8p
 341      418.203       475.79     23911440  n8pp1
 343       398.28       874.07     14022832  n8pp2
 345     0.005815      874.076      1152000  n8ppm
 347      3.7e-05      874.076            0  n8pa
 349     0.021229      874.097     11746920  n8p2a
 351     0.032113      874.129      3379200  n9
 353     0.000492       874.13       108608  n10p
 355     0.000398       874.13       169552  n11p
 357     0.004445      874.135      1469976  n10
 359     0.006271      874.141      2469392  n10a
 361      0.01283      874.154      4414488  n11
 363      0.01273      874.167      4376088  n12
 365     0.011668      874.178      5410384  n13a
 367     0.003778      874.182       958400  n13b
 369     0.011973      874.194      5771224  n14a
 371     0.003804      874.198       925600  n14b
 373     0.011497      874.209      6574128  n15
 375     0.005382      874.215      3876888  n16
 377     0.019941      874.235      8405040  n17
 379     0.014859      874.249      6832152  n17a
 381       0.0113      874.261      6832152  n18
 383     0.008816       874.27      6832152  n19
 385      88.0643      962.334  26122131984  r1a
 387     0.016717      962.351      3262704  r1b
 389     0.010923      962.362      3492888  r1bb
 391     0.011871      962.373      4491288  r1c
 393     0.010536      962.384      3492888  r1cc
 395     0.011014      962.395      4491288  r1d
 397     0.006879      962.402      2724888  r2a
 399     0.008279       962.41      2993688  r2b
 401     0.008261      962.418      2993688  r2ab
 403     0.008849      962.427      4145688  r2c
 405     0.009161      962.436      4145688  r2ac
 407     0.008829      962.445      4184088  r2d
#genmod         962.445         50224899256     50233184584
#merge          4.75065         4294967304      54528151888
#collect        33.3643         41202905792     95731057680

Presolve eliminates 192724771 constraints and 196576844 variables.
Adjusted problem:
500202 variables:
        223474 binary variables
        276728 linear variables
819580 constraints, all linear; 2101177 nonzeros
        125154 equality constraints
        694426 inequality constraints
1 linear objective; 57737 nonzeros.

#presolve       37.1216         24024228160     119755285840
#output         0.46025         0               119755285840
#Total          1038.17
Error at _cmdno 3 executing "solve" command
(file csephund.run, line 9, offset 158):
can't open /tmp/at3416919.sol
#execute        2.37971         24398640        119779684480

The run file is attached.
csephund.run (354 Bytes)

In the table of “genmod times,” each row gives statistics for processing a particular component of your AMPL model: execution time (seconds), total execution time so far (com. sec.), and additional memory allocated for processing (mem. inc.). You can see that while most components require a reasonable amount of memory, there are two that require over 20 gigabytes: Q and r1a. To process these components and generate a problem for the solver, AMPL requires even more memory, so that the total memory allocation by the time of solving — shown in the last line of the listing — is over 100 gigabytes! (It’s 119,755,285,840 bytes, to be exact, as shown in the last line of the listing.)

The output from option show_stats 1 indicates that almost all of the variables and constraints that are generated are unnecessary, and can be eliminated by AMPL’s presolve phase, after which the problem to be solved actually has a reasonable size:

Presolve eliminates 192724771 constraints and 196576844 variables.
Adjusted problem:
500202 variables:
        223474 binary variables
        276728 linear variables
819580 constraints, all linear; 2101177 nonzeros
        125154 equality constraints
        694426 inequality constraints
1 linear objective; 57737 nonzeros.

So, you should look for an error in how Q and r1a are defined. The most likely cause is that the indexing sets in the definitions of Q and r1a are much larger than they need to be.