Skip to content

Commit

Permalink
Merge branch 'develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ichibha committed Jun 26, 2023
2 parents a58c2f7 + a6a3275 commit 95b86c1
Show file tree
Hide file tree
Showing 187 changed files with 24,332 additions and 5,838 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-github-actions-static.yaml
Expand Up @@ -20,12 +20,12 @@ jobs:
include:
- jobname: ClangTidy14-NoMPI-Real
container:
image: williamfgc/qmcpack-ci:ubuntu22-openmpi
image: ghcr.io/qmcpack/ubuntu22-openmpi:latest
options: -u 1001

- jobname: ClangTidy14-NoMPI-Complex
container:
image: williamfgc/qmcpack-ci:ubuntu22-openmpi
image: ghcr.io/qmcpack/ubuntu22-openmpi:latest
options: -u 1001

steps:
Expand Down
36 changes: 18 additions & 18 deletions .github/workflows/ci-github-actions.yaml
Expand Up @@ -40,72 +40,72 @@ jobs:
include:
- jobname: GCC9-NoMPI-Debug-Real
container:
image: walshmm/qmcpack-ci:ubuntu22-openmpi
image: ghcr.io/qmcpack/ubuntu22-openmpi:latest
options: -u 1001

- jobname: GCC9-NoMPI-NoOMP-Real
container:
image: walshmm/qmcpack-ci:ubuntu22-openmpi
image: ghcr.io/qmcpack/ubuntu22-openmpi:latest
options: -u 1001

- jobname: GCC9-NoMPI-NoOMP-Complex
container:
image: walshmm/qmcpack-ci:ubuntu22-openmpi
image: ghcr.io/qmcpack/ubuntu22-openmpi:latest
options: -u 1001

- jobname: GCC9-NoMPI-Sandbox-Real
container:
image: walshmm/qmcpack-ci:ubuntu22-openmpi
image: ghcr.io/qmcpack/ubuntu22-openmpi:latest
options: -u 1001

- jobname: GCC9-MPI-Gcov-Real
container:
image: walshmm/qmcpack-ci:ubuntu22-openmpi
image: ghcr.io/qmcpack/ubuntu22-openmpi:latest
options: -u 1001

- jobname: GCC9-MPI-Gcov-Complex
container:
image: walshmm/qmcpack-ci:ubuntu22-openmpi
image: ghcr.io/qmcpack/ubuntu22-openmpi:latest
options: -u 1001

- jobname: GCC11-NoMPI-Werror-Real
container:
image: williamfgc/qmcpack-ci:ubuntu2110-serial
image: ghcr.io/qmcpack/ubuntu2110-serial:latest
options: -u 1001

- jobname: GCC11-NoMPI-Werror-Complex
container:
image: williamfgc/qmcpack-ci:ubuntu2110-serial
image: ghcr.io/qmcpack/ubuntu2110-serial:latest
options: -u 1001

- jobname: GCC11-NoMPI-Werror-Real-Mixed
container:
image: williamfgc/qmcpack-ci:ubuntu2110-serial
image: ghcr.io/qmcpack/ubuntu2110-serial:latest
options: -u 1001

- jobname: GCC11-NoMPI-Werror-Complex-Mixed
container:
image: williamfgc/qmcpack-ci:ubuntu2110-serial
image: ghcr.io/qmcpack/ubuntu2110-serial:latest
options: -u 1001

- jobname: Clang14-NoMPI-ASan-Real
container:
image: walshmm/qmcpack-ci:ubuntu22-openmpi
image: ghcr.io/qmcpack/ubuntu22-openmpi:latest
options: -u 1001

- jobname: Clang14-NoMPI-ASan-Complex
container:
image: walshmm/qmcpack-ci:ubuntu22-openmpi
image: ghcr.io/qmcpack/ubuntu22-openmpi:latest
options: -u 1001

- jobname: Clang14-NoMPI-UBSan-Real
container:
image: walshmm/qmcpack-ci:ubuntu22-openmpi
image: ghcr.io/qmcpack/ubuntu22-openmpi:latest
options: -u 1001

- jobname: Clang16-NoMPI-Offload-Real
container:
image: walshmm/qmcpack-ci:ubuntu22-clang-latest
image: ghcr.io/qmcpack/ubuntu22-clang:latest
options: -u 1001

