[MITgcm-devel] genmake2 and fflags

Martin Losch Martin.Losch at awi.de
Mon Oct 1 09:58:39 EDT 2007


Hi Jean-Michel,
I like your "2 little thing", which turn out to be 4 things (o:,
Here my comments
On 1 Oct 2007, at 15:00, Jean-Michel Campin wrote:

> Hi Martin,
>
> 2 little thing:
> 1) if one S/R from a package needs to be inlined, this solution
> would not work, right ? So, apart from my coupler building,
> there is a need to do something more flexible.
You are right. You'd have to include extra routines into your local  
copy of MITgcm for specific configurations, depending on the pkg  
you'd like to include. It's not very flexible, I agree.
> 2) those FEXTRAFLAGS are only used to link, right ?
> If this is the case, I would prefer a different name
> (that reflect the LINK stage).
No, the flags are required at compile time. At the compilation time  
the compiler looks for the specified routines in the specified files.  
Instead of specifying individual files, you can set somethings like  
"expin=./" to make to compiler look in all files in the local  
directory, but that is VERY slow given the enormous number of files  
we have in the build directory.
> 3) what happen if you add in this "exp" list an object file
> (e.g., foo.o) that don't appear in the "expin" .F files ?
don't know, exp contains the names of the functions and subroutines,  
an object files should not work. If you specify a subroutine that's  
not in the "expin=*.F" files the compiler stops with an error.
> 4) From constantinos: Is there a way (compiler option) to
> do those inlining automaticly ? We know some compiler that
> can do that, so but no idea about this one.
you can turn on automatic inlining in sxf90 by -pi, but then only  
routines are inlined that are found in the local file and a shorter  
than 50 lines (that's a default that can be changed). This works for  
lagran in exf_interp.F, because function lagran is also in  
exf_interp.F, but would not work with, say, different_multiple,  
because that code is in a separate file.
>
> I the mean time, I suggest that you check-in the modified optfile
> and the changes in genmake2 (commented out ?), so that we
> can see exactly what is needed. It does nt look very
> easy to make it works in general, because the syntax of
> those inlining instructions are compiler specific, but we
> could try something.
If you prefer, I can check in the changes to genmake2, although I had  
attached the file in my previous email. The changes should not affect  
any experiment, as along as this FEXTRAFLAGS is not set in the build  
options file.
Let me know if you really want this checked in.

Martin

>
> Cheers,
> Jean-Michel
>
> On Wed, Sep 26, 2007 at 11:03:26AM +0200, Martin Losch wrote:
>> Hi Jean Michel,
>>
>> currently I want to use something like this:
>>
>> FEXTRAFLAGS='-pi fullmsg
>> exp=timestep_tracer,ilnblnk,ifnblnk,cycle_tracer,pressure_for_eos
>> rexp=bar2,fool_the_compiler
>> expin=timestep_tracer.F,fool_the_compiler.F,bar2.F,utils.F,cycle_trac 
>> er.
>> F,pressure_for_eos.F'
>>
>> for the sxf90 compiler for our SX8. These are all files that are
>> always used (as far as I can see, either in model/src or eesupp/src).
>> When I add this to FFLAGS in the opt file, all genmake2 fortran-tests
>> fail (no netcdf, etc) because the compiler looks for the the files
>> specified in expin=*.F before they are linked to the directory.
>> The FEXTRAFLAGS (or whatever name you prefer) will not be used
>> anywhere and is empty by default, so it should not affect any other
>> experiment (although I did not try). Maybe you want to test this on
>> some of your experiments which you find critical? I am attaching my
>> "new" genmake2 and the corresponding build options file to show an
>> example usage. Tell me what you think.
>>
>> Martin
>>
>
>
>
>>
>> On 26 Sep 2007, at 04:32, Jean-Michel Campin wrote:
>>
>>> Hi Martin,
>>>
>>> What kind of FFLAGS do you have to specify for this inlining ?
>>>
>>> I am little bit concern that this will break some building
>>> where those S/R are not compiled (pkg not compiled,
>>> or our coupler in verification/cpl_aim+ocn/build_cpl
>>> with empty STANDARDDIRS, i.e., without model/src nor eesup/src)
>>>
>>> Jean-Michel
>>>
>>> On Tue, Sep 25, 2007 at 09:49:03PM +0200, Martin Losch wrote:
>>>> Hi there,
>>>>
>>>> for our SX8 I would like to include a list of routines to  
>>>> inlined in
>>>> the build_options file. Unfortunately that does not work with  
>>>> FFLAGS,
>>>> because then all the little tests in genmake2 look for the  
>>>> routines/
>>>> files to inlined and fail. I have included an extra variable
>>>> FEXTRAFLAGS into genmake2 that can contain such compiler options  
>>>> that
>>>> should not be used in the genmake2-tests. It is only used to  
>>>> actually
>>>> write the makefile: FFLAGS=${FFLAGS} ${FEXTRAFLAGS}. Is this OK to
>>>> check in? Or do we already have something like that and I just  
>>>> didn't
>>>> find it?
>>>>
>>>> Martin
>>>> _______________________________________________
>>>> 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
>>
>
>> _______________________________________________
>> 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




More information about the MITgcm-devel mailing list