Re: [AMBER] [PATCH 4/8] sqm: Fix OpenMP build

From: Gustavo Seabra <gustavo.seabra.gmail.com>
Date: Tue, 23 Oct 2012 16:51:43 -0300

>>>> The OpenMP support in sqm was not thoroughly tested and, as
>>>> far as I understand, its development has been "dormant" for a
>>>> while. Thus, it was disabled in the config, to avoid
>>>> confusion.
>>>>
>>>> I suppose the addition of the $omp_flag made the compiler try
>>>> to use some OpenMP commands available there, but probably not
>>>> all the OpenMP code was compiled, since it is isolated by
>>>> IFDEFs on the code. Have you used -DOPENMP in the
>>>> pre-processing step? That would cause the compilation of the
>>>> whole OpenMP part. (I haven't had any problem with it.)
>>>
>>> $omp_flag expands to -fopenmp -DOPENMP and I tried to add it
>>> also to FPPFLAGS and there was no difference, still fails. I'm
>>> also using ifdefs in my patch to isolate OPENMP parts, so it
>>> does receive that directive.
>>
>> Where did you add this? If you add it to the Amber/AmberTools
>> configure, it is not passed down to the sqm compilation. The
>> only way to compile sqm with OpenMP support is looking for the
>> specific calls in the Makefile in the sqm directory, and
>> altering it there.
>
> I added this in AmberTools/src/configure2, that is the only
> place where it makes sense to modify general flags such as
> FFLAGS, CFLAGS and CXXFLAGS which influence all of the
> applications built. In fact configure files are the only ones
> which should require modifications (if at all) by users (given
> proper build system).
>
> These variables are set by configure and referenced by
> Makefiles, so every change is propagated to them. And they are
> propagated since I can make sqm to use any number of threads I
> want by using omp_get_max_threads().
>
> Obviously, your way is not the only way. I think we already
> established that from the time Ross Walker worked with it the
> code was changed in a way that it breaks OpenMP build.


That's precisely my point. I was trying to understand why it didn't work for you, and that's the reason. As Ross explained, the configure will not pass the directives to the compilation of the OpenMP part of SQM, and that was done on purpose so that it can only be compiled by them, while in the development process. I suppose the idea is, once they finish and know it is working, they would put the right commands in the configure script.

If you really want to give it a try, then you have to modify the config.h files by hand, but at your own risk.

I hope it works,
Gustavo Seabra
Professor Adjunto
Departamento de Química Fundamental
Universidade Federal de Pernambuco
Recife - PE - Brasil
+55-81-2126-7450 x5023




_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Tue Oct 23 2012 - 13:00:05 PDT
Custom Search