steps:
Expand Down Expand Up @@ -191,19 +191,19 @@ jobs:
include:
- jobname: GCC11-NoMPI-Debug-Real
container:
image: walshmm/qmcpack-ci:centos-stream-gcc11
image: ghcr.io/qmcpack/centos-stream-gcc11:latest
options: -u 1001
- jobname: GCC11-NoMPI-NoOMP-Real
container:
image: walshmm/qmcpack-ci:centos-stream-gcc11
image: ghcr.io/qmcpack/centos-stream-gcc11:latest
options: -u 1001
- jobname: GCC11-NoMPI-NoOMP-Complex
container:
image: walshmm/qmcpack-ci:centos-stream-gcc11
image: ghcr.io/qmcpack/centos-stream-gcc11:latest
options: -u 1001
- jobname: GCC11-NoMPI-Sandbox-Real
container:
image: walshmm/qmcpack-ci:centos-stream-gcc11
image: ghcr.io/qmcpack/centos-stream-gcc11:latest
options: -u 1001

steps:
Expand Down
12 changes: 12 additions & 0 deletions CMake/ClangCompilers.cmake
Expand Up @@ -46,6 +46,18 @@ if(QMC_OMP)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fstandalone-debug")
endif()

check_cxx_compiler_flag(-fopenmp-assume-no-thread-state OPENMP_ASSUME_NO_THREAD_STATE_WORKS)
option(OMPTARGET_ASSUME_NO_THREAD_STATE "Use -fopenmp-assume-no-thread-state compile option" ${OPENMP_ASSUME_NO_THREAD_STATE_WORKS})
if(OMPTARGET_ASSUME_NO_THREAD_STATE)
set(OPENMP_OFFLOAD_COMPILE_OPTIONS "${OPENMP_OFFLOAD_COMPILE_OPTIONS} -fopenmp-assume-no-thread-state")
endif()

check_cxx_compiler_flag(-fopenmp-assume-no-nested-parallelism OPENMP_ASSUME_NO_NESTED_PAR_WORKS)
option(OMPTARGET_ASSUME_NO_NESTED_PAR "Use -fopenmp-assume-no-nested-parallelism compile option" ${OPENMP_ASSUME_NO_NESTED_PAR_WORKS})
if(OMPTARGET_ASSUME_NO_NESTED_PAR)
set(OPENMP_OFFLOAD_COMPILE_OPTIONS "${OPENMP_OFFLOAD_COMPILE_OPTIONS} -fopenmp-assume-no-nested-parallelism")
endif()

# AOMP/ROCM special option -fdisable-host-devmem to disable unecessary data transfers
# The down side of using this option is that it disables printf from offload regions.
# see https://github.com/ROCm-Developer-Tools/aomp/issues/526
Expand Down
14 changes: 8 additions & 6 deletions config/build_alcf_sunspot_icpx.sh
Expand Up @@ -9,7 +9,7 @@

module load spack libxml2 cmake
module load cray-hdf5/1.12.2.1
module load oneapi/eng-compiler/2022.12.30.002
module load oneapi/eng-compiler/2022.12.30.005

module list >& module_list.txt

Expand All @@ -23,7 +23,7 @@ echo "**********************************"

TYPE=Release
Machine=sunspot
Compiler=icpx
Compiler=icpx20230321

