项目作者: lammps

项目描述 :
Collection of regression tests for LAMMPS MD code
高级语言: Roff
项目地址: git://github.com/lammps/lammps-testing.git
创建时间: 2016-08-29T20:45:33Z
项目社区:https://github.com/lammps/lammps-testing

开源协议:

下载


LAMMPS Test Suite

This repository contains code and examples that drive the testing on
ci.lammps.org. It’s is run on hardware that is hosted
at Temple University.

The tools provided here can also be installed locally for testing on a workstation.

lammps_test is a utility to compile LAMMPS in different configurations on
various environments using containers and perform compilation, run, regression, and unit tests.

Prerequisites

Installation

  1. # regular install
  2. python setup.py install
  3. # for development install
  4. python setup.py develop

Configuration

  1. # Example configuration in ~/.bashrc
  2. export LAMMPS_DIR=$HOME/GitHub/lammps/lammps
  3. export LAMMPS_TESTING_DIR=$HOME/GitHub/lammps/lammps-testing
  4. export LAMMPS_CACHE_DIR=$HOME/GitHub/lammps/cache
  5. export LAMMPS_COMPILE_NPROC=24

LAMMPS_DIR
LAMMPS source directory

LAMMPS_TESTING_DIR
LAMMPS testing source directory

LAMMPS_CACHE_DIR
Directory storing compiled binaries and containers

Basic Usage

The general idea behind lammps_test is to provide similar feedback to a LAMMPS commit to what is available when running on ci.lammps.org. The main benefit of running it locally on your workstation is that you have the same exact binaries and output folders as on the CI server.

When you type lammps_test status what you get is a full report of the current testing status of the HEAD commit in your LAMMPS git checkout (specified by LAMMPS_DIR).

  1. $ lammps_test status
  2. Compilation Tests:
  3. centos7/cmake_mpi_openmp_bigbig_static (4a048e3f)
  4. centos7/cmake_serial_smallsmall_static (4a048e3f)
  5. centos7/cmake_mpi_smallbig_shared (4a048e3f)
  6. centos7/legacy_serial_openmp_smallsmall_static (4a048e3f)
  7. fedora/cmake_kokkos_mpi_openmp_clang_shared (4a048e3f)
  8. fedora/cmake_serial_smallsmall_static (4a048e3f)
  9. fedora/cmake_mpi_smallbig_shared (4a048e3f)
  10. fedora/legacy_mpi_bigbig_shared (4a048e3f)
  11. intel/cmake_mpi_openmp_bigbig_icc_static (4a048e3f)
  12. intel/cmake_kokkos_mpi_openmp_smallbig_icc_shared (4a048e3f)
  13. intel_oneapi/cmake_mpi_openmp_bigbig_oneapi_static (4a048e3f)
  14. intel_oneapi/cmake_kokkos_mpi_openmp_smallbig_oneapi_shared (4a048e3f)
  15. ubuntu/cmake_mpi_openmp_bigbig_static (4a048e3f)
  16. ubuntu/legacy_mpi_bigbig_shared (4a048e3f)
  17. ubuntu/legacy_serial_openmp_smallsmall_static (4a048e3f)
  18. windows/cmake_mpi_openmp_smallbig_shared_win64 (4a048e3f)
  19. windows/cmake_serial_smallsmall_static_win32 (4a048e3f)
  20. Run Tests:
  21. ubuntu/cmake_testing_serial (4a048e3f)
  22. ubuntu/cmake_testing_mpi (4a048e3f)
  23. ubuntu/cmake_testing_openmp (4a048e3f)
  24. Regression Tests:
  25. ubuntu/cmake_regression_mpi (4a048e3f)
  26. Unit Tests:
  27. ubuntu/cmake_mpi_openmp_smallsmall_shared (4a048e3f)
  28. ubuntu/cmake_mpi_openmp_smallbig_shared (4a048e3f)
  29. ubuntu/cmake_mpi_openmp_bigbig_shared (4a048e3f)
  30. ubuntu_gpu/cmake_gpu_cuda_double_smallbig_clang_shared (4a048e3f)
  31. ubuntu_gpu/cmake_gpu_cuda_single_bigbig_static (4a048e3f)
  32. ubuntu_gpu/cmake_gpu_opencl_double_bigbig_shared (4a048e3f)
  33. ubuntu_gpu/cmake_gpu_opencl_mixed_smallbig_clang_static (4a048e3f)

As you execute other lammps_test subcommands, this status is updated. Before running tests, you will need the LAMMPS containers.

Containers

To make builds reproducible, lammps_test uses Singularity containers for
building all binaries. Singularity must be installed and the current user must
have sudo rights to build containers.

Container definitions are located in containers/singularity/, built
containers are stored in $LAMMPS_CACHE_DIR/containers/.

While you can create containers in any way you want using the singularity
command-line, there is a utility command for building one or more containers
with lammps_test:

  1. # builds all container definitions at once
  2. lammps_test env build ALL
  3. # only build ubuntu18.04 container
  4. lammps_test env build ubuntu18.04
  5. # build multiple containers
  6. lammps_test env build ubuntu18.04 centos7 fedora30_mingw

Compilation Tests

The compilation tests done by the LAMMPS Jenkins server executes several bash
scripts on multiple containers. Each environment that should be tested defines
a YAML file in the scripts/ folder. Currently it has 7 definitions:

  • ubuntu.yml
  • ubuntu_gpu.yml
  • centos7.yml
  • fedora.yml
  • intel.yml
  • intel_oneapi.yml
  • windows.yml

