Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
Current state of `develop` is `v2.0.0b1` that is about to be released.
The `master` branch has been `v1.6.x` up to this point, which will now
become a support branch and `master` will become `v2.x`.
  • Loading branch information
sphuber committed Mar 15, 2022
2 parents bba27c3 + 2ac0673 commit fa28956
Show file tree
Hide file tree
Showing 1,293 changed files with 141,889 additions and 58,762 deletions.
5 changes: 0 additions & 5 deletions .coveragerc

This file was deleted.

31 changes: 23 additions & 8 deletions .docker/opt/configure-aiida.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ set -x
# Environment.
export SHELL=/bin/bash

# Update the list of installed aiida plugins.
reentry scan

# Setup AiiDA autocompletion.
grep _VERDI_COMPLETE /home/${SYSTEM_USER}/.bashrc &> /dev/null || echo 'eval "$(_VERDI_COMPLETE=source verdi)"' >> /home/${SYSTEM_USER}/.bashrc

Expand All @@ -36,17 +33,35 @@ if [[ ${NEED_SETUP_PROFILE} == true ]]; then

# Setup and configure local computer.
computer_name=localhost

# Determine the number of physical cores as a default for the number of
# available MPI ranks on the localhost. We do not count "logical" cores,
# since MPI parallelization over hyper-threaded cores is typically
# associated with a significant performance penalty. We use the
# `psutil.cpu_count(logical=False)` function as opposed to simply
# `os.cpu_count()` since the latter would include hyperthreaded (logical
# cores).
NUM_PHYSICAL_CORES=$(python -c 'import psutil; print(int(psutil.cpu_count(logical=False)))' 2>/dev/null)
LOCALHOST_MPI_PROCS_PER_MACHINE=${LOCALHOST_MPI_PROCS_PER_MACHINE:-${NUM_PHYSICAL_CORES}}

if [ -z $LOCALHOST_MPI_PROCS_PER_MACHINE ]; then
echo "Unable to automatically determine the number of logical CPUs on this "
echo "machine. Please set the LOCALHOST_MPI_PROCS_PER_MACHINE variable to "
echo "explicitly set the number of available MPI ranks."
exit 1
fi

verdi computer show ${computer_name} || verdi computer setup \
--non-interactive \
--label "${computer_name}" \
--description "this computer" \
--hostname "${computer_name}" \
--transport local \
--scheduler direct \
--transport core.local \
--scheduler core.direct \
--work-dir /home/aiida/aiida_run/ \
--mpirun-command "mpirun -np {tot_num_mpiprocs}" \
--mpiprocs-per-machine 1 && \
verdi computer configure local "${computer_name}" \
--mpiprocs-per-machine ${LOCALHOST_MPI_PROCS_PER_MACHINE} && \
verdi computer configure core.local "${computer_name}" \
--non-interactive \
--safe-interval 0.0
fi
Expand All @@ -59,7 +74,7 @@ verdi profile show || echo "The default profile is not set."
verdi daemon stop

# Migration will run for the default profile.
verdi database migrate --force || echo "Database migration failed."
verdi storage migrate --force || echo "Database migration failed."

