afarnudi / VirtualCellModel

GNU General Public License v3.0
1 stars 1 forks source link

No platforms found #8

Closed pietro-sillano closed 1 year ago

pietro-sillano commented 1 year ago

Hi @afarnudi

I managed to install OpenMM on the cluster (I made all of the procedures logged to a GPU node), ran the test, benchmark it and everything seems fine:

(openmm8) [psillano@gpu009 examples]$ python
Python 3.11.3 (main, May 15 2023, 15:45:52) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import openmm
>>> openmm.openmm.Platform.getPlatformByName('CUDA')
<openmm.openmm.Platform; proxy of <Swig Object of type 'OpenMM::Platform *' at 0x1555544e8930> >
>>> openmm.openmm.Platform.getPlatformByName('CPU')
<openmm.openmm.Platform; proxy of <Swig Object of type 'OpenMM::Platform *' at 0x1555544e9290

Then I switch to VCM:

  1. I change the OpenMM dir inside the makefile OpenMM_INSTALL_DIR=/home/piano/openmm
  2. build it with make with no errors
  3. export OpenMM's Dynamic Library and checked with ldd ./VCM if every dynamic library is found
  4. test ./VCM -c SimpleMembrane following your videos, that is the output:
(openmm8) [psillano@gpu009 bin]$ ./VCM -c SimpleMembrane  

Initialising the Membrane Class...  
Number of ... :  
Nodes   1002  
Triangles       2000  
Triangle pairs  3000  
Node pairs (Bonds) 3000  

Other properties:  

Radius  1  
Node pair (bond) distances:  
       Max 0.131936    Min 0.0943584   Average 0.120155  
Using the average mesh bond distances (0.120155) as the springs nominal length.  
Using 3.14159 (in radians) as the triangle pair nominal angle.  
Node radii set to half of bond average distances.  

Membrane class initiated.  
*************************  

Beginning the OpenMM section:  
Membrane 0  
Bond potential: Harmonic    
       Coeficient (KJ.Nm^-2.mol^-1 ) = 1  
Dihedral potential: Cosine(dihedral)  
       Coeficient (KJ . mol^-1 ) = 0.2  
Area and volume potentials:  
       Area potential: None  
       Volume potential: None  
Mean curvature potentials: None  

Simulation stats:  
1002 Atoms  
3000 Bonds  
3000 Dihedrals  
0 Angles  

Defining interactions...  
Periodic Boundry Condition Off  

OpenMM available platforms:  
Index Name        Speed (Estimated)  
(0)  Reference    1  
Please choose a pltform (index):    
0  
Segmentation fault (core dumped)
afarnudi commented 1 year ago

@pietro-sillano Everything seems to run pretty smoothly. I think I know what goes wrong with the platform identification (usually you should get at least three available platforms). VCM uses OpeMM's plugin path to identify the platforms OpenMM can use. Since OpenMM was installed in a different path, it can't locate the plugins. I will add an input flag option so that you can specify the location of the plugins during execution. I will let you know when it is fixed.

afarnudi commented 1 year ago

@pietro-sillano It is fixed. You can use the --ommPluginPath to input the path to the OpenMM's plugin path. If you run ./VCM -a You will get only the reference platform (uses only one core of the default CPU) But if you specify the path to openmm's plugin, you will get the full list of available platforms (Should include OpenCL or CUDA if available on the cluster): ./VCM -a --ommPluginPath /path/to/openmm/lib/plugins/

afarnudi commented 1 year ago

@pietro-sillano Just to be clear, in order to see platforms on your machine you have to run: ./VCM -c configuration.file --ommPluginPath path/to/openmm/lib/plugins

pietro-sillano commented 1 year ago

@afarnudi Yeah, it works now! I get also the CPU and CUDA options :)

afarnudi commented 1 year ago

@pietro-sillano This means everything is working correctly on VCM's side. The list of available platforms depends on how you built OpenMM. cmake can usually detect CUDA and OpenCL paths automatically if they are available. So if your machine has OpenCL installed (generally should have it) you need to make sure cmake is configured with the correct paths before installing OpenMM. With OpenCL you can parallalise computations on CPU and GPU (not just Nvidia GPUS). Plus, use platforms with single precision for faster calculations. I do not think you would need double precision for any sort of calculation.

pietro-sillano commented 1 year ago

@afarnudi Okay I understand. I have compiled openMM without OpenCL but for the moment I am satisfied with CUDA working ahah.

If I use OpenCL the parallelization on CPU would be automatic? without invoking mpi or openMP? and would there be a lot of difference with only CUDA?

afarnudi commented 1 year ago

@pietro-sillano So I don't find the native OpenMM CPU parallelasation scheme (appears as the CPU platform) very efficient. I have never benchmarked it against OpenCL, but OpenMM ranks it as slower compared to OpenCL.

Both OpenCL and CUDA will parallalise the calculations and you don't need to worry about invoking MPI or OpenMP (they take care of everything). On NVIDA GPUs I tests (RTX 2000 super, RTX 3090, and RTX 4020), I found no feasable performance difference between OpenCL and CUDA.