[gmx-developers] c++ in master
David van der Spoel
spoel at xray.bmc.uu.se
Tue Jan 22 15:08:45 CET 2013
On 2013-01-22 14:26, Berk Hess wrote:
> We should (re)start the discussion on 5.0, and especially C++, soon.
> It is currently not clear if we would want everything to be C++, or have
> some core functionality in C only.
> But what it clear is that we want to get rid of these massive collective
> data structures that get passed around
> everywhere and forcerec is a good example of that.
> The nbnxn "module", for example. uses it's own data structure, which at
> the moment hangs in forcerec,
> but should probably be moved out.
But that would give an extra argument to pass around. Encapsulating
these modules in a C++ class is more neat, but boils down to the same
Should we organize a physical meeting in Stockholm some time soon?
> On 01/22/2013 02:19 PM, David van der Spoel wrote:
>> we've developed some code for refinement based the master branch. This
>> is being written in C++, following the GMX coding requirements as good
>> as we comprehend them:
>> What we would like to do is add our new class to the forcerec
>> structure, such that it gets initiated and passed along with
>> everything else. However having a class definition in forcerec.h
>> necessitates that all files including forcerec.h are compiled by the
>> C++ compiler (which is hard to do with cmake).
>> Rather than renaming *.c to *.cpp I built a C-wrapper around the C++
>> object, which defeats the purpose of C++ programming in a sense, but
>> allows including the features we want with least disturbance.
>> So the question we need to start thinking about is:
>> When are we going to move .c to .cpp files?
>> Maybe this is not needed for functions that do not call any other
>> gromacs functions (e.g. the kernels) but I guess it will be for
>> virtually everything else.
David van der Spoel, Ph.D., Professor of Biology
Dept. of Cell & Molec. Biol., Uppsala University.
Box 596, 75124 Uppsala, Sweden. Phone: +46184714205.
spoel at xray.bmc.uu.se http://folding.bmc.uu.se
More information about the gromacs.org_gmx-developers