[Clp] Abc problems under windows (Visual / Intel compiler)

ycollette.nospam at free.fr ycollette.nospam at free.fr
Wed Jul 23 10:29:00 EDT 2014


Hello,

I found a problem in AbcSimplex.cpp line 5997:

	} else {
	  // HERE -> abort();
	  // primal - change tolerance
	  if (numberBadTimes_ > 3)
	    model->setCurrentPrimalTolerance(model->currentPrimalTolerance() * 1.05);
	  // if infeasible increase infeasibility cost
	  //if (model->nonLinearCost()->numberInfeasibilities() &&
	  //        model->infeasibilityCost() < 1.0e17) {
	  //   model->setInfeasibilityCost(model->infeasibilityCost() * 1.1);
	  //}
	}
      } else {

There is an abort() which make the resolution hangs under windows when compiled using intel compiler.
I use Cbc 2.8.9.

I also need to modify another file: CoinAbcHelperFunctions.cpp - cpuid function was not defined when compiling using visual studio and then, the prototype of cpuid function is not the same under windows and linux:

#ifdef _MSC_VER
#include <intrin.h>
#else
// From Intel site
// get AVX intrinsics  
#include <immintrin.h>
// get CPUID capability  
//#include <intrin.h>  
#define cpuid(func,ax,bx,cx,dx)\
        __asm__ __volatile__ ("cpuid":\
        "=a" (ax), "=b" (bx), "=c" (cx), "=d" (dx) : "a" (func));  
#endif
// written for clarity, not conciseness  
#define OSXSAVEFlag (1UL<<27)  
#define AVXFlag     ((1UL<<28)|OSXSAVEFlag)  
#define VAESFlag    ((1UL<<25)|AVXFlag|OSXSAVEFlag)  
#define FMAFlag     ((1UL<<12)|AVXFlag|OSXSAVEFlag)  
#define CLMULFlag   ((1UL<< 1)|AVXFlag|OSXSAVEFlag)  

bool DetectFeature(unsigned int feature)
{
  int CPUInfo[4]; //, InfoType=1, ECX = 1;  
  //__cpuidex(CPUInfo, 1, 1);       // read the desired CPUID format  
#ifdef _MSC_VER
  __cpuid(CPUInfo, 1);
#else
  cpuid(1,CPUInfo[0],CPUInfo[1],CPUInfo[2],CPUInfo[3]);
#endif
  unsigned int ECX = CPUInfo[2];  // the output of CPUID in the ECX register.   
  if ((ECX & feature) != feature) // Missing feature   
    return false;
#if 0
  long int val = _xgetbv(0);       // read XFEATURE_ENABLED_MASK register  
  if ((val&6) != 6)               // check OS has enabled both XMM and YMM support.  
    return false;   
#endif
  return true;
}


Best regards,

YC


More information about the Clp mailing list