[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-glpk] slow model generation
From: |
Zewei Chen |
Subject: |
[Bug-glpk] slow model generation |
Date: |
Tue, 18 Nov 2003 19:21:54 -0500 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020623 Debian/1.0.0-0.woody.1 |
Hi,
I found glpk model generation to be quite slow.
It's about 15 times slower compared to the
ampl interpreter from cplex. Is that well-known?
Are there obvious work-arounds (to reduce model
generation time in general, not just this example)?
Is this related to any known performance bugs that
will be fixed in the next release?
Thanks for your insights.
Zewei
Here's an example model file and summary of
the comparison results (transcript attached):
$ cat t3.mod
set X := 1.._SIZE_;
set Y := 1.._SIZE_;
set Z := 1.._SIZE_;
display sum {x in X, y in Y, z in Z} 1;
end;
$ for s in 50 100 200 400 800; do sed -e "s/_SIZE_/$s/" t3.mod > t.mod;
time ampl t.mod; done
$ for s in 50 100 200 400 800; do sed -e "s/_SIZE_/$s/" t3.mod > t.mod;
time glpsol -m t.mod; done
size size^3 ampl time glpk time
----------------------------------------------------
50 125000 0m0.135s 0m0.222s
100 1e+06 0m0.144s 0m1.491s
200 8e+06 0m0.913s 0m11.558s
400 6.4e+07 0m6.916s 1m48.853s
800 5.12e+08 0m55.370s 13m59.423s
$ cat t3.mod
set X := 1.._SIZE_;
set Y := 1.._SIZE_;
set Z := 1.._SIZE_;
display sum {x in X, y in Y, z in Z} 1;
end;
$ for s in 50 100 200 400 800; do sed -e "s/_SIZE_/$s/" t3.mod > t.mod; time
ampl t.mod; done
+ sed -e s/_SIZE_/50/ t3.mod
+ ampl t.mod
sum{x in X, y in Y, z in Z} 1 = 125000
real 0m0.135s
user 0m0.020s
sys 0m0.000s
+ sed -e s/_SIZE_/100/ t3.mod
+ ampl t.mod
sum{x in X, y in Y, z in Z} 1 = 1e+06
real 0m0.144s
user 0m0.110s
sys 0m0.000s
+ sed -e s/_SIZE_/200/ t3.mod
+ ampl t.mod
sum{x in X, y in Y, z in Z} 1 = 8e+06
real 0m0.913s
user 0m0.860s
sys 0m0.000s
+ sed -e s/_SIZE_/400/ t3.mod
+ ampl t.mod
sum{x in X, y in Y, z in Z} 1 = 6.4e+07
real 0m6.916s
user 0m6.910s
sys 0m0.000s
+ sed -e s/_SIZE_/800/ t3.mod
+ ampl t.mod
sum{x in X, y in Y, z in Z} 1 = 5.12e+08
real 0m55.370s
user 0m55.320s
sys 0m0.000s
$ for s in 50 100 200 400 800; do sed -e "s/_SIZE_/$s/" t3.mod > t.mod; time
glpsol -m t.mod; done
+ sed -e s/_SIZE_/50/ t3.mod
+ glpsol -m t.mod
Reading model section from t.mod...
7 lines were read
Display statement at line 4
125000
Model has been successfully generated
Problem has no rows
real 0m0.222s
user 0m0.180s
sys 0m0.000s
+ sed -e s/_SIZE_/100/ t3.mod
+ glpsol -m t.mod
Reading model section from t.mod...
7 lines were read
Display statement at line 4
1000000
Model has been successfully generated
Problem has no rows
real 0m1.491s
user 0m1.480s
sys 0m0.000s
+ sed -e s/_SIZE_/200/ t3.mod
+ glpsol -m t.mod
Reading model section from t.mod...
7 lines were read
Display statement at line 4
8000000
Model has been successfully generated
Problem has no rows
real 0m11.558s
user 0m11.560s
sys 0m0.000s
+ sed -e s/_SIZE_/400/ t3.mod
+ glpsol -m t.mod
Reading model section from t.mod...
7 lines were read
Display statement at line 4
64000000
Model has been successfully generated
Problem has no rows
real 1m48.853s
user 1m48.810s
sys 0m0.010s
+ sed -e s/_SIZE_/800/ t3.mod
+ glpsol -m t.mod
Reading model section from t.mod...
7 lines were read
Display statement at line 4
512000000
Model has been successfully generated
Problem has no rows
real 13m59.423s
user 13m59.470s
sys 0m0.000s
+ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Pentium(R) 4 CPU 2.40GHz
stepping : 9
cpu MHz : 2394.061
cache size : 512 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips : 4771.02
processor : 1
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Pentium(R) 4 CPU 2.40GHz
stepping : 9
cpu MHz : 2394.061
cache size : 512 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips : 4784.12
- [Bug-glpk] slow model generation,
Zewei Chen <=