diff --git a/config/aws_citc.py b/config/aws_citc.py index 0fc085ee..02d2a47b 100644 --- a/config/aws_citc.py +++ b/config/aws_citc.py @@ -12,9 +12,10 @@ import os -from eessi.testsuite.common_config import common_logging_config, common_eessi_init +from eessi.testsuite.common_config import common_eessi_init, common_logging_config, set_common_required_config from eessi.testsuite.constants import FEATURES + # This config will write all staging, output and logging to subdirs under this prefix # Override with RFM_PREFIX environment variable reframe_prefix = os.path.join(os.environ['HOME'], 'reframe_runs') @@ -33,178 +34,80 @@ 'name': 'x86_64-haswell-8c-15gb', 'access': ['--constraint=shape=c4.2xlarge', '--export=NONE'], 'descr': 'Haswell, 8 cores, 15 GiB', - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], }, { 'name': 'x86_64-haswell-16c-30gb', 'access': ['--constraint=shape=c4.4xlarge', '--export=NONE'], 'descr': 'Haswell, 16 cores, 30 GiB', - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], }, { 'name': 'x86_64-zen2-8c-16gb', 'access': ['--constraint=shape=c5a.2xlarge', '--export=NONE'], 'descr': 'Zen2, 8 cores, 16 GiB', - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], }, { 'name': 'x86_64-zen2-16c-32gb', 'access': ['--constraint=shape=c5a.4xlarge', '--export=NONE'], 'descr': 'Zen2, 16 cores, 32 GiB', - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], }, { 'name': 'x86_64-zen3-8c-16gb', 'access': ['--constraint=shape=c6a.2xlarge', '--export=NONE'], 'descr': 'Zen3, 8 cores, 16 GiB', - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], }, { 'name': 'X86_64-zen3-16c-32gb', 'access': ['--constraint=shape=c6a.4xlarge', '--export=NONE'], 'descr': 'Zen3, 16 cores, 32 GiB', - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], }, { 'name': 'x86_64-skylake-cascadelake-8c-16gb', 'access': ['--constraint=shape=c5.2xlarge', '--export=NONE'], 'descr': 'Skylake/Cascade lake, 8 cores, 16 GiB', - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], }, { 'name': 'x86_64-skylake-cascadelake-16c-32gb', 'access': ['--constraint=shape=c5.4xlarge', '--export=NONE'], 'descr': 'Skylake/Cascade lake, 16 cores, 32 GiB', - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], }, { 'name': 'x86_64-skylake-cascadelake-8c-16gb-nvme', 'access': ['--constraint=shape=c5d.2xlarge', '--export=NONE'], 'descr': 'Skylake/Cascade lake, 8 cores, 16 GiB, 200GB NVMe', - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], }, { 'name': 'x86_64-icelake-8c-16gb', 'access': ['--constraint=shape=c6i.2xlarge', '--export=NONE'], 'descr': 'Icelake, 8 cores, 16 GiB', - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], }, { 'name': 'aarch64-graviton2-8c-16gb', 'access': ['--constraint=shape=c6g.2xlarge', '--export=NONE'], 'descr': 'Graviton2, 8 cores, 16 GiB', - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], }, { 'name': 'aarch64-graviton2-16c-32gb', 'access': ['--constraint=shape=c6g.4xlarge', '--export=NONE'], 'descr': 'Graviton2, 16 cores, 32 GiB', - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], }, { 'name': 'aarch64-graviton2-32c-64gb', 'access': ['--constraint=shape=c6g.8xlarge', '--export=NONE'], 'descr': 'Graviton2, 32 cores, 64 GiB', - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], }, { 'name': 'aarch64-graviton3-8c-16gb', 'access': ['--constraint=shape=c7g.2xlarge', '--export=NONE'], 'descr': 'Graviton3, 8 cores, 16 GiB', - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], }, { 'name': 'aarch64-graviton3-16c-32gb', 'access': ['--constraint=shape=c7g.4xlarge', '--export=NONE'], 'descr': 'Graviton3, 16 cores, 32 GiB', - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], }, ] }, ], - 'environments': [ - { - 'name': 'default', - 'cc': 'cc', - 'cxx': '', - 'ftn': '', - }, - ], 'logging': common_logging_config(reframe_prefix), 'general': [ { @@ -219,7 +122,6 @@ partition_defaults = { 'scheduler': 'squeue', 'launcher': 'mpirun', - 'environs': ['default'], 'features': [ FEATURES.CPU ], @@ -233,3 +135,6 @@ for system in site_configuration['systems']: for partition in system['partitions']: partition.update(partition_defaults) + +# Set common Slurm config options +set_common_required_config(site_configuration) diff --git a/config/aws_mc.py b/config/aws_mc.py index 62643a52..de7c30ae 100644 --- a/config/aws_mc.py +++ b/config/aws_mc.py @@ -12,7 +12,8 @@ import os -from eessi.testsuite.common_config import common_logging_config, common_general_config, common_eessi_init +from eessi.testsuite.common_config import (common_eessi_init, common_general_config, common_logging_config, + set_common_required_config) from eessi.testsuite.constants import EXTRAS, FEATURES, SCALES # This config will write all staging, output and logging to subdirs under this prefix @@ -72,14 +73,6 @@ ] }, ], - 'environments': [ - { - 'name': 'default', - 'cc': 'cc', - 'cxx': '', - 'ftn': '', - }, - ], 'logging': common_logging_config(reframe_prefix), 'general': [ { @@ -95,7 +88,6 @@ partition_defaults = { 'scheduler': 'slurm', 'launcher': 'mpirun', - 'environs': ['default'], 'features': [ FEATURES.CPU ] + list(SCALES.keys()), @@ -105,12 +97,6 @@ # steps inherit environment. It doesn't hurt to define this even if srun is not used 'export SLURM_EXPORT_ENV=ALL' ], - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], 'extras': { # Node types have somewhat varying amounts of memory, but we'll make it easy on ourselves # All should _at least_ have this amount (30GB * 1E9 / (1024*1024) = 28610 MiB) @@ -121,3 +107,6 @@ for system in site_configuration['systems']: for partition in system['partitions']: partition.update(partition_defaults) + +# Set common Slurm config options +set_common_required_config(site_configuration) diff --git a/config/azure_mc.py b/config/azure_mc.py index 6ddfd416..9a712110 100644 --- a/config/azure_mc.py +++ b/config/azure_mc.py @@ -12,7 +12,8 @@ import os -from eessi.testsuite.common_config import common_logging_config, common_general_config, common_eessi_init +from eessi.testsuite.common_config import (common_eessi_init, common_general_config, common_logging_config, + set_common_required_config) from eessi.testsuite.constants import EXTRAS, FEATURES, SCALES # This config will write all staging, output and logging to subdirs under this prefix @@ -73,14 +74,6 @@ ] }, ], - 'environments': [ - { - 'name': 'default', - 'cc': 'cc', - 'cxx': '', - 'ftn': '', - }, - ], 'logging': common_logging_config(reframe_prefix), 'general': [ { @@ -96,18 +89,14 @@ partition_defaults = { 'scheduler': 'slurm', 'launcher': 'mpirun', - 'environs': ['default'], 'features': [ FEATURES.CPU ] + list(SCALES.keys()), - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], 'max_jobs': 1, } for system in site_configuration['systems']: for partition in system['partitions']: partition.update(partition_defaults) + +# Set common Slurm config options +set_common_required_config(site_configuration) diff --git a/config/bsc_marenostrum5.py b/config/bsc_marenostrum5.py index d512f657..f8bb68e5 100644 --- a/config/bsc_marenostrum5.py +++ b/config/bsc_marenostrum5.py @@ -1,10 +1,8 @@ import os -from eessi.testsuite.common_config import (common_logging_config, - common_general_config, - common_eessi_init, - get_sbatch_account) -from eessi.testsuite.constants import * +from eessi.testsuite.common_config import (common_eessi_init, common_general_config, common_logging_config, + get_sbatch_account, set_common_required_config) +from eessi.testsuite.constants import DEVICE_TYPES, EXTRAS, FEATURES, GPU_VENDORS, SCALES # Note that we rely on the SBATCH_ACCOUNT environment variable to be specified # From ReFrame 4.8.1 we can no longer rely on SBATCH_ACCOUNT completely @@ -41,12 +39,7 @@ 'export OMPI_MCA_mtl="^ofi"', 'export OMPI_MCA_btl="^ofi"', ], - 'environs': ['default'], 'max_jobs': 4, - 'resources': [ - # memory cannot be set on MareNostrum - # The test-suite will give warning which can be ignored - ], # list(SCALES.keys()) adds all the scales from eessi.testsuite.constants as valid for thi partition # Can be modified if not all scales can run on this partition, see e.g. the surf_snellius.py config 'features': [ @@ -76,16 +69,7 @@ 'export OMPI_MCA_mtl="^ofi"', 'export OMPI_MCA_btl="^ofi"', ], - 'environs': ['default'], 'max_jobs': 4, - 'resources': [ - { - 'name': '_rfm_gpu', - 'options': ['--gpus-per-node={num_gpus_per_node}'], - }, - # memory cannot be set on MareNostrum - # The test-suite will give warning which can be ignored - ], 'devices': [ { 'type': DEVICE_TYPES.GPU, @@ -106,14 +90,6 @@ ] }, ], - 'environments': [ - { - 'name': 'default', - 'cc': 'cc', - 'cxx': '', - 'ftn': '', - }, - ], 'logging': common_logging_config(), 'general': [ { @@ -124,3 +100,8 @@ } ], } + +# Set common Slurm config options +# memory cannot be set on MareNostrum +# The test-suite will give warning which can be ignored +set_common_required_config(site_configuration, set_memory=False) diff --git a/config/github_actions.py b/config/github_actions.py index 390a54c4..adb92e3e 100644 --- a/config/github_actions.py +++ b/config/github_actions.py @@ -1,7 +1,7 @@ # ReFrame configuration file that can be used in GitHub Actions with EESSI -from eessi.testsuite.common_config import common_logging_config -from eessi.testsuite.constants import * +from eessi.testsuite.common_config import common_logging_config, set_common_required_config +from eessi.testsuite.constants import EXTRAS, FEATURES, SCALES site_configuration = { @@ -22,12 +22,6 @@ 'num_cpus': 2, 'num_cpus_per_core': 1, }, - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], 'max_jobs': 1, 'extras': { # Make sure to round down, otherwise a job might ask for more mem than is available @@ -39,14 +33,6 @@ ] } ], - 'environments': [ - { - 'name': 'default', - 'cc': 'cc', - 'cxx': '', - 'ftn': '' - } - ], 'general': [ { 'purge_environment': True, @@ -55,3 +41,6 @@ ], 'logging': common_logging_config(), } + +# Set common Slurm config options +set_common_required_config(site_configuration) diff --git a/config/it4i_karolina.py b/config/it4i_karolina.py index 03f00837..f0e32204 100644 --- a/config/it4i_karolina.py +++ b/config/it4i_karolina.py @@ -15,11 +15,9 @@ import os -from eessi.testsuite.common_config import (common_eessi_init, - common_general_config, - common_logging_config, - get_sbatch_account) -from eessi.testsuite.constants import * # noqa: F403 +from eessi.testsuite.common_config import (common_eessi_init, common_general_config, common_logging_config, + get_sbatch_account, set_common_required_config) +from eessi.testsuite.constants import EXTRAS, FEATURES, SCALES # This config will write all staging, output and logging to subdirs under this prefix # Override with RFM_PREFIX environment variable @@ -63,17 +61,10 @@ # Use --export=None to avoid that login environment is passed down to submitted jobs # Note that we rely on the SBATCH_ACCOUNT environment variable to be specified 'access': [f'-A {sbatch_account}', '-p qcpu', '--export=None'], - 'environs': ['default'], 'max_jobs': 120, 'features': [ FEATURES.CPU, ] + list(SCALES.keys()), - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], 'extras': { # Make sure to round down, otherwise a job might ask for more mem than is available # per node @@ -99,7 +90,6 @@ # # Use --export=None to avoid that login environment is passed down to submitted jobs # # Note that we rely on the SBATCH_ACCOUNT environment variable to be specified # 'access': ['-p gpu', '--export=None'], - # 'environs': ['default'], # 'max_jobs': 60, # 'devices': [ # { @@ -107,12 +97,6 @@ # 'num_devices': 8, # } # ], - # 'resources': [ - # { - # 'name': '_rfm_gpu', - # 'options': ['--gpus-per-node={num_gpus_per_node}'], - # } - # ], # 'features': [ # FEATURES.GPU, # ] + list(SCALES.keys()), @@ -121,14 +105,6 @@ ] }, ], - 'environments': [ - { - 'name': 'default', - 'cc': 'cc', - 'cxx': '', - 'ftn': '', - }, - ], 'logging': common_logging_config(reframe_prefix), 'general': [ { @@ -139,3 +115,6 @@ } ], } + +# Set common Slurm config options +set_common_required_config(site_configuration) diff --git a/config/izum_vega.py b/config/izum_vega.py index d6911959..09057afd 100644 --- a/config/izum_vega.py +++ b/config/izum_vega.py @@ -15,8 +15,9 @@ import os -from eessi.testsuite.common_config import common_logging_config, common_general_config, common_eessi_init -from eessi.testsuite.constants import * # noqa: F403 +from eessi.testsuite.common_config import (common_eessi_init, common_general_config, common_logging_config, + set_common_required_config) +from eessi.testsuite.constants import EXTRAS, DEVICE_TYPES, FEATURES, GPU_VENDORS, SCALES # This config will write all staging, output and logging to subdirs under this prefix # Override with RFM_PREFIX environment variable @@ -48,14 +49,7 @@ 'launcher': 'mpirun', # Use --export=None to avoid that login environment is passed down to submitted jobs 'access': ['-p cpu', '--export=None'], - 'environs': ['default'], 'max_jobs': 120, - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], 'features': [ FEATURES.CPU, ] + list(SCALES.keys()), @@ -84,7 +78,6 @@ 'launcher': 'mpirun', # Use --export=None to avoid that login environment is passed down to submitted jobs 'access': ['-p gpu', '--export=None'], - 'environs': ['default'], 'max_jobs': 60, 'devices': [ { @@ -92,16 +85,6 @@ 'num_devices': 4, } ], - 'resources': [ - { - 'name': '_rfm_gpu', - 'options': ['--gpus-per-node={num_gpus_per_node}'], - }, - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], 'features': [ FEATURES.GPU, ] + list(SCALES.keys()), @@ -116,14 +99,6 @@ ] }, ], - 'environments': [ - { - 'name': 'default', - 'cc': 'cc', - 'cxx': '', - 'ftn': '', - }, - ], 'logging': common_logging_config(reframe_prefix), 'general': [ { @@ -134,3 +109,6 @@ } ], } + +# Set common Slurm config options +set_common_required_config(site_configuration) diff --git a/config/macc_deucalion.py b/config/macc_deucalion.py index 90d94c90..a81b27f2 100644 --- a/config/macc_deucalion.py +++ b/config/macc_deucalion.py @@ -1,7 +1,8 @@ import os -from eessi.testsuite.common_config import common_logging_config, common_general_config, common_eessi_init -from eessi.testsuite.constants import * # noqa: F403 +from eessi.testsuite.common_config import (common_eessi_init, common_general_config, common_logging_config, + set_common_required_config) +from eessi.testsuite.constants import EXTRAS, FEATURES, SCALES # This config will write all staging, output and logging to subdirs under this prefix # Override with RFM_PREFIX environment variable @@ -32,14 +33,7 @@ 'launcher': 'mpirun', # Use --export=None to avoid that login environment is passed down to submitted jobs 'access': ['-p normal-arm', '--export=None'], - 'environs': ['default'], 'max_jobs': 120, - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], 'features': [ FEATURES.CPU, ] + list(SCALES.keys()), @@ -55,14 +49,6 @@ ] }, ], - 'environments': [ - { - 'name': 'default', - 'cc': 'cc', - 'cxx': '', - 'ftn': '', - }, - ], 'logging': common_logging_config(reframe_prefix), 'general': [ { @@ -73,3 +59,6 @@ } ], } + +# Set common Slurm config options +set_common_required_config(site_configuration) diff --git a/config/settings_example.py b/config/settings_example.py index b9547b00..4057bd67 100644 --- a/config/settings_example.py +++ b/config/settings_example.py @@ -19,7 +19,8 @@ """ import os -from eessi.testsuite.common_config import common_logging_config, common_general_config, common_eessi_init +from eessi.testsuite.common_config import (common_eessi_init, common_general_config, common_logging_config, + set_common_required_config) from eessi.testsuite.constants import EXTRAS, FEATURES, SCALES, DEVICE_TYPES, GPU_VENDORS @@ -44,7 +45,6 @@ # Pass job environment variables like $PATH, etc., into job steps 'export SLURM_EXPORT_ENV=ALL', ], - 'environs': ['default'], 'max_jobs': 4, # We recommend to rely on ReFrame's CPU autodetection, # and only define the 'processor' field if autodetection fails @@ -54,12 +54,6 @@ # 'num_cpus_per_socket': 64, # 'num_cpus_per_core': 1, # }, - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], 'extras': { # If you have slurm, check with scontrol show node for the amount of RealMemory # on nodes in this partition @@ -82,7 +76,6 @@ # Pass job environment variables like $PATH, etc., into job steps 'export SLURM_EXPORT_ENV=ALL', ], - 'environs': ['default'], 'max_jobs': 4, # We recommend to rely on ReFrame's CPU autodetection, # and only define the 'processor' field if autodetection fails @@ -92,16 +85,6 @@ # 'num_cpus_per_socket': 36, # 'num_cpus_per_core': 1, # }, - 'resources': [ - { - 'name': '_rfm_gpu', - 'options': ['--gpus-per-node={num_gpus_per_node}'], - }, - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], 'devices': [ { 'type': DEVICE_TYPES.GPU, @@ -124,14 +107,6 @@ ] }, ], - 'environments': [ - { - 'name': 'default', - 'cc': 'cc', - 'cxx': '', - 'ftn': '', - }, - ], 'logging': common_logging_config(), 'general': [ { @@ -142,3 +117,6 @@ } ], } + +# Set common Slurm config options +set_common_required_config(site_configuration) diff --git a/config/surf_snellius.py b/config/surf_snellius.py index 2bdce9e8..3df247f7 100644 --- a/config/surf_snellius.py +++ b/config/surf_snellius.py @@ -15,8 +15,9 @@ import os -from eessi.testsuite.common_config import common_logging_config, common_general_config, common_eessi_init -from eessi.testsuite.constants import * # noqa: F403 +from eessi.testsuite.common_config import (common_eessi_init, common_general_config, common_logging_config, + set_common_required_config) +from eessi.testsuite.constants import EXTRAS, DEVICE_TYPES, FEATURES, GPU_VENDORS, SCALES # This config will write all staging, output and logging to subdirs under this prefix # Override with RFM_PREFIX environment variable @@ -43,18 +44,8 @@ 'scheduler': 'slurm', 'prepare_cmds': [common_eessi_init()], 'launcher': 'mpirun', - 'sched_options': { - 'use_nodes_option': True, - }, 'access': ['-p rome', '--export=None'], - 'environs': ['default'], 'max_jobs': 120, - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], 'features': [ FEATURES.CPU, ] + list(SCALES.keys()), @@ -75,18 +66,8 @@ common_eessi_init() ], 'launcher': 'mpirun', - 'sched_options': { - 'use_nodes_option': True, - }, 'access': ['-p genoa', '--export=None'], - 'environs': ['default'], 'max_jobs': 120, - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], 'features': [ FEATURES.CPU, ] + list(SCALES.keys()), @@ -102,11 +83,7 @@ 'scheduler': 'slurm', 'prepare_cmds': [common_eessi_init()], 'launcher': 'mpirun', - 'sched_options': { - 'use_nodes_option': True, - }, 'access': ['-p gpu_a100', '--export=None'], - 'environs': ['default'], 'max_jobs': 60, 'devices': [ { @@ -114,16 +91,6 @@ 'num_devices': 4, } ], - 'resources': [ - { - 'name': '_rfm_gpu', - 'options': ['--gpus-per-node={num_gpus_per_node}'], - }, - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], 'features': [ FEATURES.GPU, FEATURES.ALWAYS_REQUEST_GPUS, @@ -141,11 +108,7 @@ 'scheduler': 'slurm', 'prepare_cmds': [common_eessi_init()], 'launcher': 'mpirun', - 'sched_options': { - 'use_nodes_option': True, - }, 'access': ['-p gpu_h100', '--export=None'], - 'environs': ['default'], 'max_jobs': 60, 'devices': [ { @@ -153,16 +116,6 @@ 'num_devices': 4, } ], - 'resources': [ - { - 'name': '_rfm_gpu', - 'options': ['--gpus-per-node={num_gpus_per_node}'], - }, - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], 'features': [ FEATURES.GPU, FEATURES.ALWAYS_REQUEST_GPUS, @@ -179,14 +132,6 @@ ] }, ], - 'environments': [ - { - 'name': 'default', - 'cc': 'cc', - 'cxx': '', - 'ftn': '', - }, - ], 'logging': common_logging_config(reframe_prefix), 'general': [ { @@ -197,3 +142,6 @@ } ], } + +# Set common Slurm config options +set_common_required_config(site_configuration) diff --git a/config/vsc_hortense.py b/config/vsc_hortense.py index 42fcfaf6..877a4da5 100644 --- a/config/vsc_hortense.py +++ b/config/vsc_hortense.py @@ -22,11 +22,9 @@ # ``` import os -from eessi.testsuite.common_config import (common_eessi_init, - common_general_config, - common_logging_config, - get_sbatch_account) -from eessi.testsuite.constants import * # noqa: F403 +from eessi.testsuite.common_config import (common_eessi_init, common_general_config, common_logging_config, + get_sbatch_account, set_common_required_config) +from eessi.testsuite.constants import EXTRAS, DEVICE_TYPES, FEATURES, GPU_VENDORS, SCALES hortense_access = ['--export=NONE', '--get-user-env=60L'] @@ -79,17 +77,10 @@ 'sched_options': { 'sched_access_in_submit': True, }, - 'environs': ['default'], 'descr': 'CPU nodes (AMD Rome, 256GiB RAM)', 'max_jobs': 20, 'launcher': launcher, 'modules': [mpi_module.format('cpu_rome')], - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], 'features': [ FEATURES.CPU, ] + list(SCALES.keys()), @@ -112,17 +103,10 @@ 'sched_options': { 'sched_access_in_submit': True, }, - 'environs': ['default'], 'descr': 'CPU nodes (AMD Rome, 512GiB RAM)', 'max_jobs': 20, 'launcher': launcher, 'modules': [mpi_module.format('cpu_rome_512')], - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], 'features': [ FEATURES.CPU, ] + list(SCALES.keys()), @@ -145,17 +129,10 @@ 'sched_options': { 'sched_access_in_submit': True, }, - 'environs': ['default'], 'descr': 'CPU nodes (AMD Milan, 256GiB RAM)', 'max_jobs': 20, 'launcher': launcher, 'modules': [mpi_module.format('cpu_milan_rhel9')], - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], 'features': [ FEATURES.CPU, ] + list(SCALES.keys()), @@ -178,17 +155,10 @@ 'sched_options': { 'sched_access_in_submit': True, }, - 'environs': ['default'], 'descr': 'CPU nodes (AMD Milan, 256GiB RAM)', 'max_jobs': 20, 'launcher': launcher, 'modules': [mpi_module.format('cpu_milan_rhel9')], - 'resources': [ - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], 'features': [ FEATURES.CPU, ] + list(SCALES.keys()), @@ -211,7 +181,6 @@ 'sched_options': { 'sched_access_in_submit': True, }, - 'environs': ['default'], 'descr': 'GPU nodes (A100 40GB)', 'max_jobs': 20, 'launcher': launcher, @@ -225,16 +194,6 @@ # per node EXTRAS.MEM_PER_NODE: 243840, # in MiB }, - 'resources': [ - { - 'name': '_rfm_gpu', - 'options': ['--gpus-per-node={num_gpus_per_node}'], - }, - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], 'devices': [ { 'type': DEVICE_TYPES.GPU, @@ -256,7 +215,6 @@ 'sched_options': { 'sched_access_in_submit': True, }, - 'environs': ['default'], 'descr': 'GPU nodes (A100 80GB)', 'max_jobs': 20, 'launcher': launcher, @@ -270,16 +228,6 @@ # per node EXTRAS.MEM_PER_NODE: 499680, # in MiB }, - 'resources': [ - { - 'name': '_rfm_gpu', - 'options': ['--gpus-per-node={num_gpus_per_node}'], - }, - { - 'name': 'memory', - 'options': ['--mem={size}'], - } - ], 'devices': [ { 'type': DEVICE_TYPES.GPU, @@ -291,34 +239,6 @@ ] }, ], - 'environments': [ - { - 'name': 'default', - 'cc': 'gcc', - 'cxx': 'g++', - 'ftn': 'gfortran', - }, - { - 'name': 'foss-2021a', - 'cc': 'mpicc', - 'cxx': 'mpicxx', - 'ftn': 'mpif90', - 'modules': ['foss/2021a'] - }, - { - 'name': 'intel-2021a', - 'modules': ['intel'], - 'cc': 'mpiicc', - 'cxx': 'mpiicpc', - 'ftn': 'mpiifort', - }, - { - 'name': 'CUDA', - 'modules': ['CUDA'], - 'cc': 'nvcc', - 'cxx': 'nvcc', - }, - ], 'general': [ { 'remote_detect': True, @@ -329,3 +249,6 @@ ], 'logging': common_logging_config(), } + +# Set common Slurm config options +set_common_required_config(site_configuration) diff --git a/eessi/testsuite/common_config.py b/eessi/testsuite/common_config.py index 2989b85d..16926e11 100644 --- a/eessi/testsuite/common_config.py +++ b/eessi/testsuite/common_config.py @@ -1,6 +1,9 @@ +import json import os -import reframe.core.logging as rflog +from reframe.core.logging import getlogger + +from eessi.testsuite.constants import FEATURES perflog_format = '|'.join([ '%(check_job_completion_time)s', @@ -32,6 +35,64 @@ ]) +def set_common_required_config(site_configuration, set_memory=True): + """ + Update ReFrame configuration file: set common required config options + This function must be called at the end of the site configuration file (after defining site_configuration) + :param site_configuration: site configuration dictionary + :param set_memory: set memory resources + """ + environments = [{'name': 'default'}] + environs = ['default'] + use_nodes_option = True + resources_memory = [{ + 'name': 'memory', + 'options': ['--mem={size}'], + }] + resources_gpu = [{ + 'name': '_rfm_gpu', + 'options': ['--gpus-per-node={num_gpus_per_node}'], + }] + + if site_configuration.get('environments') and site_configuration['environments'] != environments: + getlogger().info(f"Changing environments in site config to {environments}") + site_configuration['environments'] = environments + + for system in site_configuration['systems']: + for partition in system['partitions']: + if partition.get('environs') and partition['environs'] != environs: + getlogger().info( + f"Changing environs in site config to {environs} for {system['name']}:{partition['name']}") + partition['environs'] = environs + if partition['scheduler'] in ['slurm', 'squeue']: + # use --nodes option to ensure the exact number of nodes is requested + if ( + partition.get('sched_options') + and partition['sched_options'].get('use_nodes_option', use_nodes_option) is not use_nodes_option + ): + getlogger().info(' '.join([ + "Changing sched_options['use_nodes_option'] in site config to", + f"{use_nodes_option} for {system['name']}:{partition['name']}", + ])) + if partition.get('sched_options'): + partition['sched_options']['use_nodes_option'] = use_nodes_option + else: + partition['sched_options'] = {'use_nodes_option': use_nodes_option} + if FEATURES.GPU in partition['features']: + resources = resources_memory + resources_gpu + else: + resources = resources_memory + if partition.get('resources'): + orig = {json.dumps(x, sort_keys=True) for x in partition['resources']} + new = {json.dumps(x, sort_keys=True) for x in resources} + if orig != new: + getlogger().info(' '.join([ + f"Changing resources in site config to {resources}", + f"for {system['name']}:{partition['name']}", + ])) + partition['resources'] = resources + + def common_logging_config(prefix=None): """ return default logging configuration as a list: stdout, file log, perflog @@ -74,7 +135,7 @@ def common_logging_config(prefix=None): def common_general_config(prefix=None): """ - return common configuration for the 'general' section of the ReFrame configuration file + Return common configuration for the 'general' section of the ReFrame configuration file :param prefix: prefix for the report_file """ prefix = os.getenv('RFM_PREFIX', prefix if prefix else '.') @@ -98,7 +159,7 @@ def common_eessi_init(eessi_version=None): eessi_cvmfs_repo = os.getenv('EESSI_CVMFS_REPO', None) if eessi_cvmfs_repo is None: - rflog.getlogger().warning(' '.join([ + getlogger().warning(' '.join([ "Environment variable 'EESSI_CVMFS_REPO' is not defined.", "If you plan to use the EESSI software stack,", "make sure to initialize the EESSI environment before running the test suite.",