Batch processing in GAMS

Dear GAMS community,

I have several GAMS files, which have different run times, if I run them one by one.
I was hopeing to implemet a batch file (as I know from image processing), to let GAMS run the models I listed in the file consecutively.
How can I use the batch processing. What I found by google search was unfortunately not self explanatory.

Thanks a lot and have a great day!


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/7mQITHAEDg8J.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Try Prof. MacCarl Manual:
http://www.gams.com/mccarl/mccarlhtml/
Good luck


2012/8/20 JapanGo

Dear GAMS community,

I have several GAMS files, which have different run times, if I run them one by one.
I was hopeing to implemet a batch file (as I know from image processing), to let GAMS run the models I listed in the file consecutively.
How can I use the batch processing. What I found by google search was unfortunately not self explanatory.

Thanks a lot and have a great day!


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/7mQITHAEDg8J.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Edson Valle
edsoncv@gmail.com


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

why I cant create a LOG file using the command line gams MYMODEL Lf=mymodel ? ( or why I cant create it anyway ?)

thanks

2012/8/20 Edson Cordeiro do Valle

Try Prof. MacCarl Manual:
http://www.gams.com/mccarl/mccarlhtml/
Good luck


2012/8/20 JapanGo

Dear GAMS community,

I have several GAMS files, which have different run times, if I run them one by one.
I was hopeing to implemet a batch file (as I know from image processing), to let GAMS run the models I listed in the file consecutively.
How can I use the batch processing. What I found by google search was unfortunately not self explanatory.

Thanks a lot and have a great day!


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/7mQITHAEDg8J.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Edson Valle
edsoncv@gmail.com


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

try:

gams trnsport.gms lo=2 lf=filename

–Paul

On Mon, Aug 20, 2012 at 2:26 PM, Lucas Ianni wrote:

why I cant create a LOG file using the command line gams MYMODEL Lf=mymodel ? ( or why I cant create it anyway ?)

thanks


2012/8/20 Edson Cordeiro do Valle

Try Prof. MacCarl Manual:
http://www.gams.com/mccarl/mccarlhtml/
Good luck


2012/8/20 JapanGo

Dear GAMS community,

I have several GAMS files, which have different run times, if I run them one by one.
I was hopeing to implemet a batch file (as I know from image processing), to let GAMS run the models I listed in the file consecutively.
How can I use the batch processing. What I found by google search was unfortunately not self explanatory.

Thanks a lot and have a great day!


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/7mQITHAEDg8J.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Edson Valle
edsoncv@gmail.com


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Paul van der Eijk
GAMS Development Corporation
Tel : (202) 342-0180 Fax : (202) 342-0181
Email: pvandereijk@gams.com
Web : http://www.gams.com


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Uhulll it worked =D

2012/8/20 Paul Van der Eijk

try:

gams trnsport.gms lo=2 lf=filename

–Paul


On Mon, Aug 20, 2012 at 2:26 PM, Lucas Ianni wrote:

why I cant create a LOG file using the command line gams MYMODEL Lf=mymodel ? ( or why I cant create it anyway ?)

thanks


2012/8/20 Edson Cordeiro do Valle

Try Prof. MacCarl Manual:
http://www.gams.com/mccarl/mccarlhtml/
Good luck


2012/8/20 JapanGo

Dear GAMS community,

I have several GAMS files, which have different run times, if I run them one by one.
I was hopeing to implemet a batch file (as I know from image processing), to let GAMS run the models I listed in the file consecutively.
How can I use the batch processing. What I found by google search was unfortunately not self explanatory.

Thanks a lot and have a great day!


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/7mQITHAEDg8J.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Edson Valle
edsoncv@gmail.com


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Paul van der Eijk
GAMS Development Corporation
Tel : (202) 342-0180 Fax : (202) 342-0181
Email: pvandereijk@gams.com
Web : http://www.gams.com

\

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

\

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Thanks for the handbook.
If I search for “batch” it only finds 6 results, mainly related to xls2gms and mdb2gms batch processing.

Anyone else can help?
My goal again: I have e.g. three GAMS model a.gms, b.gms and c.gms
Can I write a code/batch, that all three models are solved consecutively (e.g. overnight) and the resulting files (.log .lst . lxi) are saved automatically as if I run them one by one? Should be possible… but how?

Am Montag, 20. August 2012 17:01:50 UTC+2 schrieb Edsoncv:

Try Prof. MacCarl Manual:
http://www.gams.com/mccarl/mccarlhtml/
Good luck


2012/8/20 JapanGo

Dear GAMS community,

