Skip to main content

gurobi.log files abound!

Ongoing

Comments

8 comments

  • Riley Clement
    • Gurobi Staff Gurobi Staff

    Hi Krister,

    these appear in any directory where gurobi is used from,

    This is normal

    but also in any directory where .bashrc is sources

    This is not.

    export GRB_LOGFILE=/home/myuser/.gurobi/gurobi.log

    This seems like an AI hallucination (there is no GRB_LOGFILE variable)

    The environment variables you have set look ok, and they would not trigger Gurobi to run (which is really the only way we can get a log file).  I'm thinking there is something else going on in your .bashrc

    If I open a ticket in our Help Center would you be willing to share your entire .bashrc file there?

    - Riley

    0
  • Krister Swenson
    • First Comment
    • First Question

    Sure.

    0
  • Krister Swenson
    • First Comment
    • First Question

    these appear in any directory where gurobi is used from,

    This is normal

    Thanks for your response Riley,  is there any way to get gurobi to write a log to somewhere other than the current working directory?  I use gurobi on it's own, but snakemake will also use it, meaning anywhere I use snakemake, a gurobi.log file will appear as well.  It's a nuisance.

    0
  • Riley Clement
    • Gurobi Staff Gurobi Staff

    Hi Krister,

    Yes the LogFile parameter is what you need.

    You can set its value to either relative or absolute paths to where you want the logfile to be.  E.g. in Python:

    model.params.LogFile = “/path/to/folder/containing/logs/mylogfile.log”

    I will open up the ticket shortly and you will receive an email to this effect.

    - Riley

    0
  • Krister Swenson
    • First Comment
    • First Question

    I'm running other people's snakemake pipelines, therefore I don't want to modify and install the gurobi python API for every pipeline I have access to.  It would help to have a global setting or environment variable to this effect!

    0
  • Riley Clement
    • Gurobi Staff Gurobi Staff

    Hi Krister,

    You can add a file named gurobi.env to a directory where you run Gurobi from.  Inside the gurobi.env you can add parameters (one line for each) like so:

    LogFile /path/to/folder/containing/logs/mylogfile.log

    This is the closest thing to a global setting I can imagine will ever be available.

    You could consider creating a shell function to that takes a log filepath (or reads it from an environment variables) and snakemake args, creates the gurobi.env file with that setting, runs snakemake, then deletes the gurobi.env file if you want to automate it further.

    - Riley

    0
  • Krister Swenson
    • First Comment
    • First Question

    OK.

    Are you going to make that ticket so that we can get rid of the log files that appear when the .bashrc is read?

    0
  • Riley Clement
    • Gurobi Staff Gurobi Staff

    The ticket was created Thursday last week and you should have received two emails in regards to it.  Can you check you check your spam/junk folder?

    0

Please sign in to leave a comment.