[petsc-dev] 32-bits or 64-bits petsc

Barry Smith bsmith at mcs.anl.gov
Wed Sep 18 19:40:44 CDT 2013


On Sep 18, 2013, at 6:39 PM, Jose David Bermeol <jbermeol at purdue.edu> wrote:

> Hi, I've been checking how you do it in superlu_dist, and you do in the install method of SuperLUDIST.py. However I'm using intel mkl so I don't installed, so I have to decide between libmkl_intel_lp64.so and libmkl_intel_lp.so. How can I do that?? or Would I have two different packages one for mkl-32-bits and one for  mkl-64-bits?

   You would  link against the "correct" MKL libraries depending on if PETSc is installed with --with-64-bit-indices or not. I think your cparidso.py file would select the appropriate libraries based on that flag being set. 

You can use python like 

   self.libraryOptions   = framework.require('PETSc.utilities.libraryOptions', self)

in the   def setupDependencies(self, framework):

then have

  def generateLibList(self,dir):
    '''Normally the one in package.py is used, but libraries used depends on PETSc configuration""
    alllibs = PETSc.package.NewPackage.generateLibList(self,dir)
    if self.libraryOptions.integerSize == 64: alllibs[0].extend('libmkl_intel_lp64.so')
    else: alllibs[0].extend('libmkl_intel_lp.so')
    return alllibs

Now it will test different libraries based on the index size.    

Barry

Now if you are using 64 bit integer MKL libraries for blas/lapack also you will have to make sure that 
self.addDefine('HAVE_64BIT_BLAS_INDICES', 1) is also applied to PETSc knows the integers passed to blas/lapack must be 64 bit.




  
   Barry

> 
> Thanks
> 
> ----- Original Message -----
> From: "Barry Smith" <bsmith at mcs.anl.gov>
> To: "Jed Brown" <jedbrown at mcs.anl.gov>
> Cc: "Jose David Bermeol" <jbermeol at purdue.edu>, "For users of the development version of PETSc" <petsc-dev at mcs.anl.gov>
> Sent: Wednesday, September 18, 2013 2:55:54 PM
> Subject: Re: [petsc-dev] 32-bits or 64-bits petsc
> 
> 
>   Except for our calls to BLAS/LAPACK and MPI (where we have no choice) we avoid having to convert indices en mass between packages. For example when building PETSc with 32 bit indices we link against superlu_dist built for 32 bit indices and when building PETSc with 64 bit indices we link against superlu_dist built for 64 bit indices. We don't allow linking 64 bit index PETSc against both 32 bit and 64 bit superlu_dist and casting all the indices on the fly when copying them over.   I recommend you take the same route it reduces complexity of the interface and having that added flexibility doesn't buy you much IMHO.
> 
>   Barry
> 
> 
> 
> On Sep 18, 2013, at 1:32 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> 
>> sizeof(PetscInt) or the macro PETSC_USE_64BIT_INDICES
>> 
>> On Sep 18, 2013 11:30 AM, "Jose David Bermeol" <jbermeol at purdue.edu> wrote:
>> Hi, I'm coding a solver, and I'm using PetscInt for indices, the problem is that a have to do a cast to int or long long int to pass the information to my external package, is there a variable that says which kind of indices(int or long long int) I'm using?
>> 
>> Thanks




More information about the petsc-dev mailing list