Cactus should disable collapse sections automatically for C _and_ Fortran

Issue #1382 resolved
Frank Löffler created an issue

Currently, Cactus disables OpenMP collapse due to compiler problems either when specified explicitly in the option list, or when finding certain compilers that are known to have this kind of problem. However, the latter is only done for C and C++, but not Fortran. In addition, Cactus aborts compilation if collapse is not explicitly disabled, but affected compilers are found, with a message that collapse is disabled for C, but not for Fortran, indicating an error in the option list. While the first is true since Cactus actually disabled the collapse sections because it found a faulty compiler, the latter is not, since the option list doesn't mention collapse sections at all and isn't inconsistent.

This means in the end that the auto-detections isn't really working in the way that is was intended: that Cactus does things automatically if faulty compilers are found. Instead, Cactus currently aborts, with a message that isn't leading users in the right direction. A workaround right now is to define CCTK_DISABLE_OMP_COLLAPSE for both C and Fortran in the option list.

The proposed patch removes this error message, and instead adds the same compiler-detection for Fortran, that is already present for C and C++. The advantage would be that option lists wouldn't need to define anything. Cactus would either disable the collapse sections for all languages, or for none.

If accepted, I propose to backport this change, in addition to applying it to the development version. The patch was created using ET_2013_05.

Keyword: openmp
Keyword: flesh
Keyword: ET_2013_05

Comments (8)

  1. Roland Haas
    • removed comment

    I'd love to see this particular compile time error go away since it is rather unintuitive how to fix it.

    My recollection of why it is detected so late was that there is not way to detect the Fortran compiler version. We cannot even assume that Fortran files run through the "real" C preprocessor since Cactus supplies a mini-preprocessor in cpp.pl of its own. So I think the test right now works such that in a C source file we detect whether a faulty C compiler is found and if so, check that option that will cause them to be disabled in the fortran compiler are found. Writing this down, it should be possible to do this test in autoconf, should it? Of course we would still assume that a user uses "matching" C and Fortran compilers and not eg icc paired with gfortran.

    I believe that the patch as proposed would not be safe to apply, however that it could be turned into a autoconf test for the buggy compiler versions where we could indeed just look at the output of $F90 -V and base our decision on this.

  2. Erik Schnetter
    • removed comment

    Yes, this detection should be turned into an autoconf-test, and then applied automatically.

  3. Frank Löffler reporter
    • changed status to open
    • removed comment

    re-opening, as we need another than the currently proposed solution.

  4. Log in to comment