I have several GAMS files, which have different run times, if I run them one by one.
I was hopeing to implemet a batch file (as I know from image processing), to let GAMS run the models I listed in the file consecutively.
How can I use the batch processing. What I found by google search was unfortunately not self explanatory.

Thanks a lot and have a great day!


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/7mQITHAEDg8J.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Edson Valle
eds...@gmail.com


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/zN53-KLKYTwJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

The feature you requested is the “$include filename.gms”, search of INCLUDE
in the manual link and it will show some examples.
Regards

2012/8/22 JapanGo

Thanks for the handbook.
If I search for “batch” it only finds 6 results, mainly related to xls2gms and mdb2gms batch processing.

Anyone else can help?
My goal again: I have e.g. three GAMS model a.gms, b.gms and c.gms
Can I write a code/batch, that all three models are solved consecutively (e.g. overnight) and the resulting files (.log .lst . lxi) are saved automatically as if I run them one by one? Should be possible… but how?

Am Montag, 20. August 2012 17:01:50 UTC+2 schrieb Edsoncv:

Try Prof. MacCarl Manual:
http://www.gams.com/mccarl/mccarlhtml/
Good luck


2012/8/20 JapanGo

Dear GAMS community,

I have several GAMS files, which have different run times, if I run them one by one.
I was hopeing to implemet a batch file (as I know from image processing), to let GAMS run the models I listed in the file consecutively.
How can I use the batch processing. What I found by google search was unfortunately not self explanatory.

Thanks a lot and have a great day!


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/7mQITHAEDg8J.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Edson Valle
eds...@gmail.com


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/zN53-KLKYTwJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Edson Valle
edsoncv@gmail.com


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hi Edson,

thanks for the hint. But using include just includes whatever is in the included file.
As my models are closely related (with minor devitions), they share e.g. sets etc. Thus if I include all files, GAMS returns the error message that sets are already defined.

I am just looking for an automated way to run a couple of GMS files one after the other overnight and not have to start them manually.

In the meantime I found that “$call” could help:

When I just put into an empty GAMS file

$call ‘=gams TESTBATCH1’
$call ‘=gams TESTBATCH2’

and run it, then it takes a while (I don’t see the solve process in the process window as if I start only the file), and after the run is finished, I see at least the *.LST files in the GAMS directory.
Does anyone have experience with it? Is that the right way to do or can something go wrong with it?
And how can I achieve that I also get the *.LOG file produced?

Am Mittwoch, 22. August 2012 14:43:02 UTC+2 schrieb Edsoncv:

The feature you requested is the “$include filename.gms”, search of INCLUDE
in the manual link and it will show some examples.
Regards

2012/8/22 JapanGo

Thanks for the handbook.
If I search for “batch” it only finds 6 results, mainly related to xls2gms and mdb2gms batch processing.

Anyone else can help?
My goal again: I have e.g. three GAMS model a.gms, b.gms and c.gms
Can I write a code/batch, that all three models are solved consecutively (e.g. overnight) and the resulting files (.log .lst . lxi) are saved automatically as if I run them one by one? Should be possible… but how?

Am Montag, 20. August 2012 17:01:50 UTC+2 schrieb Edsoncv:

Try Prof. MacCarl Manual:
http://www.gams.com/mccarl/mccarlhtml/
Good luck


2012/8/20 JapanGo

Dear GAMS community,

I have several GAMS files, which have different run times, if I run them one by one.
I was hopeing to implemet a batch file (as I know from image processing), to let GAMS run the models I listed in the file consecutively.
How can I use the batch processing. What I found by google search was unfortunately not self explanatory.

Thanks a lot and have a great day!


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/7mQITHAEDg8J.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Edson Valle
eds...@gmail.com


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/zN53-KLKYTwJ.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Edson Valle
eds...@gmail.com


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/aX25t_w1e7AJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hello everybody,

I found the solution on how to batch process different GAMS models. It is as easy as following:

$call gams MODELFILENAME lo=2

lo=2 ensure that next to the *.LST file also the *.LOG file is saved as a file.

Thanks to all the helpers!

On Thursday, August 23, 2012 11:45:45 AM UTC+2, JapanGo wrote:

Hi Edson,

thanks for the hint. But using include just includes whatever is in the included file.
As my models are closely related (with minor devitions), they share e.g. sets etc. Thus if I include all files, GAMS returns the error message that sets are already defined.

I am just looking for an automated way to run a couple of GMS files one after the other overnight and not have to start them manually.

In the meantime I found that “$call” could help:

When I just put into an empty GAMS file