# Daemon will start only if the database exists and is migrated to the latest version.
verdi daemon start || echo "AiiDA daemon is not running."
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
contact_links:
- name: AiiDA Discussions
url: https://github.com/aiidateam/aiida-core/discussions
about: For aiida-core questions and discussion
- name: AiiDA Users Forum
url: http://www.aiida.net/mailing-list/
about: For general questions and discussion
2 changes: 1 addition & 1 deletion .github/config/add.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
label: add
description: add
input_plugin: arithmetic.add
input_plugin: core.arithmetic.add
on_computer: true
computer: localhost
remote_abs_path: /bin/bash
Expand Down
2 changes: 1 addition & 1 deletion .github/config/doubler.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
label: doubler
description: doubler
input_plugin: templatereplacer
input_plugin: core.templatereplacer
on_computer: true
computer: localhost
remote_abs_path: PLACEHOLDER_REMOTE_ABS_PATH_DOUBLER
Expand Down
4 changes: 2 additions & 2 deletions .github/config/localhost.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
label: localhost
description: localhost
hostname: localhost
transport: local
scheduler: direct
transport: core.local
scheduler: core.direct
shebang: '#!/usr/bin/env bash'
work_dir: PLACEHOLDER_WORK_DIR
mpirun_command: ' '
Expand Down
9 changes: 5 additions & 4 deletions .github/config/profile.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
profile: PLACEHOLDER_PROFILE
profile: test_aiida
email: aiida@localhost
first_name: Giuseppe
last_name: Verdi
institution: Khedivial
db_backend: PLACEHOLDER_BACKEND
db_backend: psql_dos
db_engine: postgresql_psycopg2
db_host: localhost
db_port: 5432
db_name: PLACEHOLDER_DATABASE_NAME
db_name: test_aiida
db_username: postgres
db_password: ''
broker_protocol: amqp
Expand All @@ -17,4 +17,5 @@ broker_password: guest
broker_host: 127.0.0.1
broker_port: 5672
broker_virtual_host: ''
repository: PLACEHOLDER_REPOSITORY
repository: /tmp/test_repository_test_aiida/
test_profile: true
4 changes: 2 additions & 2 deletions .github/config/slurm-ssh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
label: slurm-ssh
description: slurm container
hostname: localhost
transport: ssh
scheduler: slurm
transport: core.ssh
scheduler: core.slurm
shebang: "#!/bin/bash"
work_dir: /home/{username}/workdir
mpirun_command: "mpirun -np {tot_num_mpiprocs}"
Expand Down
12 changes: 6 additions & 6 deletions .github/system_tests/pytest/test_memory_leaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""Utilities for testing memory leakage."""
from tests.utils import processes as test_processes # pylint: disable=no-name-in-module,import-error
from tests.utils.memory import get_instances # pylint: disable=no-name-in-module,import-error
from aiida import orm
from aiida.engine import processes, run_get_node
from aiida.plugins import CalculationFactory
from aiida import orm
from tests.utils import processes as test_processes # pylint: disable=no-name-in-module,import-error
from tests.utils.memory import get_instances # pylint: disable=no-name-in-module,import-error

ArithmeticAddCalculation = CalculationFactory('arithmetic.add')
ArithmeticAddCalculation = CalculationFactory('core.arithmetic.add')


def run_finished_ok(*args, **kwargs):
Expand All @@ -36,7 +36,7 @@ def test_leak_run_process():

def test_leak_local_calcjob(aiida_local_code_factory):
"""Test whether running a local CalcJob leaks memory."""
inputs = {'x': orm.Int(1), 'y': orm.Int(2), 'code': aiida_local_code_factory('arithmetic.add', '/bin/bash')}
inputs = {'x': orm.Int(1), 'y': orm.Int(2), 'code': aiida_local_code_factory('core.arithmetic.add', '/bin/bash')}
run_finished_ok(ArithmeticAddCalculation, **inputs)

# check that no reference to the process is left in memory
Expand All @@ -51,7 +51,7 @@ def test_leak_ssh_calcjob():
Note: This relies on the 'slurm-ssh' computer being set up.
"""
code = orm.Code(
input_plugin_name='arithmetic.add', remote_computer_exec=[orm.load_computer('slurm-ssh'), '/bin/bash']
input_plugin_name='core.arithmetic.add', remote_computer_exec=[orm.load_computer('slurm-ssh'), '/bin/bash']
)
inputs = {'x': orm.Int(1), 'y': orm.Int(2), 'code': code}
run_finished_ok(ArithmeticAddCalculation, **inputs)
Expand Down
2 changes: 1 addition & 1 deletion .github/system_tests/pytest/test_pytest_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ def test_aiida_localhost(aiida_localhost):
def test_aiida_local_code(aiida_local_code_factory):
"""Test aiida_local_code_factory fixture.
"""
code = aiida_local_code_factory(entry_point='templatereplacer', executable='diff')
code = aiida_local_code_factory(entry_point='core.templatereplacer', executable='diff')
assert code.computer.label == 'localhost-test'
36 changes: 22 additions & 14 deletions .github/system_tests/test_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,28 @@
import tempfile
import time

