Running GroIMP headless without opening and closing GroIMP every model run

For a sensitivity and optimisation analysis of a GroIMP model through R, I call the model headless through a Windows shell command:

C: && cd “C:\Progra~1\Java\jdk-22\bin” && java -Xverify:none -Xmx14000m -jar “C:\Progra~1\GroIMP 2.1.3\core.jar” --headless “inputfile” “outputfile” --debug=INFO “model gs file” 2> “logfile

Such a headless run is repeated for multiple input files in a row. However, this command opens and closes GroIMP for every model run. How can I modify the headless command such that GroIMP is only openend before the first model run and closed after the last?

Thank you!

Hi,
I think it would be very hard to change the headless mode to do so, but GroIMP comes with other interfaces that can be used for this purpose. You can have a look here: tutorials:interfaces [GroIMP wiki]

From what you said about your project I would suggest you to either use the HTTP-server (that would work almost identical to the headless mode) or the API. There is even a small tutorial on Sensitivity anlysis in R using the API. tutorials:sensitivity-analysis-using-grolink-and-gror [GroIMP wiki]

1 Like