if [[ $# -eq 0 ]]; then
source_folder=`pwd`
Expand All @@ -45,7 +45,7 @@ for name in offload_sycl_real_MP offload_sycl_real offload_sycl_cplx_MP offload_
cpu_real_MP cpu_real cpu_cplx_MP cpu_cplx
do

CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=$TYPE"
CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=$TYPE -DMPIEXEC_PREFLAGS='--cpu-bind;depth;-d;8'"

if [[ $name == *"cplx"* ]]; then
CMAKE_FLAGS="$CMAKE_FLAGS -DQMC_COMPLEX=ON"
Expand All @@ -57,6 +57,7 @@ fi

if [[ $name == *"offload"* ]]; then
CMAKE_FLAGS="$CMAKE_FLAGS -DENABLE_OFFLOAD=ON"
CMAKE_CXX_FLAGS="-mllvm -vpo-paropt-atomic-free-reduction-slm=true"
fi

if [[ $name == *"sycl"* ]]; then
Expand All @@ -70,15 +71,16 @@ if [[ -v install_folder ]]; then
fi

echo "**********************************"
echo "$folder"
echo "$CMAKE_FLAGS"
echo "folder $folder"
echo "CMAKE_FLAGS: $CMAKE_FLAGS"
echo "CMAKE_CXX_FLAGS: $CMAKE_CXX_FLAGS"
echo "**********************************"

mkdir $folder
cd $folder

if [ ! -f CMakeCache.txt ] ; then
cmake $CMAKE_FLAGS -DCMAKE_CXX_FLAGS="-mllvm -vpo-paropt-atomic-free-reduction-slm=true" \
cmake $CMAKE_FLAGS -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
-DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx $source_folder
fi

Expand Down
9 changes: 9 additions & 0 deletions docs/analyzing.rst
Expand Up @@ -1394,9 +1394,18 @@ input flags are:
File containing atomic structure (default=None).
-g GRID, --grid=GRID Density grid dimensions (default=None).
-c CELL, --cell=CELL Simulation cell axes (default=None).
--density_cell=DENSITY_CELL
Density cell axes (default=None).
--density_corner=DENSITY_CORNER
Density cell corner (default=None).
--lineplot=LINEPLOT Produce a line plot along the selected dimension: 0,
1, or 2 (default=None).
--noplot Do not show plots interactively (default=False).
--twist_info=TWIST_INFO
Use twist weights in twist_info.dat files or not.
Options: "use", "ignore", "require". "use" means use
when present, "ignore" means do not use, "require"
means must be used (default=use).
Usage examples
~~~~~~~~~~~~~~
Expand Down
39 changes: 39 additions & 0 deletions docs/custom_stream_handler.cpp
@@ -0,0 +1,39 @@
class CustomTypeInput : public InputSection
{
public:
struct LabeledPosition
{
std::string letters;
std::array<int, 3> numbers;
};
CustomTestInput()
{
...
attributes = {"name", "custom_attribute"};
custom = {"labeled_position", "custom_attribute"};
}
void setFromStreamCustom(const std::string& ename, const std::string& name, std::istringstream& svalue) override
{
if (ename == "labeled_position")
{
LabeledPosition ws;
svalue >> ws.letters;
svalue >> ws.numbers[0];
svalue >> ws.numbers[1];
svalue >> ws.numbers[2];
values_[name] = ws;
}
else if (name == "custom_attribute")
{
std::string cus_at;
// otherwise you will get not consume the entire attribute just the next piece as determine by operator>> and
// the type you are going into.
std::getline(svalue, cus_at);
... // do your custom parsing.
values_[name] = cus_at;
}
else
throw std::runtime_error("bad name passed: " + name +
" or custom setFromStream not implemented in derived class.");
}
};
59 changes: 59 additions & 0 deletions docs/delegating.cpp
@@ -0,0 +1,59 @@
/** Generic delgate input class.
* The delegate input requires:
* A constructor that takes an xmlNodePtr
* A factoryFunction that matches the signature discussed in InputSection::DelegateHandler
*/

class AnotherInput
{
public:
class AnotherInputSection : public InputSection
{
...
};

AnotherInput(xmlNodePtr cur)
{
...
}
};

/// Factory function for the delegate Input class.
std::any makeAnotherInput(xmlNodePtr cur, std::string& value_label)
{
AnotherInput another_input{cur};
value_label = another_input.get_name();
return another_input;
}

/** Input class delegating to other input classes.
*/
class DelegatingInput
{
class DelegatingInputSection : public InputSection
{
public:
DelegatingInputSection()
{
section_name = "DelegateTest";
...
delegates = {"anotherinput"};
InputSection::registerDelegate("anotherinput", makeAnotherInput);
}
};

public:
DelegatingInput(xmlNodePtr cur) { dins_.readXML(cur); }

// rather than write a real input class we just pass through InputSection for this test.
bool has(const std::string& name) const { return dins_.has(name); }
template<typename T>
T get(const std::string& name) const
{
return dins_.get<T>(name);
}

private:
std::string name_ = "DelegatingInput";
DelegatingInputSection dins_;
};
15 changes: 13 additions & 2 deletions docs/developing.rst
Expand Up @@ -7,6 +7,12 @@ Development Guide
The section gives guidance on how to extend the functionality of QMCPACK. Future examples will likely include topics such as the
addition of a Jastrow function or a new QMC method.

.. admonition:: Definitions

* **Legacy**: code from previous work usually not in line current coding standards or design. It is mostly functional and correct within the context of legacy operations. Most has been modified piecemeal for years to extend functionality.
* **Refactoring**: Process of redesigning code in place through incremental changes toward current design and functionality goals.


QMCPACK coding standards
------------------------

Expand Down Expand Up @@ -767,6 +773,8 @@ During Jastrow optimization, any update to the parameter data managed by the sha
the Jastrow objects. In another example, spline coefficients are managed by a shared pointer which achieves a single copy in
memory shared by an SPOSet and all of its clones.

.. include:: input_code.txt

.. _distance-tables:

Particles and distance tables
Expand Down Expand Up @@ -1027,8 +1035,11 @@ three body Jastrow factors in QMCPACK only needs the row [iel][0:Nelec).
In ``ratioGrad``, the new distances are stored in the ``Temp_r`` and
``Temp_dr`` members of the distance tables.

Setup
~~~~~
Legacy Setup
~~~~~~~~~~~~
.. warning::
The following describes a deprecated method of handling user input.
It is not to be used for new code.

A builder processes XML input, creates the wavefunction, and adds it to
``targetPsi``. Builders derive from ``WaveFunctionComponentBuilder``.
Expand Down
4 changes: 2 additions & 2 deletions docs/github_actions.rst
Expand Up @@ -14,7 +14,7 @@ Note: This is not necessarily the intended typical way for users to build QMCPAC

Jobs running on GitHub hosted runners are triggered automatically. Permission from an admin is required to run jobs on self-hosted runners for security reasons. In addition, jobs running on GitHub hosted runners run automatically in parallel and the time each job takes may vary depending on system utilization. For information on the underlying hardware see the GitHub Actions `docs on the topic <https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners>`_.

All Linux jobs GitHub Runner hosts currently use the `walshmm/qmcpack-ci:ubuntu22-openmpi <https://hub.docker.com/repository/docker/walshmm/qmcpack-ci>`_ docker image, if you would like to reproduce theses tests exactly using docker, please refer to `Running QMCPACK on Docker Containers <https://qmcpack.readthedocs.io/en/develop/running_docker.html>`_ section in the QMCPACK documentation. The macOS job runs directly on the `macos-latest GitHub Actions VM runner <https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources>`_
All Linux jobs GitHub Runner hosts currently use the `ghcr.io/qmcpack/ubuntu22-openmpi:latest <https://github.com/orgs/QMCPACK/packages/container/package/ubuntu22-openmpi>`_ docker image, if you would like to reproduce theses tests exactly using docker, please refer to `Running QMCPACK on Docker Containers <https://qmcpack.readthedocs.io/en/develop/running_docker.html>`_ section in the QMCPACK documentation. The macOS job runs directly on the `macos-latest GitHub Actions VM runner <https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources>`_


.. note::
Expand Down Expand Up @@ -67,7 +67,7 @@ To run the workflow:
- Click on `Run workflow` on the right
- Use workflow from `Branch:develop` and click on the `Run workflow` button

**Note:** the current `.clang-tidy` configuration file is compatible with clang v14 and runs on the `williamfgc/qmcpack-ci:ubuntu22-openmpi` docker image. To run locally on a Linux system use: `docker run -it user williamfgc/qmcpack-ci:ubuntu22-openmpi /bin/bash` or refer to the :ref:`running_docker` section.
**Note:** the current `.clang-tidy` configuration file is compatible with clang v14 and runs on the `ghcr.io/qmcpack/ubuntu22-openmpi:latest` docker image. To run locally on a Linux system use: `docker run -it user ghcr.io/qmcpack/ubuntu22-openmpi:latest /bin/bash` or refer to the :ref:`running_docker` section.

To build locally enabling `clang-tidy`` static checks defined in `qmcpack/src/.clang-tidy` use the CMake `-DCMAKE_CXX_CLANG_TIDY` option as follows:

Expand Down

0 comments on commit 95b86c1

Please sign in to comment.