from aiida.common import exceptions, StashMode
from workchains import (
ArithmeticAddBaseWorkChain,
CalcFunctionRunnerWorkChain,
DynamicDbInput,
DynamicMixedInput,
DynamicNonDbInput,
ListEcho,
NestedInputNamespace,
NestedWorkChain,
SerializeWorkChain,
WorkFunctionRunnerWorkChain,
)

from aiida.common import StashMode, exceptions
from aiida.engine import run, submit
from aiida.engine.daemon.client import get_daemon_client
from aiida.engine.persistence import ObjectLoader
from aiida.manage.caching import enable_caching
from aiida.engine.processes import Process
from aiida.orm import CalcJobNode, load_node, Int, Str, List, Dict, load_code
from aiida.manage.caching import enable_caching
from aiida.orm import CalcJobNode, Dict, Int, List, Str, load_code, load_node
from aiida.plugins import CalculationFactory, WorkflowFactory
from aiida.workflows.arithmetic.add_multiply import add_multiply, add
from workchains import (
NestedWorkChain, DynamicNonDbInput, DynamicDbInput, DynamicMixedInput, ListEcho, CalcFunctionRunnerWorkChain,
WorkFunctionRunnerWorkChain, NestedInputNamespace, SerializeWorkChain, ArithmeticAddBaseWorkChain
)

from aiida.workflows.arithmetic.add_multiply import add, add_multiply
from tests.utils.memory import get_instances # pylint: disable=import-error

CODENAME_ADD = 'add@localhost'
Expand Down Expand Up @@ -276,7 +284,7 @@ def create_calculation_process(code, inputval):
"""
Create the process and inputs for a submitting / running a calculation.
"""
TemplatereplacerCalculation = CalculationFactory('templatereplacer')
TemplatereplacerCalculation = CalculationFactory('core.templatereplacer')
parameters = Dict(dict={'value': inputval})
template = Dict(
dict={
Expand All @@ -299,7 +307,7 @@ def create_calculation_process(code, inputval):
},
'max_wallclock_seconds': 5 * 60,
'withmpi': False,
'parser_name': 'templatereplacer.doubler',
'parser_name': 'core.templatereplacer.doubler',
}

expected_result = {'value': 2 * inputval, 'retrieved_temporary_files': {'triple_value.tmp': str(inputval * 3)}}
Expand All @@ -317,7 +325,7 @@ def create_calculation_process(code, inputval):

def run_arithmetic_add():
"""Run the `ArithmeticAddCalculation`."""
ArithmeticAddCalculation = CalculationFactory('arithmetic.add')
ArithmeticAddCalculation = CalculationFactory('core.arithmetic.add')

code = load_code(CODENAME_ADD)
inputs = {
Expand Down Expand Up @@ -377,7 +385,7 @@ def run_base_restart_workchain():

def run_multiply_add_workchain():
"""Run the `MultiplyAddWorkChain`."""
MultiplyAddWorkChain = WorkflowFactory('arithmetic.multiply_add')
MultiplyAddWorkChain = WorkflowFactory('core.arithmetic.multiply_add')

code = load_code(CODENAME_ADD)
inputs = {
Expand Down Expand Up @@ -523,7 +531,7 @@ def relaunch_cached(results):
"""Launch the same calculations but with caching enabled -- these should be FINISHED immediately."""
code_doubler = load_code(CODENAME_DOUBLER)
cached_calcs = []
with enable_caching(identifier='aiida.calculations:templatereplacer'):
with enable_caching(identifier='aiida.calculations:core.templatereplacer'):
for counter in range(1, NUMBER_CALCULATIONS + 1):
inputval = counter
calc, expected_result = run_calculation(code=code_doubler, counter=counter, inputval=inputval)
Expand Down
1 change: 1 addition & 0 deletions .github/system_tests/test_ipython_magics.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
###########################################################################
"""Test the AiiDA iPython magics."""
from IPython.testing.globalipapp import get_ipython

from aiida.tools.ipython.ipython_magics import register_ipython_extension


Expand Down
117 changes: 0 additions & 117 deletions .github/system_tests/test_plugin_testcase.py

This file was deleted.

Loading

0 comments on commit fa28956

Please sign in to comment.