Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugfix] Do not load environments twice #441

Merged
merged 6 commits into from
Sep 5, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 47 additions & 7 deletions config/cscs.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,10 @@ class ReframeSettings:
'access': ['--partition=cn-regression'],
'environs': ['PrgEnv-gnu', 'PrgEnv-cray',
'PrgEnv-pgi', 'PrgEnv-gnu-gdr',
'PrgEnv-pgi_17.10_gdr', 'PrgEnv-pgi_18.4_gdr',
'PrgEnv-cray_gdr', 'PrgEnv-cray_gdr_2.3'],
'PrgEnv-cray_gdr', 'PrgEnv-cray_gdr_2.3',
'PrgEnv-c2sm-pgi', 'PrgEnv-c2sm-pgi-gpu',
'PrgEnv-c2sm-gnu', 'PrgEnv-c2sm-gnu-gpu',
'PrgEnv-c2sm-cray', 'PrgEnv-c2sm-cray-gpu'],
'descr': 'Kesch compute nodes',
'resources': {
'_rfm_gpu': ['--gres=gpu:{num_gpus_per_node}']
Expand Down Expand Up @@ -205,28 +207,66 @@ class ReframeSettings:
},
'PrgEnv-pgi': {
'type': 'ProgEnvironment',
'modules': ['PrgEnv-pgi/17.10'],
'modules': ['PrgEnv-pgi/17.10_gdr'],
'cc': 'mpicc',
'cxx': 'mpicxx',
'ftn': 'mpif90',
},
'PrgEnv-pgi_17.10_gdr': {
'PrgEnv-c2sm-gnu': {
'type': 'ProgEnvironment',
'modules': ['PrgEnv-pgi/17.10_gdr'],
'modules': ['PrgEnv-gnu', '/apps/common/UES/sandbox/kraushm/c2sm-rcm-env/env', 'c2sm/gnu-env/base'],
'cc': 'mpicc',
'cxx': 'mpicxx',
'ftn': 'mpif90',
},
'PrgEnv-c2sm-gnu-gpu': {
'type': 'ProgEnvironment',
'modules': ['PrgEnv-gnu', '/apps/common/UES/sandbox/kraushm/c2sm-rcm-env/env', 'c2sm/gnu-env/gpu'],
'cc': 'mpicc',
'cxx': 'mpicxx',
'ftn': 'mpif90',
},
'PrgEnv-c2sm-gnu-cpp': {
'type': 'ProgEnvironment',
'modules': ['PrgEnv-gnu', '/apps/common/UES/sandbox/kraushm/c2sm-rcm-env/env', 'c2sm/gnu_for_cpp'],
'cc': 'mpicc',
'cxx': 'mpicxx',
'ftn': 'mpif90',
},
'PrgEnv-c2sm-cray': {
'type': 'ProgEnvironment',
'modules': ['PrgEnv-cray', '/apps/common/UES/sandbox/kraushm/c2sm-rcm-env/env', 'c2sm/cray-env/base'],
'cc': 'cc',
'cxx': 'CC',
'ftn': 'ftn -D__CRAY_FORTRAN_',
},
'PrgEnv-c2sm-cray-gpu': {
'type': 'ProgEnvironment',
'modules': ['PrgEnv-cray', '/apps/common/UES/sandbox/kraushm/c2sm-rcm-env/env', 'c2sm/cray-env/gpu'],
'cc': 'cc',
'cxx': 'CC',
'ftn': 'ftn -D__CRAY_FORTRAN_',
},
'PrgEnv-c2sm-pgi': {
'type': 'ProgEnvironment',
'modules': ['/apps/common/UES/sandbox/kraushm/c2sm-rcm-env/env', 'c2sm/pgi-env/base'],
'cc': 'mpicc',
'cxx': 'mpicxx',
'ftn': 'mpif90',
},
'PrgEnv-pgi_18.4_gdr': {
'PrgEnv-c2sm-pgi-gpu': {
'type': 'ProgEnvironment',
'modules': ['PrgEnv-pgi/18.4_gdr'],
'modules': ['/apps/common/UES/sandbox/kraushm/c2sm-rcm-env/env', 'c2sm/pgi-env/gpu'],
'cc': 'mpicc',
'cxx': 'mpicxx',
'ftn': 'mpif90',
},
'PrgEnv-cray_gdr': {
'type': 'ProgEnvironment',
'modules': ['PrgEnv-cray/1.0.2_gdr'],
'cc': 'cc',
'cxx': 'CC',
'ftn': 'ftn',
},
'PrgEnv-cray_gdr_2.3': {
'type': 'ProgEnvironment',
Expand Down
12 changes: 11 additions & 1 deletion cscs-checks/mch/automatic_arrays.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ def __init__(self, **kwargs):
super().__init__()
self.valid_systems = ['daint:gpu', 'dom:gpu', 'kesch:cn']
self.valid_prog_environs = ['PrgEnv-cray*', 'PrgEnv-pgi*',
'PrgEnv-gnu']
'PrgEnv-gnu',
'PrgEnv-c2sm-pgi', 'PrgEnv-c2sm-cray']
if self.current_system.name in ['daint', 'dom']:
self.modules = ['craype-accel-nvidia60']
self._pgi_flags = '-acc -ta=tesla:cc60 -Mnorpath'
Expand Down Expand Up @@ -60,6 +61,15 @@ def setup(self, partition, environ, **job_opts):
elif environ.name.startswith('PrgEnv-gnu'):
environ.fflags = '-O2'
key = 'PrgEnv-gnu'
elif environ.name.startswith('PrgEnv-c2sm-gnu'):
environ.fflags = '-O2'
key = 'PrgEnv-gnu'
elif environ.name.startswith('PrgEnv-c2sm-pgi'):
environ.fflags = '-O2'
key = 'PrgEnv-pgi'
elif environ.name.startswith('PrgEnv-c2sm-cray'):
environ.fflags = '-O2'
key = 'PrgEnv-cray'

self.reference = self.arrays_reference[key]
super().setup(partition, environ, **job_opts)
4 changes: 3 additions & 1 deletion reframe/core/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import reframe.utility.os_ext as os_ext
from reframe.core.buildsystems import BuildSystem, BuildSystemField
from reframe.core.deferrable import deferrable, _DeferredExpression, evaluate
from reframe.core.environments import Environment
from reframe.core.environments import Environment, EnvironmentSnapshot
from reframe.core.exceptions import (BuildError, PipelineError, SanityError,
user_deprecation_warning)
from reframe.core.launchers.registry import getlauncher
Expand Down Expand Up @@ -761,12 +761,14 @@ def _setup_environ(self, environ):
for k, v in self.variables.items():
self._current_environ.set_variable(k, v)

vkarak marked this conversation as resolved.
Show resolved Hide resolved
environ_save = EnvironmentSnapshot()
# First load the local environment of the partition
self.logger.debug('loading environment for the current partition')
self._current_partition.local_env.load()

self.logger.debug("loading test's environment")
self._current_environ.load()
environ_save.load()

def _setup_paths(self):
"""Setup the check's dynamic paths."""
Expand Down
6 changes: 2 additions & 4 deletions unittests/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,9 @@ def test_environ_setup(self):
test.local = True

test.setup(self.partition, self.progenv)
for m in test.modules:
self.assertTrue(rt.runtime().modules_system.is_module_loaded(m))

for k, v in test.variables.items():
self.assertEqual(os.environ[k], v)
for k in test.variables.keys():
self.assertNotIn(k, os.environ)

# Manually unload the environment
self.progenv.unload()
Expand Down