Skip to content

Commit

Permalink
Merge for 2.21.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
benmwebb committed Jun 6, 2024
2 parents 88de4f3 + 6c1d0d6 commit af6f9d6
Show file tree
Hide file tree
Showing 449 changed files with 9,555 additions and 1,989 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/flake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
- name: Test
run: |
pip install flake8
flake8 tools modules/cnmultifit/pyext modules/EMageFit/pyext modules/parallel/pyext modules/test/pyext modules/mmcif/pyext modules/statistics/pyext modules/pepdock/pyext modules/saxs_merge/bin/saxs_merge
flake8 tools modules/cnmultifit/pyext modules/EMageFit/pyext modules/parallel/pyext modules/test/pyext modules/mmcif/pyext modules/statistics/pyext modules/pepdock/pyext modules/saxs_merge/bin/saxs_merge modules/isd/pyext modules/multifit/pyext modules/spatiotemporal/pyext
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@
path = modules/sampcon
url = https://github.com/salilab/imp-sampcon.git
branch = imp_module
[submodule "modules/nestor"]
path = modules/nestor
url = https://github.com/isblab/nestor.git
branch = imp-integration
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ if(POLICY CMP0056)
cmake_policy(SET CMP0056 NEW)
endif(POLICY CMP0056)

# Don't complain about our use of FindCUDA for now
if(POLICY CMP0146)
cmake_policy(SET CMP0146 OLD)
endif(POLICY CMP0146)

