[Coin-lpsolver] Sbb: Use of setTestForDuplicateIndex and CoinMessages

John J Forrest jjforre at us.ibm.com
Thu Apr 1 12:01:05 EST 2004


Jean-Sebastien,

The reason ClpMessage was being called so much was that in 
OsiClpSolverInterface::resolve a "lightweight" copy of fixed model is made 
as it seemed safer as then hints could be used on this created model. 
Unhappily this lightweight copy did have message creation and this can be 
an overhead on very small models.  As far as I can see it does no harm to 
use the fixed model.  This does improve times on small models 
significantly.  If anyone does notice any adverse effects please tell me.

For setTestForDuplicateIndex I have effectively removed it when called 
from fullset.  This is perfectly safe as there is no way a dense vector 
can have duplicates!  However I only see a small improvement.  Can you 
tell me if my changes help more for you?

John Forrest



Jean-Sebastien Roy <js at jeannot.org> 
Sent by: coin-lpsolver-admin at www-124.southbury.usf.ibm.com
03/31/2004 12:35 PM

To
coin-lpsolver at www-124.southbury.usf.ibm.com
cc

Subject
[Coin-lpsolver] Sbb: Use of setTestForDuplicateIndex and CoinMessages






Hi !

I did some profiling of Sbb (I know it's not even version 1.0, but it 
works quite well already !), and made some observations written below.

The CoinPackedVectorBase::setTestForDuplicateIndex seems to test wether 
multiple indices share the same value in the sparse vector (am I right 
?). For that, it creates a std::set using CoinPackedVectorBase::indexSet 
and possibly throw an error.
A run of Sbb using a profiler revealed that on the problems I'm solving, 
a very large part of the time is spent in this function (more than 20%. 
It varies between platforms (Sun or Linux)).

Since, it looks like a debug test, I removed the test (in 
CoinPackedVector::setFull), without any apparent ill effect. Is it 
reasonnable ? Should it be enabled for debug versions only ?

The profiler runs revealed that the second most time consuming task was 
ClpMessage::ClpMessage (allong with all *Message functions) which is 
building the message table for output. It seems to be called extremely 
often (in ClpModel::ClpModel and ClpModel::newLanguage), and takes very 
long since it requires a lot of strdup, strcpy, malloc and free. Like 
the previous line, it's almost 20% of the time spent (even when no 
messages are output).

I thought it could be nice to be able to perform the message table 
building only once. Since I do not understand the Clp code yet, I just 
disabled most of the CoinMessage functionnality.

Regards,

js

_______________________________________________
Coin-lpsolver mailing list
Coin-lpsolver at www-124.ibm.com
http://www-124.ibm.com/developerworks/oss/mailman/listinfo/coin-lpsolver

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/clp/attachments/20040401/750d52a5/attachment.html>


More information about the Clp mailing list