Skip to content

Commit

Permalink
Merge branch 'trunk-minor' into trunk-major
Browse files Browse the repository at this point in the history
  • Loading branch information
joaander committed Jul 18, 2024
2 parents 8a8fea9 + bf35be6 commit cf89de0
Show file tree
Hide file tree
Showing 23 changed files with 206 additions and 94 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 4.8.0
current_version = 4.8.1
commit = False
tag = False
parse = ^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))(?:\.(?P<number>0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)))?$
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ body:
attributes:
label: HOOMD-blue version
description: What version of HOOMD-blue are you using?
placeholder: 4.8.0
placeholder: 4.8.1
validations:
required: true
- type: markdown
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/release.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Release checklist
about: '[for maintainer use]'
title: 'Release 4.8.0'
title: 'Release 4.8.1'
labels: ''
assignees: 'joaander'

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
apt-get update
apt-get install git --yes
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
path: code
submodules: true
Expand Down Expand Up @@ -203,13 +203,13 @@ jobs:
run: tar --use-compress-program='zstd -10 -T0' -cvf install.tar install

- name: 'Upload build'
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: build-${{ inputs.config }}-${{ github.sha }}
path: build.tar
retention-days: 7
- name: 'Upload install'
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: install-${{ inputs.config }}-${{ github.sha }}
path: install.tar
Expand All @@ -233,7 +233,7 @@ jobs:
apt-get update
apt-get install git --yes
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
path: code

Expand All @@ -254,7 +254,7 @@ jobs:
echo "$MAMBA_ROOT_PREFIX/envs/test/bin" >> $GITHUB_PATH
- name: Download install
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: install-${{ inputs.config }}-${{ github.sha }}
- name: Untar install
Expand Down Expand Up @@ -312,7 +312,7 @@ jobs:
echo "LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu" >> $GITHUB_ENV
- name: Download build
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: build-${{ inputs.config }}-${{ github.sha }}
- name: Untar build
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
submodules: true
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
run: tar -cvJf ${name}-${tag:1}.tar.xz ${name}-${tag:1}

- name: Upload release files
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: release
path: |
Expand All @@ -81,12 +81,12 @@ jobs:

steps:
- name: Download artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: release

- name: Create release
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 # v2.0.5
uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0 # v2.0.6
if: startsWith(github.ref, 'refs/tags/v')
with:
files: "*.tar.*"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ on:

jobs:
stale:
uses: glotzerlab/workflows/.github/workflows/stale.yaml@5cfac9da9cb78e16ae97a9119b6fd13c1c2d6f5e # 0.1.0
uses: glotzerlab/workflows/.github/workflows/stale.yaml@ea2e25d07af862a1c696a932c2bd6b242d142049 # 0.2.0
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
jobs:
start_action_runners:
name: Start
uses: glotzerlab/jetstream2-admin/.github/workflows/start.yaml@c89b62aa89f7886318edb166bc0500cfc658f24f # v1.3.0
uses: glotzerlab/jetstream2-admin/.github/workflows/start.yaml@98f840ba341f72bf412100f2180d38c06e792b84 # v1.3.1
secrets: inherit

typical:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/update-conda-lockfiles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Update conda lockfiles

on:
schedule:
- cron: '0 12 1 * *'

workflow_dispatch:

jobs:
update:
uses: glotzerlab/workflows/.github/workflows/update-conda-lockfiles.yaml@ea2e25d07af862a1c696a932c2bd6b242d142049 # 0.2.0
secrets: inherit
with:
branch: trunk-patch
4 changes: 2 additions & 2 deletions BUILDING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Clone using Git_::

$ git clone --recursive https://github.com/glotzerlab/hoomd-blue

Release tarballs are also available as `GitHub release`_ assets: `Download hoomd-4.8.0.tar.gz`_.
Release tarballs are also available as `GitHub release`_ assets: `Download hoomd-4.8.1.tar.gz`_.

.. seealso::

Expand All @@ -158,7 +158,7 @@ Release tarballs are also available as `GitHub release`_ assets: `Download hoomd
Execute ``git submodule update --init`` to fetch the submodules each time you switch branches
and the submodules show as modified.

.. _Download hoomd-4.8.0.tar.gz: https://github.com/glotzerlab/hoomd-blue/releases/download/v4.8.0/hoomd-4.8.0.tar.gz
.. _Download hoomd-4.8.1.tar.gz: https://github.com/glotzerlab/hoomd-blue/releases/download/v4.8.1/hoomd-4.8.1.tar.gz
.. _GitHub release: https://github.com/glotzerlab/hoomd-blue/releases
.. _git book: https://git-scm.com/book
.. _Git: https://git-scm.com/
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ Removed:
4.x
---

4.8.1 (2024-07-18)
^^^^^^^^^^^^^^^^^^

Fixed:

* Prevent illegal instruction when accessing 0 length snapshot arrays
(`#1846 <https://github.com/glotzerlab/hoomd-blue/pull/1846>`__)
* Fix MPCD compiler warning.
(`#1845 <https://github.com/glotzerlab/hoomd-blue/pull/1845>`__)

