Introduce FFTW-API virtual package for Intel-MKL and FFTW Spack packa…#9618
Introduce FFTW-API virtual package for Intel-MKL and FFTW Spack packa…#9618tgamblin merged 4 commits intospack:developfrom
Conversation
tgamblin
left a comment
There was a problem hiding this comment.
does it make sense to use versioned virtuals for this? e.g., for MPI, we version the interface and one MPI implementation can provide, e.g., mpi@1:. Seems like you could make these provide fftw (i.e., all versions) and fftw@3, respectively.
|
I tried to use versioned virtuals, but I ran into a problem. The problem is that a package and the provider cannot share the same name, e.g. the FFTW package cannot contain a statement like providers('fftw'). When you try it, you get a complaint from Spack. So, I think the options were:
In principle, I suppose either would work but change 2. is more complicated IMO. But maybe that is the right thing to do. (FYI, I am not aware of an FFTW@1 interface existing while in my academic lifetime going all the way back into the late 1990's. As a practical matter, only FFTW3 really matters. There are still a few legacy interfaces to FFTW2.) If I understand you correctly, you mean can:
|
|
@naromero77 I think there's also option number 3:
|
|
I like option number 3. If there are no other suggestions, I will go with that route in the next day or two. |
|
Here are the changes:
|
alalazo
left a comment
There was a problem hiding this comment.
The implementation seems legit, and coherent with what we were discussing.
Anyhow, thinking more about this case in particular, I started to have a concern on the various flavors in which fftw comes. Being a C library fftw provides effectively 8 APIs (4 floating point precisions for both the serial and the parallel version). How do packages that depend on it select which one to use?
Looking at what we have in the built-in repository I see that there are not many packages that depend on a specific flavor of fftw, but I wonder if this is because the recipes are loosely written or because any flavor would do in most cases.
In the end, if we want to proceed down this route, I am uncertain if we should:
- Remove all or almost all the precision flavors of
fftwand maintain just 2 APIs (e.g.fftw-apiandfftw-mpi-apior some better naming) - Provide as many virtual packages as there are combinations
Probably the first choice will result in less clutter, though it requires to change packages that depend on fftw. Does this seem a valid concern or am I overthinking the matter? @tgamblin @adamjstewart @ax3l ?
| assert provider in default_providers | ||
| assert provider in default_providers, \ | ||
| "all providers must have a default in %s" \ | ||
| % default_providers_filename |
|
This is a good observation and one that crossed my mind. I don't have a simple answer, but I do have more information. I think there are a number of things that are (unfortunately) entangled:
My guest-estimate is that 85-90% of the use cases of FFTW are this combination:
Again, just guessing, I think the packages that have made it into Spack are probably this category which is the default build option for FFTW. There is some use of single precision and parallel versions in the remaining 10-15% of usage. For the other precisions, long double and quad double -- don't know of any science code that uses it, but the fact that exists indicates that someone has need of it. I think its OK to implement all 8 APIs, but it would result in a lot of clutter as @alalazo indicated. I would propose the following naming scheme: If we implement a subset, I would recommend that we at least do: This would cover 99.9% of the use cases. We could add quad precision and long double (ldp), but then only FFTW would be able to provide it. However, ,y recommendation is that we just two providers: With the exception of Intel, the other vendors, e.g. IBM ESSL, AMD ACML, do not provide the mpi version of the FFTW API but do provide single and double precion. |
|
I looked through the FFTW manual this morning. They are quite a few APIs available, some of them I have never heard of. I am casting my vote that we only need two virtual providers: Aside @alalazo, I have not received many comments on this PR @wscullin @tgamblin @adamjstewart @ax3l |
|
From what I read in this thread it looks to me that as long as we don't properly support variants on virtual dependencies, a highly variadic API like FFTW is hard to abstract as a spack virtual package. On top of this, afaik there is currently no way for a downstream package (not config) to express it prefers a specific provider of a virtual dependency. So what will happen is that people testing and developing (aka preferring) some specific fftw implementation will come here and complain ;-) |
|
@ax3l Has a number of valid points. However, I still believe that this PR is incremental progress towards the GitHub issue that I submitted back in Sept. #9384 We can always go back an improve support of virtual package support for variant + versioned APIs. @tgamblin This is holding up progress of work that is related to our QMCPACK ECP. You are probably busy getting ready for SC18, would you please either approve the PR or let me know what changes are needed. I need to make two additional PR that depend on this one before the end of 2018Q4. |
|
I am not an expert on QMCPACK, but can't you just
|
|
@naromero77: is the |
|
@tgamblin Yes, that is sufficient for QMCPACK, QE, etc. If you would like me to, I can also open up a separate GitHub issue -- call it "Support for Variants in Virtual Packages." (Though I was hesitant to add to the large pile of issues.) |
Need spack#9618 to continue development.
Addresses this GitHub issue, #9384
I will use this later in the quantum espresso and qmcpack packages. Those will be separate PRs.