email notification when iteration reaches to the 10th loop Topic is solved

Problems with syntax of GAMS
Post Reply
zhj0735
User
User
Posts: 16
Joined: 2 years ago

email notification when iteration reaches to the 10th loop

Post by zhj0735 » 2 months ago

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

User avatar
bussieck
Moderator
Moderator
Posts: 617
Joined: 4 years ago

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

Post by bussieck » 2 months 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

zhj0735
User
User
Posts: 16
Joined: 2 years ago

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

Post by zhj0735 » 2 months ago

bussieck wrote:
2 months 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?

User avatar
bussieck
Moderator
Moderator
Posts: 617
Joined: 4 years ago

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

Post by bussieck » 2 months ago

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

zhj0735
User
User
Posts: 16
Joined: 2 years ago

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

Post by zhj0735 » 2 months ago

Thanks a lot for the suggestions.

Best,
Jia

Post Reply