|
View:
New views
8 Messages
—
Rating Filter:
Alert me
|
|
|
[AMPL 2924] Why is ampl+snopt slow in my program?Hi, I'm using ampl with snopt6.2-1, I find it slow even if I give it an perfect initial guess(optimal solution as the initial guess). Just now I tested an easy problem, which has no constraints, and all the constraints could be kept as unchanged(all 0) for the optimal solution, but still it took 0.99 seconds. Here is the output: Call snopt: Presolve eliminates 16623 constraints and 17823 variables. Substitution eliminates 83359 variables. Adjusted problem: 144 variables, all nonlinear 0 constraints, 1 nonlinear objective, 144 nonzeros. snopt 6.2-1: superbasics_limit=249 crash_option = 3 crash_tolerance = 0.1 snopt 6.2-1: optimal solution found 0 iterations, objective 0 Can anyone tell me why it took almost 1 second to solve? Thanks in advance. Cheng --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group. To post to this group, send email to ampl@... To unsubscribe from this group, send email to ampl+unsubscribe@... For more options, visit this group at http://groups.google.com/group/ampl?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
[AMPL 2925] Re: Why is ampl+snopt slow in my program?You may be measuring the preprocessing time by AMPL and/or SNOPT. If you want to solve problems with 10,000-100,000 variables, SNOPT-6 may be slow and SNOPT-7 may be faster but better may be to use an interior point solver such as IPOPT. On Oct 27, 8:32 pm, Cheng <rencheng.dan...@...> wrote: > Hi, > > I'm using ampl with snopt6.2-1, I find it slow even if I give it an > perfect initial guess(optimal solution as the initial guess). > Just now I tested an easy problem, which has no constraints, and all > the constraints could be kept as unchanged(all 0) for the optimal > solution, but still it took 0.99 seconds. > Here is the output: > > Call snopt: > Presolve eliminates 16623 constraints and 17823 variables. > Substitution eliminates 83359 variables. > Adjusted problem: > 144 variables, all nonlinear > 0 constraints, > 1 nonlinear objective, 144 nonzeros. > > snopt 6.2-1: superbasics_limit=249 > crash_option = 3 > crash_tolerance = 0.1 > snopt 6.2-1: optimal solution found > 0 iterations, objective 0 > > Can anyone tell me why it took almost 1 second to solve? Thanks in > advance. > > Cheng You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group. To post to this group, send email to ampl@... To unsubscribe from this group, send email to ampl+unsubscribe@... For more options, visit this group at http://groups.google.com/group/ampl?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
[AMPL 2927] Re: Why is ampl+snopt slow in my program?Since you substituted out over 80K variables, the expression graph for the objective function is likely to be especially big. So just evaluating the objective function and gradients and verifying optimality has probably taken some significant time. Bob Fourer 4er@... > -----Original Message----- > From: ampl@... [mailto:ampl@...] > On Behalf Of Cheng [rencheng.daniel@...] > Sent: Tuesday, October 27, 2009 10:32 PM > To: AMPL Modeling Language > Subject: [AMPL 2924] Why is ampl+snopt slow in my program? > > > Hi, > > I'm using ampl with snopt6.2-1, I find it slow even if I give it an > perfect initial guess(optimal solution as the initial guess). > Just now I tested an easy problem, which has no constraints, and all > the constraints could be kept as unchanged(all 0) for the optimal > solution, but still it took 0.99 seconds. > Here is the output: > > Call snopt: > Presolve eliminates 16623 constraints and 17823 variables. > Substitution eliminates 83359 variables. > Adjusted problem: > 144 variables, all nonlinear > 0 constraints, > 1 nonlinear objective, 144 nonzeros. > > snopt 6.2-1: superbasics_limit=249 > crash_option = 3 > crash_tolerance = 0.1 > snopt 6.2-1: optimal solution found > 0 iterations, objective 0 > > Can anyone tell me why it took almost 1 second to solve? Thanks in > advance. > > Cheng > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group. To post to this group, send email to ampl@... To unsubscribe from this group, send email to ampl+unsubscribe@... For more options, visit this group at http://groups.google.com/group/ampl?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
[AMPL 2929] Re: Why is ampl+snopt slow in my program?Thanks. I used the ampl command to test time: _ampl_elapsed_time = 0.887 _ampl_system_time = 0.0780005 _ampl_user_time = 0.780005 _ampl_time = 0.858005 _solve_system_time = 0 _total_solve_system_time = 0 _total_solve_user_time = 0 It seems that the solver didn't take time, but it's ampl which cost much. Can anyone explain to me what is _ampl_user_time, what's difference between _ampl_elapsed_time and _ampl_time ? Also I will try IPOPT. Cheng On Oct 29, 5:40 am, Hans Mittelmann <mittelm...@...> wrote: > You may be measuring the preprocessing time by AMPL and/or SNOPT. If > you want to solve problems with 10,000-100,000 variables, SNOPT-6 may > be slow and SNOPT-7 may be faster but better may be to use an interior > point solver such as IPOPT. > > On Oct 27, 8:32 pm, Cheng <rencheng.dan...@...> wrote: > > > > > Hi, > > > I'm using ampl with snopt6.2-1, I find it slow even if I give it an > > perfect initial guess(optimal solution as the initial guess). > > Just now I tested an easy problem, which has no constraints, and all > > the constraints could be kept as unchanged(all 0) for the optimal > > solution, but still it took 0.99 seconds. > > Here is the output: > > > Call snopt: > > Presolve eliminates 16623 constraints and 17823 variables. > > Substitution eliminates 83359 variables. > > Adjusted problem: > > 144 variables, all nonlinear > > 0 constraints, > > 1 nonlinear objective, 144 nonzeros. > > > snopt 6.2-1: superbasics_limit=249 > > crash_option = 3 > > crash_tolerance = 0.1 > > snopt 6.2-1: optimal solution found > > 0 iterations, objective 0 > > > Can anyone tell me why it took almost 1 second to solve? Thanks in > > advance. > > > Cheng --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group. To post to this group, send email to ampl@... To unsubscribe from this group, send email to ampl+unsubscribe@... For more options, visit this group at http://groups.google.com/group/ampl?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
[AMPL 2930] Re: Why is ampl+snopt slow in my program?Thanks. I will try to minimize the number of variables. Cheng On Oct 29, 7:18 am, "Robert Fourer" <4...@...> wrote: > Since you substituted out over 80K variables, the expression graph for the > objective function is likely to be especially big. So just evaluating the > objective function and gradients and verifying optimality has probably taken > some significant time. > > Bob Fourer > 4...@... > > > > > -----Original Message----- > > From: ampl@... [mailto:ampl@...] > > On Behalf Of Cheng [rencheng.dan...@...] > > Sent: Tuesday, October 27, 2009 10:32 PM > > To: AMPL Modeling Language > > Subject: [AMPL 2924] Why is ampl+snopt slow in my program? > > > Hi, > > > I'm using ampl with snopt6.2-1, I find it slow even if I give it an > > perfect initial guess(optimal solution as the initial guess). > > Just now I tested an easy problem, which has no constraints, and all > > the constraints could be kept as unchanged(all 0) for the optimal > > solution, but still it took 0.99 seconds. > > Here is the output: > > > Call snopt: > > Presolve eliminates 16623 constraints and 17823 variables. > > Substitution eliminates 83359 variables. > > Adjusted problem: > > 144 variables, all nonlinear > > 0 constraints, > > 1 nonlinear objective, 144 nonzeros. > > > snopt 6.2-1: superbasics_limit=249 > > crash_option = 3 > > crash_tolerance = 0.1 > > snopt 6.2-1: optimal solution found > > 0 iterations, objective 0 > > > Can anyone tell me why it took almost 1 second to solve? Thanks in > > advance. > > > Cheng --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group. To post to this group, send email to ampl@... To unsubscribe from this group, send email to ampl+unsubscribe@... For more options, visit this group at http://groups.google.com/group/ampl?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
[AMPL 2932] Re: Why is ampl+snopt slow in my program?_ampl_elapsed_time is the amount of time that you actually spent waiting for your computer to run AMPL. (It is sometimes called the "wall clock" time because it is the time you would measure using a clock unconnected to the computer.) _ampl_time is an estimate of the amount of time that the computer's processor actually devoted to running AMPL (and not to the other processes that were active at the same time); it is basically the sum of _ampl_system_time and _ampl_user_time, which are two components of the processor time that Unix-based systems (such as Linux) measure separately. I had interpreted your original post as implying that the excessive time was spent in SNOPT. If it's in AMPL then maybe the presolve phase is taking a lot of time to eliminate all those variables and constraints, but you can tell for sure where AMPL is spending its time by setting "option times 1;" as described in question 3.6 of www.ampl.com/FAQ. Bob Fourer 4er@... > -----Original Message----- > From: ampl@... [mailto:ampl@...] > On Behalf Of Cheng [rencheng.daniel@...] > Sent: Wednesday, October 28, 2009 9:10 PM > To: AMPL Modeling Language > Subject: [AMPL 2929] Re: Why is ampl+snopt slow in my program? > > > Thanks. > > I used the ampl command to test time: > _ampl_elapsed_time = 0.887 > _ampl_system_time = 0.0780005 > _ampl_user_time = 0.780005 > _ampl_time = 0.858005 > > _solve_system_time = 0 > _total_solve_system_time = 0 > _total_solve_user_time = 0 > > It seems that the solver didn't take time, but it's ampl which cost > much. > Can anyone explain to me what is _ampl_user_time, what's difference > between _ampl_elapsed_time and _ampl_time ? > > Also I will try IPOPT. > > Cheng > > On Oct 29, 5:40 am, Hans Mittelmann <mittelm...@...> wrote: > > You may be measuring the preprocessing time by AMPL and/or SNOPT. If > > you want to solve problems with 10,000-100,000 variables, SNOPT-6 may > > be slow and SNOPT-7 may be faster but better may be to use an interior > > point solver such as IPOPT. > > > > On Oct 27, 8:32 pm, Cheng <rencheng.dan...@...> wrote: > > > > > > > > > Hi, > > > > > I'm using ampl with snopt6.2-1, I find it slow even if I give it an > > > perfect initial guess(optimal solution as the initial guess). > > > Just now I tested an easy problem, which has no constraints, and all > > > the constraints could be kept as unchanged(all 0) for the optimal > > > solution, but still it took 0.99 seconds. > > > Here is the output: > > > > > Call snopt: > > > Presolve eliminates 16623 constraints and 17823 variables. > > > Substitution eliminates 83359 variables. > > > Adjusted problem: > > > 144 variables, all nonlinear > > > 0 constraints, > > > 1 nonlinear objective, 144 nonzeros. > > > > > snopt 6.2-1: superbasics_limit=249 > > > crash_option = 3 > > > crash_tolerance = 0.1 > > > snopt 6.2-1: optimal solution found > > > 0 iterations, objective 0 > > > > > Can anyone tell me why it took almost 1 second to solve? Thanks in > > > advance. > > > > > Cheng > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group. To post to this group, send email to ampl@... To unsubscribe from this group, send email to ampl+unsubscribe@... For more options, visit this group at http://groups.google.com/group/ampl?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
[AMPL 2935] Re: Why is ampl+snopt slow in my program?Thank you Robert. I tested to use ipopt, but it took longer time than using snopt. Here is the result of using "option times 1" with snopt: Call SNOPT: # incremental total #phase seconds memory memory #execute 0.483603 99645780 99645784 ### .\ampl_files\optimization_solve.run:34(1649) solve ... #compile 0.0156001 0 99645784 #genmod 0 0 99645784 #merge 0 0 99645784 #collect 0.0468003 0 99645784 #presolve 0.124801 41984 99687768 #solveout 0.109201 0 99687768 Presolve eliminates 16623 constraints and 17823 variables. Substitution eliminates 83359 variables. Adjusted problem: 144 variables, all nonlinear 0 constraints 1 nonlinear objective; 144 nonzeros. #presolve 0 0 99687768 #output 0.0156001 0 99687768 SNOPT 6.2-1: Superbasics_limit=249 Crash_option=3 Crash_tolerance=0.1 #Total 0.795605 SNOPT 6.2-1: Optimal solution found. 0 iterations, objective 0 #execute 0 1483800 101171568 The first #execute took the most time, what does #execute represent here? Here is the result of using "option gentimes 1" with snopt: Call SNOPT: ### .\ampl_files\optimization_solve.run:34(1649) solve ... ##genmod times: ##seq seconds cum. sec. mem. inc. name ## 513 0 0 0 phase_time_const Presolve eliminates 16623 constraints and 17823 variables. Substitution eliminates 83359 variables. Adjusted problem: 144 variables, all nonlinear 0 constraints 1 nonlinear objective; 144 nonzeros. SNOPT 6.2-1: Superbasics_limit=249 Crash_option=3 Crash_tolerance=0.1 SNOPT 6.2-1: Optimal solution found. 0 iterations, objective 0 I'm doing work related with computer games, I'm wondering if AMPL is applicable for highly interactive program(say run 30 times per second)? On Oct 30, 12:49 am, "Robert Fourer" <4...@...> wrote: > _ampl_elapsed_time is the amount of time that you actually spent waiting for > your computer to run AMPL. (It is sometimes called the "wall clock" time > because it is the time you would measure using a clock unconnected to the > computer.) _ampl_time is an estimate of the amount of time that the > computer's processor actually devoted to running AMPL (and not to the other > processes that were active at the same time); it is basically the sum of > _ampl_system_time and _ampl_user_time, which are two components of the > processor time that Unix-based systems (such as Linux) measure separately. > > I had interpreted your original post as implying that the excessive time was > spent in SNOPT. If it's in AMPL then maybe the presolve phase is taking a > lot of time to eliminate all those variables and constraints, but you can > tell for sure where AMPL is spending its time by setting "option times 1;" > as described in question 3.6 ofwww.ampl.com/FAQ. > > Bob Fourer > 4...@... > > > > > -----Original Message----- > > From: ampl@... [mailto:ampl@...] > > On Behalf Of Cheng [rencheng.dan...@...] > > Sent: Wednesday, October 28, 2009 9:10 PM > > To: AMPL Modeling Language > > Subject: [AMPL 2929] Re: Why is ampl+snopt slow in my program? > > > Thanks. > > > I used the ampl command to test time: > > _ampl_elapsed_time = 0.887 > > _ampl_system_time = 0.0780005 > > _ampl_user_time = 0.780005 > > _ampl_time = 0.858005 > > > _solve_system_time = 0 > > _total_solve_system_time = 0 > > _total_solve_user_time = 0 > > > It seems that the solver didn't take time, but it's ampl which cost > > much. > > Can anyone explain to me what is _ampl_user_time, what's difference > > between _ampl_elapsed_time and _ampl_time ? > > > Also I will try IPOPT. > > > Cheng > > > On Oct 29, 5:40 am, Hans Mittelmann <mittelm...@...> wrote: > > > You may be measuring the preprocessing time by AMPL and/or SNOPT. If > > > you want to solve problems with 10,000-100,000 variables, SNOPT-6 may > > > be slow and SNOPT-7 may be faster but better may be to use an interior > > > point solver such as IPOPT. > > > > On Oct 27, 8:32 pm, Cheng <rencheng.dan...@...> wrote: > > > > > Hi, > > > > > I'm using ampl with snopt6.2-1, I find it slow even if I give it an > > > > perfect initial guess(optimal solution as the initial guess). > > > > Just now I tested an easy problem, which has no constraints, and all > > > > the constraints could be kept as unchanged(all 0) for the optimal > > > > solution, but still it took 0.99 seconds. > > > > Here is the output: > > > > > Call snopt: > > > > Presolve eliminates 16623 constraints and 17823 variables. > > > > Substitution eliminates 83359 variables. > > > > Adjusted problem: > > > > 144 variables, all nonlinear > > > > 0 constraints, > > > > 1 nonlinear objective, 144 nonzeros. > > > > > snopt 6.2-1: superbasics_limit=249 > > > > crash_option = 3 > > > > crash_tolerance = 0.1 > > > > snopt 6.2-1: optimal solution found > > > > 0 iterations, objective 0 > > > > > Can anyone tell me why it took almost 1 second to solve? Thanks in > > > > advance. > > > > > Cheng --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group. To post to this group, send email to ampl@... To unsubscribe from this group, send email to ampl+unsubscribe@... For more options, visit this group at http://groups.google.com/group/ampl?hl=en -~----------~----~----~----~------~----~------~--~--- |
|
|
RE: [AMPL 2950] Re: Why is ampl+snopt slow in my program?Cheng,
The #execute phase is devoted to executing AMPL commands -- this is why the line for #execute comes before the "solve" statement. Do you have some AMPL statements that are run to set up the data or to perform some other tasks before solving? Especially, a lot of looping can be time-consuming. But possibly these statements won't have to be executed again before later solves. At present AMPL is limited by the time it takes to exchange problem and solution files with the solver. You'll have to experiment to see how many solves you can get per second. Subsequent solves should be much faster than the first one, and you might be able to speed things up by incorporating some of the presolve phase's simplifications directly into your model, and then turning presolve off ("option presolve 0;"). Bob Fourer 4er@... > -----Original Message----- > From: ampl@... [mailto:ampl@...] > On Behalf Of Cheng [rencheng.daniel@...] > Sent: Thursday, October 29, 2009 9:25 PM > To: AMPL Modeling Language > Subject: [AMPL 2935] Re: Why is ampl+snopt slow in my program? > > > Thank you Robert. > > I tested to use ipopt, but it took longer time than using snopt. > > Here is the result of using "option times 1" with snopt: > > Call SNOPT: > # incremental total > #phase seconds memory memory > #execute 0.483603 99645780 99645784 > ### .\ampl_files\optimization_solve.run:34(1649) solve ... > #compile 0.0156001 0 99645784 > #genmod 0 0 99645784 > #merge 0 0 99645784 > #collect 0.0468003 0 99645784 > #presolve 0.124801 41984 99687768 > #solveout 0.109201 0 99687768 > > Presolve eliminates 16623 constraints and 17823 variables. > Substitution eliminates 83359 variables. > Adjusted problem: > 144 variables, all nonlinear > 0 constraints > 1 nonlinear objective; 144 nonzeros. > > #presolve 0 0 99687768 > #output 0.0156001 0 99687768 > SNOPT 6.2-1: Superbasics_limit=249 > Crash_option=3 > Crash_tolerance=0.1 > #Total 0.795605 > SNOPT 6.2-1: Optimal solution found. > 0 iterations, objective 0 > #execute 0 1483800 101171568 > > The first #execute took the most time, what does #execute represent > here? > > Here is the result of using "option gentimes 1" with snopt: > Call SNOPT: > ### .\ampl_files\optimization_solve.run:34(1649) solve ... > ##genmod times: > ##seq seconds cum. sec. mem. inc. name > ## 513 0 0 0 phase_time_const > > Presolve eliminates 16623 constraints and 17823 variables. > Substitution eliminates 83359 variables. > Adjusted problem: > 144 variables, all nonlinear > 0 constraints > 1 nonlinear objective; 144 nonzeros. > > SNOPT 6.2-1: Superbasics_limit=249 > Crash_option=3 > Crash_tolerance=0.1 > SNOPT 6.2-1: Optimal solution found. > 0 iterations, objective 0 > > I'm doing work related with computer games, I'm wondering if AMPL is > applicable for highly interactive program(say run 30 times per > second)? > > On Oct 30, 12:49 am, "Robert Fourer" <4...@...> wrote: > > _ampl_elapsed_time is the amount of time that you actually spent waiting > for > > your computer to run AMPL. (It is sometimes called the "wall clock" > time > > because it is the time you would measure using a clock unconnected to > the > > computer.) _ampl_time is an estimate of the amount of time that the > > computer's processor actually devoted to running AMPL (and not to the > other > > processes that were active at the same time); it is basically the sum of > > _ampl_system_time and _ampl_user_time, which are two components of the > > processor time that Unix-based systems (such as Linux) measure > separately. > > > > I had interpreted your original post as implying that the excessive time > was > > spent in SNOPT. If it's in AMPL then maybe the presolve phase is taking > a > > lot of time to eliminate all those variables and constraints, but you > can > > tell for sure where AMPL is spending its time by setting "option times > 1;" > > as described in question 3.6 ofwww.ampl.com/FAQ. > > > > Bob Fourer > > 4...@... > > > > > > > > > -----Original Message----- > > > From: ampl@... [mailto:ampl@...] > > > On Behalf Of Cheng [rencheng.dan...@...] > > > Sent: Wednesday, October 28, 2009 9:10 PM > > > To: AMPL Modeling Language > > > Subject: [AMPL 2929] Re: Why is ampl+snopt slow in my program? > > > > > Thanks. > > > > > I used the ampl command to test time: > > > _ampl_elapsed_time = 0.887 > > > _ampl_system_time = 0.0780005 > > > _ampl_user_time = 0.780005 > > > _ampl_time = 0.858005 > > > > > _solve_system_time = 0 > > > _total_solve_system_time = 0 > > > _total_solve_user_time = 0 > > > > > It seems that the solver didn't take time, but it's ampl which cost > > > much. > > > Can anyone explain to me what is _ampl_user_time, what's difference > > > between _ampl_elapsed_time and _ampl_time ? > > > > > Also I will try IPOPT. > > > > > Cheng > > > > > On Oct 29, 5:40 am, Hans Mittelmann <mittelm...@...> wrote: > > > > You may be measuring the preprocessing time by AMPL and/or SNOPT. If > > > > you want to solve problems with 10,000-100,000 variables, SNOPT-6 > may > > > > be slow and SNOPT-7 may be faster but better may be to use an > interior > > > > point solver such as IPOPT. > > > > > > On Oct 27, 8:32 pm, Cheng <rencheng.dan...@...> wrote: > > > > > > > Hi, > > > > > > > I'm using ampl with snopt6.2-1, I find it slow even if I give it > an > > > > > perfect initial guess(optimal solution as the initial guess). > > > > > Just now I tested an easy problem, which has no constraints, and > all > > > > > the constraints could be kept as unchanged(all 0) for the optimal > > > > > solution, but still it took 0.99 seconds. > > > > > Here is the output: > > > > > > > Call snopt: > > > > > Presolve eliminates 16623 constraints and 17823 variables. > > > > > Substitution eliminates 83359 variables. > > > > > Adjusted problem: > > > > > 144 variables, all nonlinear > > > > > 0 constraints, > > > > > 1 nonlinear objective, 144 nonzeros. > > > > > > > snopt 6.2-1: superbasics_limit=249 > > > > > crash_option = 3 > > > > > crash_tolerance = 0.1 > > > > > snopt 6.2-1: optimal solution found > > > > > 0 iterations, objective 0 > > > > > > > Can anyone tell me why it took almost 1 second to solve? Thanks in > > > > > advance. > > > > > > > Cheng > > --~--~---------~--~----~------------~-------~--~----~ > You received this message because you are subscribed to the Google Groups > "AMPL Modeling Language" group. > To post to this group, send email to ampl@... > To unsubscribe from this group, send email to > ampl+unsubscribe@... > For more options, visit this group at > http://groups.google.com/group/ampl?hl=en > -~----------~----~----~----~------~----~------~--~--- -- You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group. To post to this group, send email to ampl@.... For more options, visit this group at http://groups.google.com/group/ampl?hl=en. |
| Free embeddable forum powered by Nabble | Forum Help |