4.8.0 (2024-07-11)
^^^^^^^^^^^^^^^^^^

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ add_subdirectory (CMake)

################################
## Version information
set(HOOMD_VERSION_RAW "4.8.0")
set(HOOMD_VERSION_RAW "4.8.1")
string(REGEX MATCH "(.*)\\.(.*)\\.(.*)$" _hoomd_version_match ${HOOMD_VERSION_RAW})
set(HOOMD_VERSION_MAJOR ${CMAKE_MATCH_1})
set(HOOMD_VERSION_MINOR ${CMAKE_MATCH_2})
Expand Down
8 changes: 4 additions & 4 deletions INSTALLING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ Serial CPU and single GPU builds
*linux-64*, *osx-64*, and *osx-arm64* platforms. Install the ``hoomd`` package from the conda-forge_
channel into a conda environment::

$ mamba install hoomd=4.8.0
$ mamba install hoomd=4.8.1

.. _conda-forge: https://conda-forge.org/docs/user/introduction.html

``conda`` auto-detects whether your system has a GPU and attempts to install the appropriate
package. Override this and force the GPU enabled package installation with::

$ export CONDA_OVERRIDE_CUDA="12.0"
$ mamba install "hoomd=4.8.0=*gpu*" "cuda-version=12.0"
$ mamba install "hoomd=4.8.1=*gpu*" "cuda-version=12.0"

Similarly, you can force CPU only package installation with::

$ mamba install "hoomd=4.8.0=*cpu*"
$ mamba install "hoomd=4.8.1=*cpu*"

.. note::

Expand All @@ -42,7 +42,7 @@ Similarly, you can force CPU only package installation with::
.. note::

Run time compilation is no longer available on conda-forge builds starting with HOOMD-blue
4.8.0.
4.8.1.

.. tip::

Expand Down
21 changes: 18 additions & 3 deletions hoomd/BondedGroupData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1418,7 +1418,12 @@ pybind11::object BondedGroupData<group_size, Group, name, has_type_mapping>::Sna
assert(has_type_mapping);
auto self_cpp
= self.cast<BondedGroupData<group_size, Group, name, has_type_mapping>::Snapshot*>();
return pybind11::array(self_cpp->type_id.size(), &self_cpp->type_id[0], self);

if (self_cpp->type_id.size() == 0)
{
return pybind11::array(pybind11::dtype::of<unsigned int>(), 0, nullptr);
}
return pybind11::array(self_cpp->type_id.size(), self_cpp->type_id.data(), self);
}

