[MITgcm-devel] Beaufort experiment on mac os x
Jean-Michel Campin
jmc at ocean.mit.edu
Thu Mar 15 19:14:57 EDT 2012
Hi Martin,
I found a good and recent example (ini_vertical_grid.F, revision 1.21)
which illustrates the opposite of what I was proposing earlier today.
And since we know who did it (and I did not complain at that time),
I am now considering the changes you propose in ini_masks_etc.F
more farorably (regarding update_masks_etc.F, I've never had
any objection).
Does this "fix" changes the results at all ?
This beeing said, I still wonder if we might not get other "k-loop insde"
optimisation issues in other pieces of the code where it will not
create a floating-exception but just wrong results.
This was the motivation for this question:
> Do we have a full "testreport -fast" output with these flags ?
> and if yes, could it be sent to mitgcm.org ("-a jmc at mitgcm.org") ?
> I think this could be useful.
Cheers,
Jean-Michel
On Thu, Mar 15, 2012 at 11:09:01PM +0100, Martin Losch wrote:
> Hi there,
>
> I am not happy with this situation at all. gfortran is the only free compiler that is currently available (g77 is still available not will not be continued any longer). Apparently it's not very straightforward to compile gfortran for MacOS, so that the available binaries are usually not quite up to date. That's not good, but that's the way it is.
>
> I thought that our philosophy is that we try to make the MITgcm work with *all* compilers and operating systems. I wonder if this principle also applies to default compiler flags (I think the default optimization of gfortran is -O = -O1 or even higher). Now, in the case of ini_masks_etc.F (and update_mask_etc.F) we know how to make the code work with strong optimization flags (-O3), at the same time following general coding guidelines. I don't see why we should not do fix the code to work with gfortran -O3 on Mac OS (or at least -O). In the case of gmredi_calc_psi_bvp.F (I haven't had look at the changes yet), I don't know why the compiler problem suddenly appeared, but wouldn't it be better to figure it out rather than use generally zero optimization (-O0)?
>
> I opt for submitting a bug report, putting gmredi_calc_pis_bvp into the NOOPTFILE list, but fix ini_masks_etc.F so that it works also for this compiler. Alternatively, we can submit a bug report for this routine as well, but that will be harder, if not impossible, to debug for the developers of gfortran.
>
> Martin
>
>
>
>
> On Mar 15, 2012, at 8:00 PM, Jean-Michel Campin wrote:
>
> > Hi Dimitris,
> >
> > I will leave this decision to Martin.
> > Do we have a full "testreport -fast" output with these flags ?
> > and if yes, could it be sent to mitgcm.org ("-a jmc at mitgcm.org") ?
> > I think this could be useful.
> >
> > Cheers,
> > Jean-Michel
> >
> > On Thu, Mar 15, 2012 at 11:33:22AM -0700, Menemenlis, Dimitris (3248) wrote:
> >> Torge, thank you for checking.
> >>
> >> Martin and Jean-Michel, will you (or should I?) check in the
> >>
> >> NOOPTFILES='ini_masks_etc.F gmredi_calc_psi_bvp.F'
> >>
> >> fix for darwin_amd64_gfortran and darwin_ia32_gfortran
> >>
> >> Let me know
> >>
> >> Dimitris Menemenlis
> >>
> >> On Mar 15, 2012, at 11:28 AM, Torge Martin wrote:
> >>
> >>> Oh, I changed just the Makefile but did not start my tests with genmake.
> >>>
> >>> Thanks, Dimitris, this works!
> >>>
> >>> changes to darwin_amd64_gfortran:
> >>>
> >>> NOOPTFLAGS='-O0'
> >>> ### NOOPTFILES=''
> >>> NOOPTFILES='ini_masks_etc.F gmredi_calc_psi_bvp.F'
> >>>
> >>> but you have to be careful because these variables are reset later in
> >>> the optfile if option -ieee is not used:
> >>>
> >>> if test "x$IEEE" = x ; then
> >>> FFLAGS="$FFLAGS -Wunused -Wuninitialized"
> >>> FOPTIM='-O3 -ftree-vectorize -funroll-loops'
> >>> NOOPTFLAGS='-O2 -funroll-loops'
> >>> NOOPTFILES='gad_c4_adv_x.F gad_u3_adv_x.F'
> >>> else
> >>> FFLAGS="$FFLAGS -Wunused"
> >>> FOPTIM='-O0'
> >>> fi
> >>>
> >>> this should be changed to:
> >>>
> >>> if test "x$IEEE" = x ; then
> >>> FFLAGS="$FFLAGS -Wunused -Wuninitialized"
> >>> FOPTIM='-O3 -ftree-vectorize -funroll-loops'
> >>> else
> >>> FFLAGS="$FFLAGS -Wunused"
> >>> FOPTIM='-O0'
> >>> fi
> >>>
> >>> Torge
> >>
> >>
> >> _______________________________________________
> >> MITgcm-devel mailing list
> >> MITgcm-devel at mitgcm.org
> >> http://mitgcm.org/mailman/listinfo/mitgcm-devel
> >
> > _______________________________________________
> > MITgcm-devel mailing list
> > MITgcm-devel at mitgcm.org
> > http://mitgcm.org/mailman/listinfo/mitgcm-devel
>
> Martin Losch
> Martin.Losch at awi.de
>
>
>
>
> _______________________________________________
> MITgcm-devel mailing list
> MITgcm-devel at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-devel
More information about the MITgcm-devel
mailing list