Platform="opencl" for BSS.FreeEnergy.Solvation()
I'm trying to run solvation free energy calculations (i.e. without vacuum legs) using BSS.FreeEnergy.Solvation() but for the current setup it's much more straightforward to use opencl instead of cuda. I'm currently on BSS 2020.1.0+3.gcc522eb.
Looking around the docs I found that Process.Somd() has a platform="opencl" parameter, but (afaik) this function doesn't have the same functionality as BSS.FreeEnergy.Solvation() in terms of running only the solvated leg. Would you agree exposing platform=.. in BSS.FreeEnergy.Solvation() would be helpful?
Hi there,
Yes, at the moment there is no way to specify the GPU platform in the FreeEnergy class since it wouldn't be consistent between the MD engines that we support (SOMD, GROMACS). For SOMD the platform is just added as a command-line argument so it's trivial to modify this after setting up the FreeEnergy object with BioSimSpace, for example:
# Set up your FreeEnergy object as normal.
free_nrg = ...
# Get a dictionary containing the command-line arguments for each leg. (Same for each leg.)
args = free_nrg._runner.processes()[0].getArgs()
# Update the platform argument.
args["-p"] = "OpenCL"
# Now update the platform argument for all legs.
free_nrg._update_run_args(args)
I hope that makes sense. I agree that it would be good to come up with a better way of supporting engine specific options in some of the higher-level BioSimSpace classes. I could also update the above approach to make it easier to set/update a single argument.
Thanks Lester, this is definitely helpful for now. I agree that simplifying commandline input would offer a lot of additional flexibility