[Ipopt] Maybe an error in the MKL version of the Pardiso interface?

Stefan Vigerske stefan at math.hu-berlin.de
Mon May 26 06:08:46 EDT 2014


Hi,

There is a pardisoinit function in MKL Pardiso, but it takes only 3 
arguments (as the old pardiso interface), not 6:
   https://software.intel.com/en-us/node/470286

So, can you try whether calling the pardisoinit function with 3 
arguments works for you, too?
This would be the patch:

Index: IpPardisoSolverInterface.cpp
===================================================================
--- IpPardisoSolverInterface.cpp	(revision 2485)
+++ IpPardisoSolverInterface.cpp	(working copy)
@@ -62,7 +62,7 @@
  /* Prototypes for Pardiso's subroutines */
  extern "C"
  {
-#ifdef HAVE_PARDISO_OLDINTERFACE
+#if defined(HAVE_PARDISO_OLDINTERFACE) || defined(HAVE_PARDISO_MKL)
    void PARDISOINIT_FUNC(void* PT, const ipfint* MTYPE, ipfint* IPARM);
  #else
    // The following is a fix to allow linking with Pardiso library 
under Windows
@@ -400,7 +400,7 @@
      // Call Pardiso's initialization routine
      IPARM_[0] = 0;  // Tell it to fill IPARM with default values(?)

-#ifndef HAVE_PARDISO_OLDINTERFACE
+#if ! defined(HAVE_PARDISO_OLDINTERFACE) && ! define(HAVE_PARDISO_MKL)
      ipfint ERROR = 0;
      ipfint SOLVER = 0; // initialize only direct solver


Thanks,
Stefan


On 05/25/2014 09:52 PM, Damien wrote:
> Hi Folks,
>
> I'm in the process of porting our Ipopt build over to Intel's MKL
> Pardiso.  I started getting crashes because the PT_ and IPARM_ arrays
> weren't being initialised.  I think there's an error in the code that
> sets up the solver if it's the MKL version (in
> IpPardisoSolverInterface.cpp)  There's a call to PARDISOINIT_FUNC around
> lines 400 - 405, which is defined earlier in the file with the comment:
>
> // The following is a fix to allow linking with Pardiso library under
> Windows
>
> In the Intel MKL version of PARDISO there isn't a 6-parameter PARDISO
> call that's described in the docs.  It passes in the linker though, so
> it must be exposed by the MKL library (possibly by mistake?).  If you
> call it though it takes out everything.  In the Intel version the
> initialisation is just performed as part of the first PARDISO call
> (typically PHASE = 11).
>
> This can be fixed by wrapping the the call to PARDISOINIT_FUNC in a
> #ifdef HAVE_PARDISO_MKL check and initialising the PT_ and IPARM_ arrays:
>
>      // Call Pardiso's initialization routine
>      IPARM_[0] = 0;  // Tell it to fill IPARM with default values(?)
> #ifdef HAVE_PARDISO_MKL  //MKL check
>      for (int i = 0; i < 64; i++)
>      {
>         IPARM_[i] = 0;
>         PT_[i] = 0;
>      }
> #else
> #ifndef HAVE_PARDISO_OLDINTERFACE
>      ipfint ERROR = 0;
>      ipfint SOLVER = 0; // initialize only direct solver
>
>      PARDISOINIT_FUNC(PT_, &MTYPE_, &SOLVER, IPARM_, DPARM_, &ERROR);
> #else
>      PARDISOINIT_FUNC(PT_, &MTYPE_, IPARM_);
> #endif
>
> #endif  //end MKL check
>
> This runs happily on my machine in 32 and 64-bit.  Do you want this as a
> patch (or have I messed something else up in the compile with defines,
> and this shouldn't be necessary?)
>
> Cheers,
>
> Damien
>
>
>
>
>
>
>
>
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/ipopt
>



More information about the Ipopt mailing list