including third party GPU library in OpenFOAM
this is a slightly convoluted question, but please bear with me.
We have incorporated the OpenMM GPU library (https://simtk.org/home/openmm) inside OpenFOAM and are using it to perform Molecular Dynamics force calculations on the GPU. The OpenMM is compiled as a shared library and included in the OpenFOAM MD solver.
OpenMM supports two GPU platforms: CUDA and OpenCL. CUDA is precompiled with a make compiler but OpenCL code gets compiled at runtime. As a consequence, CUDA code runs fine within OpenFOAM, but the OpenCL code crashes.
Unfortunately, we need the OpenCL and we suspect that the problem is due to the difference in compilers. The OpenMM example simulation code uses make and the OpenCL compiled this way works fine. However, when integrated in OpenFOAM, the solver is compiled with wmake and this seems to disagree with the OpenCL code. We have checked all the compiler options but to no avail.
Does anyone have a similar experience with integrating third-party libraries inside OpenFOAM? Would you be able to offer any insight?
the compile script you are interested is in
and the example of the extern function in OF is
extern "C" void CFL_AinvPBiCGStab(cusp_equation_system *CES, OFSolverPerformance *OFSP);//extern function in CUDA that solves the equation system
in the file (http://code.google.com/p/cufflink-li...invPBiCGStab.C)
lastly, the definition of the extern function in CUDA is in
Hope that helps.
thank you for your reply. I have found the same thing with CUDA - because it can be fully compiled externally, there seems to be no problem with including it in OF - the OF compiler does not need to recompile it while compiling the solver.
With the OpenCL, things seem to be different as you do not compile it externally, it gets compiled at runtime and it is here that I run into problems.
I'll have a look at your CUDA solution and see if I can get any ideas for how to tackle this.
Have a look at clFoam
there has been an OpenCl plugin for OpenFOAM - maybe that helps:
The OpenCL solver plugin : clFoam v0.1 come out for test.
Until now, clFoam single precision has been tested on ATI 5650M GPU and NVidia Tesla C2050. The speed is slightly slower than CPU on Tesla C2050 for 160000 cells of case: cavity 4 times steps (clPCG). (see profilingDatasheet.xls in profiling data/ for details)
The openCL solver is still promising, as it is a new tech and has great space to improve.
Quite a lot of work to do, any advice on improving the efficiency is appreciated. further, there must be some errors in the manual, DO leave me a email to correct them.
Thanks very much
Let me know how it works - I'm planning something similar.
|All times are GMT -4. The time now is 02:13.|