/*! \returns a numpy array that wraps the value data element.
Expand All @@ -1432,7 +1437,12 @@ pybind11::object BondedGroupData<group_size, Group, name, has_type_mapping>::Sna
assert(!has_type_mapping);
auto self_cpp
= self.cast<BondedGroupData<group_size, Group, name, has_type_mapping>::Snapshot*>();
return pybind11::array(self_cpp->val.size(), &self_cpp->val[0], self);

if (self_cpp->val.size() == 0)
{
return pybind11::array(pybind11::dtype::of<Scalar>(), 0, nullptr);
}
return pybind11::array(self_cpp->val.size(), self_cpp->val.data(), self);
}

/*! \returns a numpy array that wraps the groups data element.
Expand All @@ -1449,7 +1459,12 @@ BondedGroupData<group_size, Group, name, has_type_mapping>::Snapshot::getBondedT
std::vector<size_t> dims(2);
dims[0] = self_cpp->groups.size();
dims[1] = group_size;
return pybind11::array(dims, (unsigned int*)&self_cpp->groups[0], self);

if (dims[0] == 0)
{
return pybind11::array(pybind11::dtype::of<unsigned int>(), dims, nullptr);
}
return pybind11::array(dims, (unsigned int*)self_cpp->groups.data(), self);
}

/*! \returns A python list of type names
Expand Down
48 changes: 26 additions & 22 deletions hoomd/GSDReader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,25 +222,25 @@ void GSDReader::readParticles()

// the snapshot already has default values, if a chunk is not found, the value
// is already at the default, and the failed read is not a problem
readChunk(&m_snapshot->particle_data.type[0], m_frame, "particles/typeid", N * 4, N);
readChunk(&m_snapshot->particle_data.mass[0], m_frame, "particles/mass", N * 4, N);
readChunk(&m_snapshot->particle_data.charge[0], m_frame, "particles/charge", N * 4, N);
readChunk(&m_snapshot->particle_data.diameter[0], m_frame, "particles/diameter", N * 4, N);
readChunk(&m_snapshot->particle_data.body[0], m_frame, "particles/body", N * 4, N);
readChunk(&m_snapshot->particle_data.inertia[0],
readChunk(m_snapshot->particle_data.type.data(), m_frame, "particles/typeid", N * 4, N);
readChunk(m_snapshot->particle_data.mass.data(), m_frame, "particles/mass", N * 4, N);
readChunk(m_snapshot->particle_data.charge.data(), m_frame, "particles/charge", N * 4, N);
readChunk(m_snapshot->particle_data.diameter.data(), m_frame, "particles/diameter", N * 4, N);
readChunk(m_snapshot->particle_data.body.data(), m_frame, "particles/body", N * 4, N);
readChunk(m_snapshot->particle_data.inertia.data(),
m_frame,
"particles/moment_inertia",
N * 12,
N);
readChunk(&m_snapshot->particle_data.pos[0], m_frame, "particles/position", N * 12, N);
readChunk(&m_snapshot->particle_data.orientation[0],
readChunk(m_snapshot->particle_data.pos.data(), m_frame, "particles/position", N * 12, N);
readChunk(m_snapshot->particle_data.orientation.data(),
m_frame,
"particles/orientation",
N * 16,
N);
readChunk(&m_snapshot->particle_data.vel[0], m_frame, "particles/velocity", N * 12, N);
readChunk(&m_snapshot->particle_data.angmom[0], m_frame, "particles/angmom", N * 16, N);
readChunk(&m_snapshot->particle_data.image[0], m_frame, "particles/image", N * 12, N);
readChunk(m_snapshot->particle_data.vel.data(), m_frame, "particles/velocity", N * 12, N);
readChunk(m_snapshot->particle_data.angmom.data(), m_frame, "particles/angmom", N * 16, N);
readChunk(m_snapshot->particle_data.image.data(), m_frame, "particles/image", N * 12, N);
}

/*! Read the same data chunks for topology
Expand All @@ -253,8 +253,8 @@ void GSDReader::readTopology()
if (N > 0)
{
m_snapshot->bond_data.resize(N);
readChunk(&m_snapshot->bond_data.type_id[0], m_frame, "bonds/typeid", N * 4, N);
readChunk(&m_snapshot->bond_data.groups[0], m_frame, "bonds/group", N * 8, N);
readChunk(m_snapshot->bond_data.type_id.data(), m_frame, "bonds/typeid", N * 4, N);
readChunk(m_snapshot->bond_data.groups.data(), m_frame, "bonds/group", N * 8, N);
}

N = 0;
Expand All @@ -263,8 +263,8 @@ void GSDReader::readTopology()
if (N > 0)
{
m_snapshot->angle_data.resize(N);
readChunk(&m_snapshot->angle_data.type_id[0], m_frame, "angles/typeid", N * 4, N);
readChunk(&m_snapshot->angle_data.groups[0], m_frame, "angles/group", N * 12, N);
readChunk(m_snapshot->angle_data.type_id.data(), m_frame, "angles/typeid", N * 4, N);
readChunk(m_snapshot->angle_data.groups.data(), m_frame, "angles/group", N * 12, N);
}

N = 0;
Expand All @@ -273,8 +273,8 @@ void GSDReader::readTopology()
if (N > 0)
{
m_snapshot->dihedral_data.resize(N);
readChunk(&m_snapshot->dihedral_data.type_id[0], m_frame, "dihedrals/typeid", N * 4, N);
readChunk(&m_snapshot->dihedral_data.groups[0], m_frame, "dihedrals/group", N * 16, N);
readChunk(m_snapshot->dihedral_data.type_id.data(), m_frame, "dihedrals/typeid", N * 4, N);
readChunk(m_snapshot->dihedral_data.groups.data(), m_frame, "dihedrals/group", N * 16, N);
}

N = 0;
Expand All @@ -283,8 +283,8 @@ void GSDReader::readTopology()
if (N > 0)
{
m_snapshot->improper_data.resize(N);
readChunk(&m_snapshot->improper_data.type_id[0], m_frame, "impropers/typeid", N * 4, N);
readChunk(&m_snapshot->improper_data.groups[0], m_frame, "impropers/group", N * 16, N);
readChunk(m_snapshot->improper_data.type_id.data(), m_frame, "impropers/typeid", N * 4, N);
readChunk(m_snapshot->improper_data.groups.data(), m_frame, "impropers/group", N * 16, N);
}

N = 0;
Expand All @@ -297,7 +297,11 @@ void GSDReader::readTopology()
for (unsigned int i = 0; i < N; i++)
m_snapshot->constraint_data.val[i] = Scalar(data[i]);

readChunk(&m_snapshot->constraint_data.groups[0], m_frame, "constraints/group", N * 8, N);
readChunk(m_snapshot->constraint_data.groups.data(),
m_frame,
"constraints/group",
N * 8,
N);
}

if (m_handle.header.schema_version >= gsd_make_version(1, 1))
Expand All @@ -308,8 +312,8 @@ void GSDReader::readTopology()
if (N > 0)
{
m_snapshot->pair_data.resize(N);
readChunk(&m_snapshot->pair_data.type_id[0], m_frame, "pairs/typeid", N * 4, N);
readChunk(&m_snapshot->pair_data.groups[0], m_frame, "pairs/group", N * 8, N);
readChunk(m_snapshot->pair_data.type_id.data(), m_frame, "pairs/typeid", N * 4, N);
readChunk(m_snapshot->pair_data.groups.data(), m_frame, "pairs/group", N * 8, N);
}
}
}
Expand Down
Loading

0 comments on commit cf89de0

Please sign in to comment.