Skip to content

Platform-specific config scopes#2030

Merged
tgamblin merged 2 commits intodevelopfrom
features/platform-specific-config-scopes
Oct 16, 2016
Merged

Platform-specific config scopes#2030
tgamblin merged 2 commits intodevelopfrom
features/platform-specific-config-scopes

Conversation

@tgamblin
Copy link
Copy Markdown
Member

@tgamblin tgamblin commented Oct 15, 2016

Adds the ability to have platform-specific configuration scopes. This allows Spack to know about things like default Blue Gene/Q compiler locations and default modules to load for Cray compilers out of the box. In particular, this helps with #1980 - where we'd like to get @pramodk's settings into the mainline so that users don't have to do much of anything to configure Spack on BG/Q.

The platform config scopes go in subdirectories of a normal Spack config scopes. The precedence looks like this:

  1. defaults, in etc/spack/defaults: default configs that ship with Spack (e.g. packages.yaml)
  2. defaults/bgq, in etc/spack/defaults/bgq: platform-specific overrides of defaults.
  3. site, in etc/spack: spack-instance-specific settings.
  4. site/bgq, in etc/spack/bgq: platform-specific overrides of site settings.
  5. user, in ~/.spack: user-specific settings.
  6. user/bgq, in ~/.spack/bgq: platform-specific overrides of user settings.

All of these are merged the same way the current defaults, site, and user scopes are merged.

@alalazo @adamjstewart @pramodk

@tgamblin
Copy link
Copy Markdown
Member Author

@pramodk: if this works for you, I'll merge it to develop, then you can rebase #1980 and put the various bgq configs in etc/spack/defaults/bgq

@pramodk
Copy link
Copy Markdown
Contributor

pramodk commented Oct 15, 2016

@tgamblin : I am testing this now on bg-q with #1980. I haven't played with site/defaults settings in the past, so correct me if I am missing anything below :

With this PR, spack compilers now creates ~/.spack/bgq/compilers.yaml and populates compilers, looks good:

compilers:
- compiler:
    modules: []
    operating_system: redhat6
    paths:
      cc: /usr/lib64/ccache/gcc
……….
    spec: [email protected]
- compiler:
    modules: []
    operating_system: CNK
    paths:
      cc: /usr/lib64/ccache/gcc
……

I added bg-q specific compiler setting in etc/spack/defaults/bgq/compilers.yaml:

compilers:

- compiler:
    modules: []
    operating_system: CNK
    paths:
      cc: /usr/bin/bgxlc_r
      cxx: /usr/bin/bgxlc++
      f77: /usr/bin/bgxlf_r
      fc: /usr/bin/bgxlf2008
    spec: [email protected]

spack compilers shows xl compiler available, looks good:

==> Available compilers
-- gcc ----------------------------------------------------------
[email protected]  [email protected]

-- xl -----------------------------------------------------------
[email protected]

XL has added for CNK, so below looks goods:

$ spack spec mpich %xl
….
Concretized
------------------------------
  [email protected]%[email protected]+hydra+pmi+romio~verbs arch=bgq-CNK-powerpc

I didn't add XL for front-end but tried below:

$ spack spec mpich %xl os=redhat6

Input spec
------------------------------
  mpich%xl arch=bgq-redhat6-None

Normalized
------------------------------
  mpich%xl arch=bgq-redhat6-None

Concretized
------------------------------
Traceback (most recent call last):
  File "/home/kumbhar/spack/bin/spack", line 192, in <module>
    main()
  File "/home/kumbhar/spack/bin/spack", line 169, in main
    return_val = command(parser, args)
  File "/home/kumbhar/spack/lib/spack/spack/cmd/spec.py", line 57, in spec
    spec.concretize()
  File "/home/kumbhar/spack/lib/spack/spack/spec.py", line 1327, in concretize
    self._concretize_helper())
  File "/home/kumbhar/spack/lib/spack/spack/spec.py", line 1159, in _concretize_helper
    spack.concretizer.concretize_compiler(self),
  File "/home/kumbhar/spack/lib/spack/spack/concretize.py", line 385, in concretize_compiler
    while not _proper_compiler_style(matches[index], spec.architecture):
IndexError: list index out of range

(once I add correct XL entry for front-end, above error goes away)

@tgamblin
Copy link
Copy Markdown
Member Author

@pramodk: it looks like the configuration works fine. The compiler issue is a separate issue with the concretizer -- that should be fixed but can you file it as a separate issue?

