Page 1 of 1

email notification when iteration reaches to the 10th loop

Posted: Fri May 14, 2021 8:04 pm
by zhj0735
Hi,

I am running a huge model on Linux with 15 iterations. I am not sure whether it would be feasible or not. But I would like to get an email notification when the iteration within the GAMS model moves to its 10th iteration. Thus I can speed up the two-step maximization problem on the cluster.

I know that the cluster has its notification system when the model is done, I have the email sent to me. But wondering how can I get the email in the middle of the modeling running but when the iteration hit 10th loop.

Thanks in advance.
Jia

Re: email notification when iteration reaches to the 10th loop

Posted: Sun May 16, 2021 6:55 am
by bussieck
Is this the 10th iteration in a solver or your own iteration inside the GAMS code? For the latter you can implement some logic inside your code (if(iter=10, ...);) and use the "execute" command to call the mailer program on the system to email. If this is inside the solver, you could have a parallel script running (e.g. a Python script) that scans the GAMS log for the start of the 10th iteration and then calls the mailer program.

-Michael

Re: email notification when iteration reaches to the 10th loop

Posted: Sun May 16, 2021 7:02 am
by zhj0735
bussieck wrote: 2 years ago Is this the 10th iteration in a solver or your own iteration inside the GAMS code? For the latter you can implement some logic inside your code (if(iter=10, ...);) and use the "execute" command to call the mailer program on the system to email. If this is inside the solver, you could have a parallel script running (e.g. a Python script) that scans the GAMS log for the start of the 10th iteration and then calls the mailer program.

-Michael
Thanks Michael! I believe it is later one. I have the loop(iter,...) set up in my GAMS code. Can you elaborate more on how to use the execute command to call the mailer program on the system in GAMS?

Re: email notification when iteration reaches to the 10th loop

Posted: Mon May 17, 2021 7:01 am
by bussieck
Check the docs: execute (https://www.gams.com/35/docs/UG_GamsCal ... larExecute) or put_utility 'exec' (https://www.gams.com/35/docs/UG_Put.htm ... utUtil_Ex2). How to call your mailer depends pure on your system. Check with your sysadmin.

-Michael

Re: email notification when iteration reaches to the 10th loop

Posted: Mon May 17, 2021 11:28 pm
by zhj0735
Thanks a lot for the suggestions.

Best,
Jia