Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using std::reduce causes intel compiler to not work #297

Closed
amartyads opened this issue Mar 19, 2024 · 6 comments
Closed

Using std::reduce causes intel compiler to not work #297

amartyads opened this issue Mar 19, 2024 · 6 comments

Comments

@amartyads
Copy link
Contributor

The newly added StaticIrregDomainDecomposition.cpp uses std::reduce, something that causes compilation to fail when compiling with icpx on HSUper. The compilation succeeds, however, if user does module load gcc before compilation. This is probably because the LD_LIBRARY_PATH gets populated with libraries from gcc, and then the compiler can find std::reduce.

Changing reduce to accumulate can be an easy fix, and since the operation is performed only once, it shouldn't be too heavy.

@HomesGH and @JakNiem initially found this bug on HSUper.

Bug replicated on HSUper
icpx version: Intel(R) oneAPI DPC++/C++ Compiler 2022.1.0 (2022.1.0.20220316)
default gcc version: g++ (GCC) 8.5.0 20210514 (Red Hat 8.5.0-10)
gcc version after ml gcc: g++ (Spack GCC) 12.1.0

@FG-TUM
Copy link
Member

FG-TUM commented Mar 19, 2024

This is IMHO an issue (aka feature) with the module system. Some compilers like icpx rely on the libraries of the currently loaded gcc.

Possible actions we can take:

  • Ask cluster admins to issue relevant warning messages when loading such modules
  • Mention this edge case somewhere in our documentation.

@cniethammer
Copy link
Contributor

ls1 requires C++17, so users should ensure, that their system and software are set up to support this.
As @FG-TUM mentioned Intel uses an external C++ library so this has to be available on the system in an appropriate version and made visible to the Intel compiler for linking. See the Intel oneAPI documentation for system requirements on this https://www.intel.com/content/www/us/en/developer/articles/system-requirements/intel-oneapi-dpcpp-system-requirements.html#inpage-nav-2-undefined-1

@HomesGH
Copy link
Contributor

HomesGH commented Mar 20, 2024

In addition to your mentioned actions, should we still change reduce to accumulate in this case?

HomesGH added a commit that referenced this issue Mar 21, 2024
@HomesGH
Copy link
Contributor

HomesGH commented Mar 21, 2024

I have added a note to the README file, see PR #295 (see commit).

@amartyads Have you talked to the admins of HSUper regarding this issue?

@amartyads
Copy link
Contributor Author

I have talked to the admins, here's the update:

  1. You can load a newer version of the intel compilers with ml USER-SPACK/0.21.1 intel-oneapi-compilers
  2. std::reduce doesn't work with the new compiler either
  3. The admins are okay with adding a message saying "All c++17 features may not be supported while using the intel oneapi compiler" when ml compiler is done by user
  4. If you write a simple test program with just a single std::reduce like so:
#include <numeric>
#include <vector>
#include <iostream>
int main()
{
        const std::vector<int> v(10,100);
        const int total = std::reduce(v.begin(), v.end(), 0);
        std::cout << total << std::endl;
        const int total2 = std::accumulate(v.begin(), v.end(), 0);
        std::cout << total2 << std::endl;
        return 0;
}

This does not compile with icpx even with ml gcc, however ls1 still compiles. So the workaround isn't universal and something else is going on.

@cniethammer
Copy link
Contributor

Issues were related to the software stack on the system and could be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants