Modify

Opened 6 years ago

Last modified 6 years ago

#1382 reopened defect

Cactus should disable collapse sections automatically for C _and_ Fortran

Reported by: Frank Löffler Owned by:
Priority: minor Milestone:
Component: Cactus Version: ET_2013_05
Keywords: openmp flesh ET_2013_05 Cc:

Description

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.

Attachments (1)

Cactus_collapse_detection (1.1 KB) - added by Frank Löffler 6 years ago.

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by Frank Löffler

Attachment: Cactus_collapse_detection added

comment:1 Changed 6 years ago by Frank Löffler

Keywords: ET_2013_05 added
Status: newreview

comment:2 Changed 6 years ago by Roland Haas

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.

comment:3 Changed 6 years ago by Erik Schnetter

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

comment:4 Changed 6 years ago by Frank Löffler

Status: reviewreopened

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as reopened The ticket will remain with no owner.
Next status will be 'review'.
as The resolution will be set.
to The owner will be changed from (none) to the specified user.
The owner will be changed from (none) to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.