$call ‘=gams TESTBATCH1’
$call ‘=gams TESTBATCH2’

and run it, then it takes a while (I don’t see the solve process in the process window as if I start only the file), and after the run is finished, I see at least the *.LST files in the GAMS directory.
Does anyone have experience with it? Is that the right way to do or can something go wrong with it?
And how can I achieve that I also get the *.LOG file produced?

Am Mittwoch, 22. August 2012 14:43:02 UTC+2 schrieb Edsoncv:

The feature you requested is the “$include filename.gms”, search of INCLUDE
in the manual link and it will show some examples.
Regards

2012/8/22 JapanGo

Thanks for the handbook.
If I search for “batch” it only finds 6 results, mainly related to xls2gms and mdb2gms batch processing.

Anyone else can help?
My goal again: I have e.g. three GAMS model a.gms, b.gms and c.gms
Can I write a code/batch, that all three models are solved consecutively (e.g. overnight) and the resulting files (.log .lst . lxi) are saved automatically as if I run them one by one? Should be possible… but how?

Am Montag, 20. August 2012 17:01:50 UTC+2 schrieb Edsoncv:

Try Prof. MacCarl Manual:
http://www.gams.com/mccarl/mccarlhtml/
Good luck


2012/8/20 JapanGo

Dear GAMS community,

I have several GAMS files, which have different run times, if I run them one by one.
I was hopeing to implemet a batch file (as I know from image processing), to let GAMS run the models I listed in the file consecutively.
How can I use the batch processing. What I found by google search was unfortunately not self explanatory.

Thanks a lot and have a great day!


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/7mQITHAEDg8J.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Edson Valle
eds...@gmail.com


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/zN53-KLKYTwJ.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Edson Valle
eds...@gmail.com


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/JugXQH3HJIsJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

If they share the same data structure, you can separate the data in one file (sets, parameters, read from text file, etc) include the file and than, the other files that depends on it. I’ve already done it and it worked, for example:
name a file, eg. general.gms in this file put:
$include dataread.gms
*(don’t need to declare the sets or parameters again)
$include a.gms
*(don’t need to declare the sets or parameters again)
$include b.gms
*(don’t need to declare the sets or parameters again)
$include c.gms

And than, run general.gms

If each file has sets and parameters that you don’t want to share, just put a different name in them.
Regards

2012/8/23 JapanGo

Hi Edson,

thanks for the hint. But using include just includes whatever is in the included file.
As my models are closely related (with minor devitions), they share e.g. sets etc. Thus if I include all files, GAMS returns the error message that sets are already defined.

I am just looking for an automated way to run a couple of GMS files one after the other overnight and not have to start them manually.

In the meantime I found that “$call” could help:

When I just put into an empty GAMS file

$call ‘=gams TESTBATCH1’
$call ‘=gams TESTBATCH2’

and run it, then it takes a while (I don’t see the solve process in the process window as if I start only the file), and after the run is finished, I see at least the *.LST files in the GAMS directory.
Does anyone have experience with it? Is that the right way to do or can something go wrong with it?
And how can I achieve that I also get the *.LOG file produced?

Am Mittwoch, 22. August 2012 14:43:02 UTC+2 schrieb Edsoncv:

The feature you requested is the “$include filename.gms”, search of INCLUDE
in the manual link and it will show some examples.
Regards

2012/8/22 JapanGo

Thanks for the handbook.
If I search for “batch” it only finds 6 results, mainly related to xls2gms and mdb2gms batch processing.

Anyone else can help?
My goal again: I have e.g. three GAMS model a.gms, b.gms and c.gms
Can I write a code/batch, that all three models are solved consecutively (e.g. overnight) and the resulting files (.log .lst . lxi) are saved automatically as if I run them one by one? Should be possible… but how?

Am Montag, 20. August 2012 17:01:50 UTC+2 schrieb Edsoncv:

Try Prof. MacCarl Manual:
http://www.gams.com/mccarl/mccarlhtml/
Good luck


2012/8/20 JapanGo

Dear GAMS community,

I have several GAMS files, which have different run times, if I run them one by one.
I was hopeing to implemet a batch file (as I know from image processing), to let GAMS run the models I listed in the file consecutively.
How can I use the batch processing. What I found by google search was unfortunately not self explanatory.

Thanks a lot and have a great day!


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/7mQITHAEDg8J.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Edson Valle
eds...@gmail.com


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/zN53-KLKYTwJ.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Edson Valle
eds...@gmail.com


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/aX25t_w1e7AJ.

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Edson Valle
edsoncv@gmail.com


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.