visibility to CP-SAT solver progress metric in Java

627 views
Skip to first unread message

Slav Kochepasov

unread,
Apr 15, 2019, 2:34:12 PM4/15/19
to or-tools-discuss
This topic is spin off from other topic discusing unexpected CP-SAT solver "slowness".

As per advice you can get visibility to CP-SAT solver performance metrics:
> You need to pass --vmodule=cp_model_solver=1 --logtostderr to a binary that will parse arguments using gflags.
> If you are on another language, you can print out the protobuf of the model. In python, print(str(model.Proto()))

I am on v6.10 or-tools library using Java wrapper. So nether of the tips are applicable to my case.

Horever You can get summary of SAT solver execution in Java by println(solver.responseStats());
As of reading SAT logging output I still need help.
I do not see any parameters like "--vmodule=cp_model_solver=1 --logtostderr" in SatParameters.java
Also there is no anything like model.Proto() in CpModel class to get stderr from protobuffer.

Howvere I found log_search_progress parameter that "Whether the solver should log the search progress to LOG(INFO)." However no mentioning how to set logger to The solver.

Any help would be appreciated.


Laurent Perron

unread,
Apr 15, 2019, 3:06:03 PM4/15/19
to or-tools-discuss
I push last week the fact that setting the parameter log_search_progress to true will display the log in any language.
The logger will be stderr as we reuse the glog library.

To get the proto in java:

  public CpModelProto model() {
    return modelBuilder.build();
  }

--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/f7afc3b9-4b02-4d49-97df-00398b426caf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
--Laurent

Slav Kochepasov

unread,
Apr 15, 2019, 3:17:44 PM4/15/19
to or-tools-discuss
I set 
    SatParameters.Builder parameters = solver.getParameters();
   parameters.setLogSearchProgress(true);

Still nothing in System.err. I am on v6.10.


On Monday, April 15, 2019 at 3:06:03 PM UTC-4, Laurent Perron wrote:
I push last week the fact that setting the parameter log_search_progress to true will display the log in any language.
The logger will be stderr as we reuse the glog library.

To get the proto in java:

  public CpModelProto model() {
    return modelBuilder.build();
  }

Le lun. 15 avr. 2019 à 11:34, Slav Kochepasov <vkoch...@gmail.com> a écrit :
This topic is spin off from other topic discusing unexpected CP-SAT solver "slowness".

As per advice you can get visibility to CP-SAT solver performance metrics:
> You need to pass --vmodule=cp_model_solver=1 --logtostderr to a binary that will parse arguments using gflags.
> If you are on another language, you can print out the protobuf of the model. In python, print(str(model.Proto()))

I am on v6.10 or-tools library using Java wrapper. So nether of the tips are applicable to my case.

Horever You can get summary of SAT solver execution in Java by println(solver.responseStats());
As of reading SAT logging output I still need help.
I do not see any parameters like "--vmodule=cp_model_solver=1 --logtostderr" in SatParameters.java
Also there is no anything like model.Proto() in CpModel class to get stderr from protobuffer.

Howvere I found log_search_progress parameter that "Whether the solver should log the search progress to LOG(INFO)." However no mentioning how to set logger to The solver.

Any help would be appreciated.


--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools...@googlegroups.com.


--
--Laurent

Laurent Perron

unread,
Apr 15, 2019, 4:04:47 PM4/15/19
to or-tools-discuss
As I said, I pushed the changed to github.

You need to compile from source the master branch of github. This will eventually become release 7.1
Laurent Perron | Operations Research | lpe...@google.com | (33) 1 42 68 53 00



To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/e68e1709-b599-4f48-896e-111b5f90338b%40googlegroups.com.

Slav Kochepasov

unread,
Apr 15, 2019, 4:09:27 PM4/15/19
to or-tools-discuss
Now I understood you, thanks.
Reply all
Reply to author
Forward
0 new messages