Each of these environment defines a list of builds and the used
singularity_image. The names of the builds correspond to bash scripts located
in scripts/builds/<BUILD_NAME>.sh.

These build scripts assume the necessary environment variables described above
are defined and will compile LAMMPS in the current working directory.
lammps_test compile is a wrapper command that create the necessary
working directory inside of the $LAMMPS_CACHE_DIR folder, and then launches
these scripts inside the correct container.

On ci.lammps.org, these tests are one environment at a time, running multiple compilations in parallel. Below is a visualization of the current compilation test pipeline that both runs for the develop branch (current development version of LAMMPS) and each pull request.

Pipeline View of Compilation Tests Pipeline View of Compilation Tests

Running compilation tests locally

You can build all compilation tests at once as follows:

  1. # this will launch all ubuntu, centos and windows compilation tests
  2. lammps_test compile

To limit the compilation tests use the environment name as selector:

  1. # only run ubuntu compilation tests
  2. lammps_test compile ubuntu

If only a few builds in an environment should be run specify them with their full name:

  1. # only run 'cmake_mpi_smallbig_shared' compilation test on ubuntu
  2. lammps_test compile ubuntu/cmake_mpi_smallbig_shared
  3. # run two compilations tests on ubuntu
  4. lammps_test compile ubuntu/cmake_serial_smallsmall_static ubuntu/cmake_mpi_smallbig_shared
  5. # run only legacy compilation tests
  6. lammps_test compile ubuntu/legacy*

Build directories

Each build will create its own working directory based on the current Git SHA
of the LAMMPS_DIR checkout.

It will be located in: $LAMMPS_CACHE_DIR/builds_<CURENT_LAMMPS_SHA>/<CONFIG_NAME>/<BUILD_NAME>

Example:

  1. lammps_test compile ubuntu/cmake_mpi_smallbig_shared

will create the folder:
$LAMMPS_CACHE_DIR/builds_<CURENT_LAMMPS_SHA>/ubuntu/cmake_mpi_smallbig_shared

To modify this behaviour and use the same build directory, independent of the current SHA, use the --ignore-commit option:

Example:

  1. lammps_test compile --ignore-commit ubuntu/cmake_mpi_smallbig_shared

will create the folder:
$LAMMPS_CACHE_DIR/builds/ubuntu/cmake_mpi_smallbig_shared

Run Tests

Run tests define a set of test cases which will execute LAMMPS input scripts.
We only observe if the test case completes without an error. Similar to
compilation tests, each configuration can define a list of run_tests in
their YAML file. The names correspond to folders in the
scripts/run_tests directory.

  1. display_name: 'Ubuntu 18.04'
  2. container_image: 'ubuntu18.04'
  3. builds:
  4. - cmake_kokkos_mpi_openmp_clang_shared
  5. - cmake_mpi_openmp_bigbig_static
  6. - legacy_mpi_bigbig_shared
  7. - legacy_serial_openmp_smallsmall_static
  8. run_tests:
  9. - cmake_testing_serial
  10. - cmake_testing_mpi
  11. - cmake_testing_openmp

Each run test consists of two scripts:

build.sh:
A script which compiles a LAMMPS binary for testing

test.sh:
A script which launches the test suite

To launch all run tests at once use the lammps_test run command:

  1. # this will launch all ubuntu, centos and windows run tests
  2. lammps_test runtest

To only test a single environment:

  1. # only run a single ubuntu run tests
  2. lammps_test runtest run ubuntu/*

To further limit the run tests to invividual builds, specify each build individual:

  1. # Launch serial run tests on ubuntu
  2. lammps_test runtest run ubuntu/cmake_testing_serial
  3. # Lauch MPI and OpenMP run tests on ubuntu
  4. lammps_test runtest run ubuntu/cmake_testing_mpi ubuntu/cmake_testing_openmp

Regression Tests

Regression tests are similar to run tests. However, they not only require
scripts to complete without an error, but that their generated outputs are
“identical” to the ones of a reference run.

Regression tests are defined for each configuration by adding a
regression_tests list to their YAML file. The names correspond to folders
in the scripts/regression_tests directory.

  1. display_name: 'Ubuntu 18.04'
  2. container_image: 'ubuntu18.04'
  3. builds:
  4. - cmake_kokkos_mpi_openmp_clang_shared
  5. - cmake_mpi_openmp_bigbig_static
  6. - legacy_mpi_bigbig_shared
  7. - legacy_serial_openmp_smallsmall_static
  8. ...
  9. regression_tests:
  10. - cmake_regression_mpi

Each regression test consists of two scripts:

build.sh:
A script which compiles a LAMMPS binary for testing

test.sh:
A script which launches the test suite

To launch all regressions tests at once use the lammps_test reg command:

  1. # this will launch all ubuntu, centos and windows regression tests
  2. lammps_test reg run

To only test a single environment specify the environment name:

  1. # only run ubuntu regression tests
  2. lammps_test reg run ubuntu

To further limit the regression tests to individual builds, specify the full name:

  1. # Launch serial regression tests on ubuntu
  2. lammps_test reg run ubuntu/cmake_regression_mpi

NOTE: Both lammps_test runtest and lammps_test reg have the --build-only and --test-only option. Use them to avoid one of the two phases.