Skip to content

Commit 7bc07d7

Browse files
author
Vasileios Karakasis
authored
Merge pull request #1110 from vkarak/bugfix/environment-config
[bugfix] Remove `type` key from the environment configuration
2 parents 73659c0 + 4b80f23 commit 7bc07d7

File tree

8 files changed

+23
-149
lines changed

8 files changed

+23
-149
lines changed

config/cscs-ci.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,34 +82,28 @@ class ReframeSettings:
8282
'environments': {
8383
'*': {
8484
'PrgEnv-cray': {
85-
'type': 'ProgEnvironment',
8685
'modules': ['PrgEnv-cray'],
8786
},
8887

8988
'PrgEnv-gnu': {
90-
'type': 'ProgEnvironment',
9189
'modules': ['PrgEnv-gnu'],
9290
},
9391

9492
'PrgEnv-intel': {
95-
'type': 'ProgEnvironment',
9693
'modules': ['PrgEnv-intel'],
9794
},
9895

9996
'PrgEnv-pgi': {
100-
'type': 'ProgEnvironment',
10197
'modules': ['PrgEnv-pgi'],
10298
},
10399

104100
'builtin': {
105-
'type': 'ProgEnvironment',
106101
'cc': 'cc',
107102
'cxx': '',
108103
'ftn': '',
109104
},
110105

111106
'builtin-gcc': {
112-
'type': 'ProgEnvironment',
113107
'cc': 'gcc',
114108
'cxx': 'g++',
115109
'ftn': 'gfortran',

config/cscs-pbs.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,34 +65,28 @@ class ReframeSettings:
6565
'environments': {
6666
'*': {
6767
'PrgEnv-cray': {
68-
'type': 'ProgEnvironment',
6968
'modules': ['PrgEnv-cray'],
7069
},
7170

7271
'PrgEnv-gnu': {
73-
'type': 'ProgEnvironment',
7472
'modules': ['PrgEnv-gnu'],
7573
},
7674

7775
'PrgEnv-intel': {
78-
'type': 'ProgEnvironment',
7976
'modules': ['PrgEnv-intel'],
8077
},
8178

8279
'PrgEnv-pgi': {
83-
'type': 'ProgEnvironment',
8480
'modules': ['PrgEnv-pgi'],
8581
},
8682

8783
'builtin': {
88-
'type': 'ProgEnvironment',
8984
'cc': 'cc',
9085
'cxx': '',
9186
'ftn': '',
9287
},
9388

9489
'builtin-gcc': {
95-
'type': 'ProgEnvironment',
9690
'cc': 'gcc',
9791
'cxx': 'g++',
9892
'ftn': 'gfortran',

config/cscs.py

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -299,52 +299,6 @@ class ReframeSettings:
299299
}
300300
},
301301

302-
'leone': {
303-
'descr': 'Leone',
304-
'hostnames': ['leone'],
305-
'modules_system': 'tmod',
306-
'resourcesdir': '/apps/common/UES/reframe/resources',
307-
'partitions': {
308-
'login': {
309-
'scheduler': 'local',
310-
'environs': ['PrgEnv-gnu'],
311-
'descr': 'Leone login nodes',
312-
'max_jobs': 1
313-
},
314-
315-
'normal': {
316-
'scheduler': 'nativeslurm',
317-
'environs': ['PrgEnv-gnu'],
318-
'descr': ('Leone compute nodes - '
319-
'default partition'),
320-
'max_jobs': 10
321-
},
322-
}
323-
},
324-
325-
'monch': {
326-
'descr': 'Monch PASC',
327-
'hostnames': ['monch'],
328-
'modules_system': 'tmod',
329-
'resourcesdir': '/apps/common/UES/reframe/resources',
330-
'partitions': {
331-
'login': {
332-
'scheduler': 'local',
333-
'environs': ['PrgEnv-gnu'],
334-
'descr': 'Monch login nodes',
335-
'max_jobs': 1
336-
},
337-
338-
'compute': {
339-
'scheduler': 'slurm+mpirun',
340-
'access': ['--partition=compute'],
341-
'environs': ['PrgEnv-gnu'],
342-
'descr': 'Monch compute nodes',
343-
'max_jobs': 10
344-
}
345-
}
346-
},
347-
348302
'generic': {
349303
'descr': 'Generic example system',
350304
'partitions': {
@@ -363,21 +317,18 @@ class ReframeSettings:
363317

364318
'ault': {
365319
'PrgEnv-gnu': {
366-
'type': 'ProgEnvironment',
367320
# defaults were gcc/8.3.0, cuda/10.1, openmpi/4.0.0
368321
'modules': ['gcc', 'cuda/10.1', 'openmpi'],
369322
'cc': 'mpicc',
370323
'cxx': 'mpicxx',
371324
'ftn': 'mpif90',
372325
},
373326
'builtin': {
374-
'type': 'ProgEnvironment',
375327
'cc': 'cc',
376328
'cxx': '',
377329
'ftn': '',
378330
},
379331
'builtin-gcc': {
380-
'type': 'ProgEnvironment',
381332
'cc': 'gcc',
382333
'cxx': 'g++',
383334
'ftn': 'gfortran',
@@ -386,15 +337,13 @@ class ReframeSettings:
386337

387338
'kesch': {
388339
'PrgEnv-pgi-nompi': {
389-
'type': 'ProgEnvironment',
390340
'modules': ['PE/17.06',
391341
'PrgEnv-pgi/18.5'],
392342
'cc': 'pgcc',
393343
'cxx': 'pgc++',
394344
'ftn': 'pgf90',
395345
},
396346
'PrgEnv-pgi': {
397-
'type': 'ProgEnvironment',
398347
'modules': [
399348
'PE/17.06', 'pgi/18.5-gcc-5.4.0-2.26',
400349
'openmpi/4.0.1-pgi-18.5-gcc-5.4.0-2.26-cuda-8.0'
@@ -404,17 +353,14 @@ class ReframeSettings:
404353
'ftn': 'mpifort',
405354
},
406355
'PrgEnv-cray': {
407-
'type': 'ProgEnvironment',
408356
'modules': ['PE/17.06',
409357
'PrgEnv-CrayCCE/17.06'],
410358
},
411359
'PrgEnv-cray-nompi': {
412-
'type': 'ProgEnvironment',
413360
'modules': ['PE/17.06',
414361
'PrgEnv-cray'],
415362
},
416363
'PrgEnv-gnu': {
417-
'type': 'ProgEnvironment',
418364
'modules': ['PE/17.06',
419365
'gmvapich2/17.02_cuda_8.0_gdr'],
420366
'variables': {
@@ -425,49 +371,42 @@ class ReframeSettings:
425371
'ftn': 'mpif90',
426372
},
427373
'PrgEnv-gnu-nompi': {
428-
'type': 'ProgEnvironment',
429374
'modules': ['PE/17.06',
430375
'PrgEnv-gnu'],
431376
'cc': 'gcc',
432377
'cxx': 'g++',
433378
'ftn': 'gfortran',
434379
},
435380
'PrgEnv-cray-c2sm': {
436-
'type': 'ProgEnvironment',
437381
'modules': ['c2sm-rcm/1.00.00-kesch',
438382
'c2sm/cray-env/base'],
439383
},
440384
'PrgEnv-cray-c2sm-gpu': {
441-
'type': 'ProgEnvironment',
442385
'modules': ['c2sm-rcm/1.00.00-kesch',
443386
'c2sm/cray-env/gpu'],
444387
},
445388
'PrgEnv-pgi-c2sm': {
446-
'type': 'ProgEnvironment',
447389
'modules': ['c2sm-rcm/1.00.00-kesch',
448390
'c2sm/pgi-env/base'],
449391
'cc': 'mpicc',
450392
'cxx': 'mpicxx',
451393
'ftn': 'mpif90',
452394
},
453395
'PrgEnv-pgi-c2sm-gpu': {
454-
'type': 'ProgEnvironment',
455396
'modules': ['c2sm-rcm/1.00.00-kesch',
456397
'c2sm/pgi-env/gpu'],
457398
'cc': 'mpicc',
458399
'cxx': 'mpicxx',
459400
'ftn': 'mpif90',
460401
},
461402
'PrgEnv-gnu-c2sm': {
462-
'type': 'ProgEnvironment',
463403
'modules': ['c2sm-rcm/1.00.00-kesch',
464404
'c2sm/gnu-env/base'],
465405
'cc': 'mpicc',
466406
'cxx': 'mpicxx',
467407
'ftn': 'mpif90',
468408
},
469409
'PrgEnv-gnu-c2sm-gpu': {
470-
'type': 'ProgEnvironment',
471410
'modules': ['c2sm-rcm/1.00.00-kesch',
472411
'c2sm/gnu-env/gpu'],
473412
'cc': 'mpicc',
@@ -476,61 +415,34 @@ class ReframeSettings:
476415
},
477416
},
478417

479-
'leone': {
480-
'PrgEnv-gnu': {
481-
'type': 'ProgEnvironment',
482-
'modules': ['PrgEnv-gnu/leone-foss-2016b'],
483-
'cc': 'mpicc',
484-
'cxx': 'mpicxx',
485-
'ftn': 'mpif90',
486-
},
487-
},
488-
489-
'monch': {
490-
'PrgEnv-gnu': {
491-
'type': 'ProgEnvironment',
492-
'modules': ['PrgEnv-gnu'],
493-
'cc': 'mpicc',
494-
'cxx': 'mpicxx',
495-
'ftn': 'mpif90',
496-
}
497-
},
498-
499418
'*': {
500419
'PrgEnv-cray': {
501-
'type': 'ProgEnvironment',
502420
'modules': ['PrgEnv-cray'],
503421
},
504422

505423
'PrgEnv-cray_classic': {
506-
'type': 'ProgEnvironment',
507424
'modules': ['PrgEnv-cray', 'cce/9.0.2-classic'],
508425
},
509426

510427
'PrgEnv-gnu': {
511-
'type': 'ProgEnvironment',
512428
'modules': ['PrgEnv-gnu'],
513429
},
514430

515431
'PrgEnv-intel': {
516-
'type': 'ProgEnvironment',
517432
'modules': ['PrgEnv-intel'],
518433
},
519434

520435
'PrgEnv-pgi': {
521-
'type': 'ProgEnvironment',
522436
'modules': ['PrgEnv-pgi'],
523437
},
524438

525439
'builtin': {
526-
'type': 'ProgEnvironment',
527440
'cc': 'cc',
528441
'cxx': '',
529442
'ftn': '',
530443
},
531444

532445
'builtin-gcc': {
533-
'type': 'ProgEnvironment',
534446
'cc': 'gcc',
535447
'cxx': 'g++',
536448
'ftn': 'gfortran',

docs/configure.rst

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,18 @@ The following example shows a minimal configuration for the `Piz Daint <https://
7373
'environments': {
7474
'*': {
7575
'PrgEnv-cray': {
76-
'type': 'ProgEnvironment',
7776
'modules': ['PrgEnv-cray'],
7877
},
7978
8079
'PrgEnv-gnu': {
81-
'type': 'ProgEnvironment',
8280
'modules': ['PrgEnv-gnu'],
8381
},
8482
8583
'PrgEnv-intel': {
86-
'type': 'ProgEnvironment',
8784
'modules': ['PrgEnv-intel'],
8885
},
8986
9087
'PrgEnv-pgi': {
91-
'type': 'ProgEnvironment',
9288
'modules': ['PrgEnv-pgi'],
9389
}
9490
}
@@ -343,7 +339,6 @@ In the following example, we redefine ``PrgEnv-gnu`` for a system named ``foo``,
343339
344340
'foo': {
345341
'PrgEnv-gnu': {
346-
'type': 'ProgEnvironment',
347342
'modules': ['PrgEnv-gnu', 'openmpi'],
348343
'cc': 'mpicc',
349344
'cxx': 'mpicxx',
@@ -354,27 +349,27 @@ In the following example, we redefine ``PrgEnv-gnu`` for a system named ``foo``,
354349
An environment is also defined as a set of key/value pairs with the key being its name and the value being a dictionary of its attributes.
355350
The possible attributes of an environment are the following:
356351

357-
* ``type``: The type of the environment to create. There are two available environment types (note that names are case sensitive):
358-
359-
* ``'Environment'``: A simple environment.
360-
* ``'ProgEnvironment'``: A programming environment.
361-
362352
* ``modules``: A list of modules to be loaded when this environment is used (default ``[]``, valid for all environment types)
363353
* ``variables``: A set of variables to be set when this environment is used (default ``{}``, valid for all environment types)
364-
* ``cc``: The C compiler (default ``'cc'``, valid for ``'ProgEnvironment'`` only).
365-
* ``cxx``: The C++ compiler (default ``'CC'``, valid for ``'ProgEnvironment'`` only).
366-
* ``ftn``: The Fortran compiler (default ``'ftn'``, valid for ``'ProgEnvironment'`` only).
367-
* ``cppflags``: The default preprocessor flags (default :class:`None`, valid for ``'ProgEnvironment'`` only).
368-
* ``cflags``: The default C compiler flags (default :class:`None`, valid for ``'ProgEnvironment'`` only).
369-
* ``cxxflags``: The default C++ compiler flags (default :class:`None`, valid for ``'ProgEnvironment'`` only).
370-
* ``fflags``: The default Fortran compiler flags (default :class:`None`, valid for ``'ProgEnvironment'`` only).
371-
* ``ldflags``: The default linker flags (default :class:`None`, valid for ``'ProgEnvironment'`` only).
354+
* ``cc``: The C compiler (default: ``'cc'``)
355+
* ``cxx``: The C++ compiler (default: ``'CC'``)
356+
* ``ftn``: The Fortran compiler (default: ``'ftn'``)
357+
* ``cppflags``: The default preprocessor flags (default: :class:`None`)
358+
* ``cflags``: The default C compiler flags (default: :class:`None`)
359+
* ``cxxflags``: The default C++ compiler flags (default: :class:`None`)
360+
* ``fflags``: The default Fortran compiler flags (default: :class:`None`)
361+
* ``ldflags``: The default linker flags (default: :class:`None`)
372362

373363
.. note::
374364
All flags for programming environments are now defined as list of strings instead of simple strings.
375365

376366
.. versionchanged:: 2.17
377367

368+
.. note::
369+
The ``type`` key is no more required for the environment configuration.
370+
371+
.. versionchanged:: 2.22
372+
378373

379374
System Auto-Detection
380375
---------------------
@@ -406,7 +401,6 @@ If the system cannot be auto-detected, ReFrame will issue a warning and fall bac
406401
'environments': {
407402
'*': {
408403
'builtin-gcc': {
409-
'type': 'ProgEnvironment',
410404
'cc': 'gcc',
411405
'cxx': 'g++',
412406
'ftn': 'gfortran',

reframe/core/config.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import collections.abc
2+
import re
23

34
import reframe.core.debug as debug
45
import reframe.core.fields as fields
@@ -115,12 +116,7 @@ def create_env(system, partition, name):
115116
if not isinstance(config, collections.abc.Mapping):
116117
raise TypeError("config for `%s' is not a dictionary" % name)
117118

118-
try:
119-
envtype = m_env.__dict__[config['type']]
120-
return envtype(name, **config)
121-
except KeyError:
122-
raise ConfigError("no type specified for environment `%s'" %
123-
name) from None
119+
return m_env.ProgEnvironment(name, **config)
124120

125121
# Populate the systems directory
126122
for sys_name, config in sysconfig.items():

0 commit comments

Comments
 (0)