Dear Miguel,

Thank you for your efforts to help me.  It *almost* works.

Adding the .a files cause compilation of the serial version to break, so I have 
to patch the setup scripts to support an mpi_extra_objects that only gets  
added to the parallel build, and then still link with -llibvdwxc etc for the 
serial version.

Unfortunately that just makes another part of the parallel self-test segfault.

I think life is too short to spend more time on this.  GPAW with only include 
libvdwxc support when built with the foss toolchain.  Perhaps once a newer 
version of GPAW does not do strange things to load FFTW, I will be able to get 
it to work.

Best regards

Jakob



> On 11 Oct 2018, at 16:02, Jakob Schiøtz <[email protected]> wrote:
> 
> 
> 
>> On 11 Oct 2018, at 14:17, Miguel Costa <[email protected]> wrote:
>> 
>> 
>> 
>> On Thu, 11 Oct 2018, 15:36 Jakob Schiøtz, <[email protected]> wrote:
>> 
>> Unfortunately, this is where the problem is.  It causes core dumps.  
>> According to the libvdwxc developer, this is because MKL and FFTW use the 
>> same internal function names for incompatible functions (I assume some 
>> internal functions called by the official API functions).
>> 
>> Ok, I can reproduce that issue, in the parallel tests [1], but if I try to 
>> use static libvdwxc and fftw, that test passes, and I still see usage of 
>> MKL's FFT routines with perf, so at least something else in GPAW is still 
>> using MKL's FFT, but this would need further testing to be sure.
>> 
>> I suppose this is not very robust, as it depends on the order of stuff in 
>> the link line, but fwiw, what I did was change the customize-intel patch to:
>> 
>> +libvdwxc = os.getenv('EBROOTLIBVDWXC')
>> +realfftw = os.getenv('EBROOTFFTW')
>> +if libvdwxc and realfftw:
>> +    include_dirs.append(os.path.join(libvdwxc, 'include'))
>> +    extra_objects.append(os.path.join(libvdwxc, 'lib', 'libvdwxc.a'))
>> +    extra_objects.append(os.path.join(realfftw, 'lib', 'libfftw3_mpi.a'))
>> +    extra_objects.append(os.path.join(realfftw, 'lib', 'libfftw3.a’))
> 
> OK, I was just playing with the -lxxxx options, but not forcing static 
> linking by adding the library itself.  Maybe that is what is needed, I will 
> experiment further.
> 
>> 
>> (ah, I also needed to build libvdwxc with -fPIC)
> 
> I did not do that, as far as I know.  How do I specify that in the .eb file?
> 
> Thanks for the suggestions, I will continue to experiment.
> 
> Did you test if the serial test still worked?  I cannot get both to work 
> without crashing, only one at a time :-)
> 
> Best regards
> 
> Jakob
> 
> 
> 
>> 
>> Does this help?
>> 
>> Miguel
>> 
>> [1] since the problem is only in the parallel tests, an alternative would be 
>> to only use serial fftw in libvdwxc?
>> 
>> 
>> 
>>> Or did I misunderstand?
>>> 
>>> Miguel
>> 
>> --
>> Jakob Schiøtz, professor, Ph.D.
>> Department of Physics
>> Technical University of Denmark
>> DK-2800 Kongens Lyngby, Denmark
>> http://www.fysik.dtu.dk/~schiotz/
>> 
>> 
>> 
> 
> --
> Jakob Schiøtz, professor, Ph.D.
> Department of Physics
> Technical University of Denmark
> DK-2800 Kongens Lyngby, Denmark
> http://www.fysik.dtu.dk/~schiotz/
> 
> 
> 

--
Jakob Schiøtz, professor, Ph.D.
Department of Physics
Technical University of Denmark
DK-2800 Kongens Lyngby, Denmark
http://www.fysik.dtu.dk/~schiotz/



Reply via email to