Migrating to the latest version#
Migrating to HOOMD v4#
Breaking changes to existing functionalities#
For some functionalities, you will need to update your scripts to use a new API:
hoomd.md.dihedral.Harmonicchargeskey inRigid.body.Pass charges to
Rigid.create_bodiesor set in the system state.
diameterskey inRigid.body.Set diameters in system state.
hoomd.md.methods.NVE.Use
hoomd.md.methods.ConstantVolumewiththermostat=None.
hoomd.md.methods.NVT.Use
hoomd.md.methods.ConstantVolumewith ahoomd.md.methods.thermostats.MTTKthermostat.
hoomd.md.methods.Berendsen.Use
hoomd.md.methods.ConstantVolumewith ahoomd.md.methods.thermostats.Berendsenthermostat.
hoomd.md.methods.NPH.Use
hoomd.md.methods.ConstantPressurewiththermostat=None.
hoomd.md.methods.NPT.Use
hoomd.md.methods.ConstantPressurewith ahoomd.md.methods.thermostats.MTTKthermostat.
hoomd.write.GSD.log.hoomd.mesh.Mesh().triangles.Use
hoomd.mesh.Mesh().triangulationinhoomd.mesh.Meshto define the mesh triangulation.
hoomd.md.pair.Gauss.hoomd.md.external.wall.Gauss.msg_fileproperty and argument inhoomd.device.Device.Use
message_filename.
sdfproperty ofhoomd.hpmc.compute.SDF.Use
sdf_compression.
hoomd.write.GSDno longer writesparticles/diameterby default.Set
write_diameteras needed.
alphaproperty ofhoomd.md.methods.Langevin,hoomd.md.methods.Brownian,hoomd.md.methods.OverdampedViscous,hoomd.md.methods.rattle.Langevin,hoomd.md.methods.rattle.Brownian, andhoomd.md.methods.rattle.OverdampedViscous.Use the
gammaproperty.
The
dynamicproperty and argument ofhoomd.write.GSDno longer enforces'property'as an always dynamic quantity. Users must include'property','particles/position'and/or'particles/orientation'as needed indynamiclists that contain other fields.hoomd.write.GSDaggressively buffers output. Callhoomd.write.GSD.flushto write the buffer to disk when opening a file for reading that is still open for writing. There is no need to callflushin normal workflows when files are closed and then opened later for reading.
Removed functionalities#
HOOMD-blue v4 removes functionalities deprecated in v3.x releases:
hoomd.md.pair.aniso.ALJ.modeparameterhoomd.md.pair.aniso.Dipole.modeparameterhoomd.device.GPU.memory_tracebackparameter
Compiling#
HOOMD-blue v4 no longer builds on macOS with
ENABLE_GPU=on.Use the CMake options
HOOMD_LONGREAL_SIZEandHOOMD_SHORTREAL_SIZEto control the floating point precision of the calculations. These replace theSINGLE_PRECISIONandHPMC_MIXED_PRECISIONoptions from v3.
Components#
Remove
fix_cudart_rpath(_${COMPONENT_NAME})from your componentsCMakeLists.txtUse
LongRealandShortRealtypes in new code.Scalarwill be removed in a future release (v5 or later).Replace any use of
hpmc::OverlapRealwithShortReal.Remove
needsDiameterandsetDiametermethods in potential evaluator classes.
Migrating to HOOMD v3#
HOOMD v3 introduces many breaking changes for both users and developers in order to provide a cleaner Python interface, enable new functionalities, and move away from unsupported tools. This guide highlights those changes.
Overview of API changes#
HOOMD v3 introduces a completely new API. All classes have been renamed to match PEP8 naming guidelines and have new or renamed parameters, methods, and properties. See the tutorials and the Python module documentation for full class-level details.
Here is a module level overview of features that have been moved or removed:
v2 module, class, or method |
Replaced with |
|---|---|
|
|
|
Removed. Use Python standard libraries for timing. |
|
Removed. See Citing HOOMD-blue. |
|
|
|
|
|
|
|
|
|
|
|
|
|
Removed. Use an external tool. |
|
|
|
Removed. Use Python standard libraries for option parsing. |
|
Some classes have been moved to |
|
Enable GPU profiling with |
|
|
|
|
|
|
|
|
|
|
|
Removed. This is not needed. |
|
|
|
Removed. |
|
|
|
|
|
Removed functionality#
HOOMD v3 removes old APIs, unused functionality, and features better served by other codes:
Feature |
Replace with |
|---|---|
Python 2.7 |
Python >= 3.6 |
Compute < 6.0 GPUs |
Compute >= 6.0 GPUs |
|
|
|
Parameters and type parameters accessed by properties. |
|
|
|
No longer needed. |
hoomd.deprecated:
Feature |
Replace with |
|---|---|
|
Offline analysis: e.g. Freud’s msd module. |
|
|
|
|
|
|
|
|
|
Feature |
Replace with |
|---|---|
|
no longer needed |
|
|
|
n/a |
|
no longer needed |
|
no longer needed |
|
no longer needed |
|
no longer needed |
|
set |
Feature |
Replace with |
|---|---|
|
Pass group to integration method. |
|
n/a |
|
Per-type |
|
|
hoomd.cgcmm:
Feature |
Replace with |
|---|---|
|
no longer needed |
|
no longer needed |
hoomd.dem:
Feature |
Replace with |
|---|---|
DEM pair potentials |
ALJ pair potential in |
Not yet ported#
The following v2 functionalities have not yet been ported to the v3 API. They may be added in a future 3.x release:
HPMC box volume move size tuner.
These contributed functionalities rely on the community for support. Please contact the developers if you have an interest in porting these in a future release:
hoomd.hdf5hoomd.metalhoomd.mpcd
Compiling#
CMake 3.8 or newer is required to build HOOMD v3.0.
To compile with GPU support, use the option
ENABLE_GPU=ON.UPDATE_SUBMODULESno longer exists. Users and developers should usegit clone --recursive,git submodule updateandgit submodule syncas appropriate.COPY_HEADERSno longer exists. HOOMD will pull headers from the source directory when needed.CMAKE_INSTALL_PREFIXis set to the Pythonsite-packagesdirectory (if not explicitly set by the user).cereal, eigen, and pybind11 headers must be provided to build HOOMD. See Installing binaries for details.
BUILD_JITis replaced withENABLE_LLVM.
Components#
HOOMD now uses native CUDA support in CMake. Use
CMAKE_CUDA_COMPILERto specify a specificnvccorhipcc. Plugins will require updates toCMakeLists.txtto compile.cufiles.Remove
CUDA_COMPILE.Pass
.cusources directly topybind11_add_module.Add
NVCCas a compile definition to.cusources.
External components require additional updates to work with v3. See
example_pluginfor details:Remove
FindHOOMD.cmake.Replace
include(FindHOOMD.cmake)withfind_package(HOOMD 3.Y REQUIRED)(where 3.Y is the minor version this plugin is compatible with).Always force set
CMAKE_INSTALL_PREFIXto${HOOMD_INSTALL_PREFIX}.Replace
PYTHON_MODULE_BASE_DIRwithPYTHON_SITE_INSTALL_DIR.Replace all
target_link_librariesandset_target_propertieswithtarget_link_libraries(_${COMPONENT_NAME} PUBLIC HOOMD::_hoomd)(can linkHOOMD::_md,HOOMD::_hpmc, etc. if necessary).
Numerous C++ class APIs have changed, been removed, or renamed. Review the header files to see new class signatures. These changes may require you to update your component accordingly. Some of the more notable changes include:
Varianthas been completely rewritten.Triggerreplaces periodic and variable period scheduling.NeighborListhas aaddRCutMatrixmethod clients must use to specify the maximum cutoff radii per type pair.timestepis now of typeuint64_t.Saruhas been removed. UseRandomGenerator.RandomGeneratoris now constructed with aSeedandCounterobject that support 64-bit timesteps.m_seedis no longer present in individual operation objects. Use the global seed provided bySystemDefinition.The HPMC integrators have been heavily refactored.
HPMC GPU kernels are now instantiated by template .cu files that are generated by CMake at configure time.
ParticleGroupinstances are now constructed from immutable, reusable, and user-customizableParticleFilterinstances.All GPU code is now written with HIP to support NVIDIA and AMD GPUs.
ActiveForceComputealways uses particle orientation in combination with per-type active forces and torques.getProvidedLogQuantitiesandgetLogQuantitieshave been removed. Provide loggable properties instead.Removed the Sphere, Ellipsoid, and oneD constraints. Replaced with the more general RATTLE integration methods and Manifold classes.
Removed the Enforce2D and TempRescale Updaters. Enforce2D is not needed for 2D simulations, and TempRescale has been replaced by
thermalize_methods.Removed Doxygen configuration scripts. View the document for classes in the source files.
Particle types may no longer be added after a Simulation is initialized. Classes no longer need to subscribe to the types added signal and reallocate data structures when the number of types changes.