include(${CMAKE_SOURCE_DIR}/cmake_modules/IMPExecuteProcess.cmake)
include(${CMAKE_SOURCE_DIR}/cmake_modules/IMPAddTests.cmake)
include(${CMAKE_SOURCE_DIR}/cmake_modules/CheckCompiles.cmake)
Expand Down Expand Up @@ -488,6 +493,9 @@ file(WRITE ${CMAKE_BINARY_DIR}/IMPConfig.cmake
"set(IMP_SWIG_DIR \"${CMAKE_BINARY_DIR}/swig\" )\n"
"set(RMF_SWIG_DIR \"${CMAKE_SOURCE_DIR}/modules/rmf/dependency/RMF/swig\" )\n"
"set(IMP_MODULES_DIR \"${CMAKE_SOURCE_DIR}/cmake_modules\" )\n"
"set(IMP_CXX_COMPILER \"${CMAKE_CXX_COMPILER}\" )\n"
"set(IMP_CXX_FLAGS \"${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}\" )\n"
"set(IMP_OSX_SYSROOT \"${CMAKE_OSX_SYSROOT}\" )\n"
"set(RMF_INCLUDE_PATH \"${RMF_INCLUDE_PATH}\" )\n"
"set(IMP_USE_FILE \"\${IMP_USE_DIR}/UseIMP.cmake\" )\n")
# Installed locations
Expand All @@ -505,6 +513,9 @@ file(WRITE ${CMAKE_BINARY_DIR}/cmake/IMPConfig.cmake
"set(RMF_SWIG_DIR \"${CMAKE_INSTALL_FULL_SWIGDIR}\" )\n"
"set(IMP_MODULES_DIR \"${CMAKE_INSTALL_FULL_CMAKEDIR}\" )\n"
"set(RMF_INCLUDE_PATH \"${CMAKE_INSTALL_FULL_INCLUDEDIR}\" )\n"
"set(IMP_CXX_COMPILER \"${CMAKE_CXX_COMPILER}\" )\n"
"set(IMP_CXX_FLAGS \"${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}\" )\n"
"set(IMP_OSX_SYSROOT \"${CMAKE_OSX_SYSROOT}\" )\n"
"set(IMP_USE_FILE \"\${IMP_USE_DIR}/UseIMP.cmake\" )\n")
list(REMOVE_DUPLICATES IMP_ALL_DEPENDS_VARS)
foreach(cmakefile ${CMAKE_BINARY_DIR}/IMPConfig.cmake
Expand Down
20 changes: 20 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
ChangeLog {#changelog}
=========

# 2.21.0 - 2024-06-13 # {#changelog_2_21_0}
- The new IMP::spatiotemporal module can be used to assist in building stepwise
spatiotemporal models, such as those we used to compute our model of
NPC assembly.
- The new IMP::nestor module performs nested sampling-based optimization of
representation.
- This is the last version of IMP to support Python 2. Please port your
workflows to Python 3.
- The IMP::atom::ChainPDBSelector constructor that takes a single string has
been removed; pass a list of chain IDs instead.
- The IMP::pmi::get_is_canonical function has been removed; PMI no longer
supports the older PMI1-style hierarchies.
- .deb packages for IMP for Ubuntu LTS, for both amd64 and arm64 architectures,
are now provided by an
[Ubuntu PPA](https://launchpad.net/~salilab/+archive/ubuntu/ppa)
- Many runtime checks on the VectorD and Array (e.g. used by ParticleIndexPair)
classes have now been moved to compile-time checks, which makes restraint
evaluation significantly faster in release builds, without sacrificing
correctness.

# 2.20.2 - 2024-04-04 # {#changelog_2_20_2}
- Add support for building ARM64 .deb packages.
- Bugfix: fix use of nested classes with latest SWIG.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.20.2
2.21.0
5 changes: 1 addition & 4 deletions cmake_modules/IMPFindCompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ endif()
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE
GCC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "GCC version: ${GCC_VERSION}")
if (GCC_VERSION VERSION_GREATER 4.6 OR GCC_VERSION VERSION_EQUAL 4.6)
message(STATUS "No conversion issue")
elseif (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
if (GCC_VERSION VERSION_LESS 4.6 AND (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3))
add_definitions("-Wno-conversion")
endif()
endif()
Expand Down
33 changes: 17 additions & 16 deletions cmake_modules/IMPFindPython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,23 @@ function(imp_find_python)
endif()
set(PYTHON_EXECUTABLE ${python_full_path} CACHE INTERNAL "" FORCE)
set(PYTHON_TEST_EXECUTABLE ${python_full_path} CACHE STRING "")
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; print('%d.%d.%d' % sys.version_info[:3])"
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
OUTPUT_VARIABLE python_full_version
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX REPLACE "^([0-9])+\\.[0-9]+.*" "\\1" major
"${python_full_version}")
string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" minor
"${python_full_version}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" patch
"${python_full_version}")
set(PYTHON_VERSION ${python_full_version} CACHE INTERNAL "" FORCE)
set(PYTHON_VERSION_MAJOR ${major} CACHE INTERNAL "" FORCE)
set(PYTHON_VERSION_MINOR ${minor} CACHE INTERNAL "" FORCE)
set(PYTHON_VERSION_PATCH ${patch} CACHE INTERNAL "" FORCE)
message(STATUS "Python binary is " ${python_full_path} " (version " ${python_full_version} ")")

endif()
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; print('%d.%d.%d' % sys.version_info[:3])"
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
OUTPUT_VARIABLE python_full_version
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX REPLACE "^([0-9])+\\.[0-9]+.*" "\\1" major
"${python_full_version}")
string(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" minor
"${python_full_version}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" patch
"${python_full_version}")
set(PYTHON_VERSION ${python_full_version} CACHE INTERNAL "" FORCE)
set(PYTHON_VERSION_MAJOR ${major} CACHE INTERNAL "" FORCE)
set(PYTHON_VERSION_MINOR ${minor} CACHE INTERNAL "" FORCE)
set(PYTHON_VERSION_PATCH ${patch} CACHE INTERNAL "" FORCE)
message(STATUS "Python binary is " ${PYTHON_EXECUTABLE} " (version " ${python_full_version} ")")
if(NOT DEFINED PYTHON_INCLUDE_DIRS)
find_package(PythonLibs ${python_full_version} EXACT REQUIRED)
# Make sure PYTHON_INCLUDE_DIRS is in the cache so it can be
# used elsewhere
Expand Down
1 change: 1 addition & 0 deletions doc/manual/cmake_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Various aspects of %IMP build behavior can be controlled via variables. These ca
- `IMP_MAX_CHECKS`: One of `NONE`, `USAGE`, `INTERNAL` to control what check levels will be supported. The default is `USAGE` for release builds and `INTERNAL` for debug builds (setting this to `INTERNAL` will impact performance; `NONE` is not recommended as all sanity checks will be skipped).
- `IMP_MAX_LOG`: One of `SILENT`, `PROGRESS`, `TERSE`, `VERBOSE` to control what log levels are supported.
- `IMP_PER_CPP_COMPILATION`: A colon-separated list of modules to build one .cpp at a time, or `ALL` to do this for all modules.
- `IMP_CUDA`: A colon-separated list of modules to build with CUDA (GPU) support, or `ALL` to do this for all modules. This is experimental and is currently in development. See [here](@ref gpu) for more details.
- `USE_PYTHON2`: Set to `on` to have CMake build %IMP with Python 2 (by default it will use Python 3 if available).
- `IMP_USE_SYSTEM_RMF`: Set to `on` to build %IMP using an external (system) copy of the RMF library, instead of that bundled with IMP itself.
- `IMP_USE_SYSTEM_IHM`: Set to `on` to build %IMP using an external (system) copy of the python-ihm library, instead of that bundled with IMP itself.
Expand Down
13 changes: 13 additions & 0 deletions doc/manual/gpu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
GPU support {#gpu}
===========

%IMP currently has only very rudimentary support for running on a graphics
processing unit (GPU), although this is currently in development.

%IMP currently only supports NVIDIA GPUs using the CUDA toolkit (although this
is likely to switch to use [SYCL](https://sycl.tech/) as the ecosystem matures).
To build %IMP from source code with CUDA support (there are currently no
prebuilt %IMP binaries that use CUDA), ensure that the `nvcc` compiler
from NVIDIA's [CUDA toolkit](https://developer.nvidia.com/cuda-downloads)
is available, and add `-DIMP_CUDA` to your
[CMake invocation](@ref cmake_config).
4 changes: 1 addition & 3 deletions doc/manual/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ to see if the code is currently stable enough for your purposes.
To experiment with IMP on [Google Colaboratory](https://colab.research.google.com), use the following code snippet:

\code{.unparsed}
!echo "deb https://integrativemodeling.org/latest/download $(lsb_release -cs)/" > /etc/apt/sources.list.d/salilab.list
!wget -O /etc/apt/trusted.gpg.d/salilab.asc https://salilab.org/~ben/pubkey256.asc
!apt update
!add-apt-repository -y ppa:salilab/ppa
!apt install imp
import sys, os, glob
sys.path.append(os.path.dirname(glob.glob('/usr/lib/python*/dist-packages/IMP')[0]))
Expand Down
2 changes: 2 additions & 0 deletions doc/manual/mainpage.dox
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ complex might want to skip ahead to

- [Bug reports](@ref bugs)

- [GPU support](@ref gpu)

- [Applying IMP to a new biological system](@ref biosystem)

- [Developing the IMP source code](@ref developing)
Expand Down
3 changes: 2 additions & 1 deletion doc/manual/write_examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ for it to finish.) The build system passes each example the `--run_quick_test`
argument, so this can be used to run a faster subset (e.g. fewer iterations
of an optimization). If you are trying to demonstrate the application of your
method to a real biological system, you should write a
[biological system](https://integrativemodeling.org/systems/) instead of an
[biological system](https://integrativemodeling.org/systems/) or perhaps a
[tutorial](https://integrativemodeling.org/tutorials/) instead of an
example.

The example should have enough comments that the reasoning behind each line of code is clear to someone who roughly understands how %IMP in general works.
Expand Down
39 changes: 30 additions & 9 deletions modules/algebra/include/VectorBaseD.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,22 @@
#include <limits>
#include <cmath>
#include <boost/random/normal_distribution.hpp>
#include <boost/static_assert.hpp>

#if IMP_HAS_CHECKS >= IMP_INTERNAL
#define IMP_ALGEBRA_VECTOR_CHECK check_vector()
#define IMP_ALGEBRA_VECTOR_CHECK_OTHER(o) o.check_vector()
#else
#define IMP_ALGEBRA_VECTOR_CHECK
#define IMP_ALGEBRA_VECTOR_CHECK_OTHER(o)
#endif

/* Should only need to check for "compatible" (same dimension) vectors
when using variable-dimension vectors; otherwise, it is checked at
compile time */
#if IMP_HAS_CHECKS >= IMP_USAGE
#define IMP_ALGEBRA_VECTOR_CHECK_INDEX(i) check_index(i)
#define IMP_ALGEBRA_VECTOR_CHECK_COMPATIBLE(o) \
check_compatible_vector(o); \
o.check_vector()
if (D == -1) { check_compatible_vector(o); }
#else
#define IMP_ALGEBRA_VECTOR_CHECK_INDEX(i)
#define IMP_ALGEBRA_VECTOR_CHECK_COMPATIBLE(o)
Expand All @@ -61,8 +64,8 @@ class VectorBaseD : public GeometricPrimitiveD<D> {
}

void check_vector() const {
IMP_USAGE_CHECK(!data_.get_is_null(),
"Attempt to use uninitialized vector.");
IMP_INTERNAL_CHECK(!data_.get_is_null(),
"Attempt to use uninitialized vector.");
}
template <int OD>
void check_compatible_vector(const VectorBaseD<OD> &o) const {
Expand Down Expand Up @@ -129,9 +132,10 @@ class VectorBaseD : public GeometricPrimitiveD<D> {
//! Default constructor
VectorBaseD() {}

double get_scalar_product(const VectorBaseD<D> &o) const {
IMP_ALGEBRA_VECTOR_CHECK_COMPATIBLE(o);
double get_scalar_product(const VectorBaseD &o) const {
IMP_ALGEBRA_VECTOR_CHECK;
IMP_ALGEBRA_VECTOR_CHECK_OTHER(o);
IMP_ALGEBRA_VECTOR_CHECK_COMPATIBLE(o);
double ret = 0;
for (unsigned int i = 0; i < get_dimension(); ++i) {
ret += operator[](i) * o.operator[](i);
Expand All @@ -153,23 +157,40 @@ class VectorBaseD : public GeometricPrimitiveD<D> {

double get_magnitude() const { return std::sqrt(get_squared_magnitude()); }

//! Return the distance between this and another vector
/** This is essentially identical to (v1 - v2).get_magnitude() but
may be slightly more efficient as it avoids creating a temporary
vector object. */
double get_distance(const VectorBaseD<D> &o) const {
IMP_ALGEBRA_VECTOR_CHECK_OTHER(o);
IMP_ALGEBRA_VECTOR_CHECK_COMPATIBLE(o);
const double *data = get_data(), *odata = o.get_data();
double ret = 0;
for (unsigned int i = 0; i < get_dimension(); ++i) {
ret += (odata[i] - data[i]) * (odata[i] - data[i]);
}
return std::sqrt(ret);
}

#ifndef IMP_DOXYGEN
double operator*(const VectorBaseD<D> &o) const {
return get_scalar_product(o);
}

VectorBaseD &operator+=(const VectorBaseD &o) {
IMP_ALGEBRA_VECTOR_CHECK_COMPATIBLE(o);
IMP_ALGEBRA_VECTOR_CHECK;
IMP_ALGEBRA_VECTOR_CHECK_OTHER(o);
IMP_ALGEBRA_VECTOR_CHECK_COMPATIBLE(o);
for (unsigned int i = 0; i < get_dimension(); ++i) {
operator[](i) += o[i];
}
return *this;
}

VectorBaseD &operator-=(const VectorBaseD &o) {
IMP_ALGEBRA_VECTOR_CHECK_COMPATIBLE(o);
IMP_ALGEBRA_VECTOR_CHECK;
IMP_ALGEBRA_VECTOR_CHECK_OTHER(o);
IMP_ALGEBRA_VECTOR_CHECK_COMPATIBLE(o);
for (unsigned int i = 0; i < get_dimension(); ++i) {
operator[](i) -= o[i];
}
Expand Down
17 changes: 0 additions & 17 deletions modules/algebra/include/VectorD.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,6 @@
#include <limits>
#include <cmath>
#include <boost/random/normal_distribution.hpp>
#include <boost/static_assert.hpp>

#if IMP_HAS_CHECKS >= IMP_INTERNAL
#define IMP_ALGEBRA_VECTOR_CHECK check_vector()
#else
#define IMP_ALGEBRA_VECTOR_CHECK
#endif

#if IMP_HAS_CHECKS >= IMP_USAGE
#define IMP_ALGEBRA_VECTOR_CHECK_INDEX(i) check_index(i)
#define IMP_ALGEBRA_VECTOR_CHECK_COMPATIBLE(o) \
check_compatible_vector(o); \
o.check_vector()
#else
#define IMP_ALGEBRA_VECTOR_CHECK_INDEX(i)
#define IMP_ALGEBRA_VECTOR_CHECK_COMPATIBLE(o)
#endif

IMPALGEBRA_BEGIN_NAMESPACE
//! A Cartesian vector in D-dimensions.
Expand Down
5 changes: 3 additions & 2 deletions modules/algebra/include/algebra_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* \file IMP/algebra/algebra_macros.h
* \brief Various helper macros.
*
* Copyright 2007-2022 IMP Inventors. All rights reserved.
* Copyright 2007-2024 IMP Inventors. All rights reserved.
*
*/

Expand Down Expand Up @@ -34,7 +34,8 @@
template <int OD> \
VectorD(const VectorD<OD> &o) \
: P(o) { \
BOOST_STATIC_ASSERT(OD == D || OD == -1 || D == -1); \
static_assert(OD == D || OD == -1 || D == -1, \
"VectorD size mismatch"); \
} \
IMP_ALGEBRA_VECTOR_SWIG_METHODS(D); \
/** The distance between b and e must be equal to D. \
Expand Down
Loading

0 comments on commit af6f9d6

Please sign in to comment.