@tgamblin tgamblin merged commit 193f680 into develop Oct 16, 2016
@tgamblin
Copy link
Copy Markdown
Member Author

@pramodk: ok merged; can you rebase #1980?

@tgamblin
Copy link
Copy Markdown
Member Author

I've got a few issues I'm working on (#1992, #1377, #1178) and then I can get on to fixing the various concretization issues.

@pramodk
Copy link
Copy Markdown
Contributor

pramodk commented Oct 16, 2016

rebased #1980.

paulhopkins pushed a commit to paulhopkins/spack that referenced this pull request Oct 24, 2016
* Add platform-specific configuration scopes.

* Update `spack config` to use the new scope arguments.
mpbelhorn added a commit to mpbelhorn/spack that referenced this pull request Oct 25, 2016
Merge spack#2030 added a cyclic dependency between the Cray platform needing
to read a `targets.yaml` config file and `config.py` needing to get the
platform names.

This commit removes the cyclic dependency in favor of the more general
config scheme. It also removes the now functionless `targets.yaml`
config file. This breaks 'frontend' targets on the Cray platform but
all architecture targets, including the frontend, that are provided by
CrayPE are added to the Platform anyway so users can be explicit about
the architecture targeted by the Cray compiler wrappers:

```
spack spec libelf arch=cray-CNL-frontend
```

becomes

```
spack spec libelf arch=cray-CNL-mc8         # on an XK7 or
spack spec libelf arch=cray-CNL-sandybridge # on an older XC30, etc..
```

The only way the 'frontend' target can be defined after this commit is
through target environment variables.
mpbelhorn added a commit to mpbelhorn/spack that referenced this pull request Oct 25, 2016
Merge spack#2030 added a cyclic dependency between the Cray platform needing
to read a `targets.yaml` config file and `config.py` needing to get the
platform names.

This commit removes the cyclic dependency in favor of the more general
config scheme. It also removes the now functionless `targets.yaml`
config file. This breaks 'frontend' targets on the Cray platform but
all architecture targets, including the frontend, that are provided by
CrayPE are added to the Platform anyway so users can be explicit about
the architecture targeted by the Cray compiler wrappers:

```
spack spec libelf arch=cray-CNL-frontend
```

becomes

```
spack spec libelf arch=cray-CNL-mc8         # on an XK7 or
spack spec libelf arch=cray-CNL-sandybridge # on an older XC30, etc..
```

The only way the 'frontend' target can be defined after this commit is
through target environment variables.
mpbelhorn added a commit to mpbelhorn/spack that referenced this pull request Oct 28, 2016
Merge spack#2030 added a cyclic dependency between the Cray platform needing
to read a `targets.yaml` config file and `config.py` needing to get the
platform names.

This commit removes the cyclic dependency in favor of the more general
config scheme. It also removes the now functionless `targets.yaml`
config file. This breaks 'frontend' targets on the Cray platform but
all architecture targets, including the frontend, that are provided by
CrayPE are added to the Platform anyway so users can be explicit about
the architecture targeted by the Cray compiler wrappers:

```
spack spec libelf arch=cray-CNL-frontend
```

becomes

```
spack spec libelf arch=cray-CNL-mc8         # on an XK7 or
spack spec libelf arch=cray-CNL-sandybridge # on an older XC30, etc..
```

The only way the 'frontend' target can be defined after this commit is
through target environment variables.
tgamblin pushed a commit that referenced this pull request Oct 31, 2016
Merge #2030 added a cyclic dependency between the Cray platform needing
to read a `targets.yaml` config file and `config.py` needing to get the
platform names.

This commit removes the cyclic dependency in favor of the more general
config scheme. It also removes the now functionless `targets.yaml`
config file. This breaks 'frontend' targets on the Cray platform but
all architecture targets, including the frontend, that are provided by
CrayPE are added to the Platform anyway so users can be explicit about
the architecture targeted by the Cray compiler wrappers:

```
spack spec libelf arch=cray-CNL-frontend
```

becomes

```
spack spec libelf arch=cray-CNL-mc8         # on an XK7 or
spack spec libelf arch=cray-CNL-sandybridge # on an older XC30, etc..
```

The only way the 'frontend' target can be defined after this commit is
through target environment variables.
@tgamblin tgamblin deleted the features/platform-specific-config-scopes branch December 31, 2016 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants