README.md 4.05 KB
Newer Older
Matthieu Dorier's avatar
Matthieu Dorier committed
1 2 3
Platform configurations for Mochi
=================================

Matthieu Dorier's avatar
Matthieu Dorier committed
4 5
This repository provides Spack configuration files, example job scripts, and
notes about building and running Mochi-based codes on various platforms.
Philip Carns's avatar
Philip Carns committed
6 7
Please refer to the subdirectory for your platform of interest for more
information.
Matthieu Dorier's avatar
Matthieu Dorier committed
8 9 10 11 12 13


Using spack.yaml files
----------------------

Each platform subdirectory in this repository provides a `spack.yaml` file.
Philip Carns's avatar
Philip Carns committed
14 15 16 17 18
A `spack.yaml` file fully describes a Spack environment, including
system-provided packages and compilers. It does so independently of any
`compilers.yaml` or `packages.yaml` files installed in `~/.spack`, thereby
preventing interference with user-specific spack configurations as much as
possible.
Matthieu Dorier's avatar
Matthieu Dorier committed
19 20

You may use `spack.yaml` files to create a
Philip Carns's avatar
Philip Carns committed
21 22
[Spack environment](https://spack.readthedocs.io/en/latest/environments.html)
in which Mochi packages will be installed.
Matthieu Dorier's avatar
Matthieu Dorier committed
23

Philip Carns's avatar
Philip Carns committed
24 25
If you don't have Spack installed on your platform, clone it and set it up
as follows.
Matthieu Dorier's avatar
Matthieu Dorier committed
26 27 28 29 30 31

```
$ git clone https://github.com/spack/spack.git
$ . spack/share/spack/setup-env.sh
```

Matthieu Dorier's avatar
Matthieu Dorier committed
32
Remember that the second line needs to be executed every time you open a new
Philip Carns's avatar
Philip Carns committed
33 34
terminal; it may be helpful to create an alias in your bashrc file as a
shortcut.
Matthieu Dorier's avatar
Matthieu Dorier committed
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60

You will then need to clone `sds-repo`, which contains the Mochi packages.

```
$ git clone https://xgitlab.cels.anl.gov/sds/sds-repo.git
$ spack repo add sds-repo
```

Now clone the present repository and `cd` into the subdirectory relevant
to your platform. For example:

```
$ git clone https://xgitlab.cels.anl.gov/sds/experiments/platform-configurations.git
$ cd platform-configurations/ANL/Bebop
```

Edit the path to `sds-repo` in the `repos` field of the `spack.yaml` file to
match your installation.

Then, execute the following command
(changing _myenv_ into an appropriate name for your environment).

```
$ spack env create myenv spack.yaml
```

Philip Carns's avatar
Philip Carns committed
61
Change to a directory outside of the `platform-configurations` folders
Matthieu Dorier's avatar
Matthieu Dorier committed
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
and activate the environment as follows.

```
$ spack env activate myenv
```

You may now add specs to your environment. For instance if you want
to install Margo, execute the following command.

```
$ spack add mochi-margo
```

If the `spack.yaml` file provides multiple compilers and you want
to use another than the default one, specify the compiler explicitely,
for example:

```
$ spack add mochi-margo %gcc@8.2.0
```

Note that the `spack.yaml` file you used may already have a spec
added as an example (usually `mochi-margo`). You can remove it as
follows.

```
$ spack rm mochi-margo
```

Once you have added the specs you need in your environment, install
everything by executing the following command.

```
$ spack install
```

You may add more specs later on. For more information on how to manage
Spack environments, please refer to the Spack documentation.


Contributing to this repository
-------------------------------

Should you want to contribute a `spack.yaml` for a particular machine,
please submit a merge request with it, and ensure the following.

*  The `spack.yaml` file should contain the compiler(s) that have been tested
Philip Carns's avatar
Philip Carns committed
109
   and confirmed to work with Mochi packages.
Matthieu Dorier's avatar
Matthieu Dorier committed
110 111 112
*  The `spack.yaml` file should try to list system-provided packages,
   in particular packages used for building (`cmake`, `autoconf`, etc.),
   and relevant system-provided MPI implementations.
Philip Carns's avatar
Philip Carns committed
113 114 115
   - Note that this must be done manually.  Spack provides a `spack external
     find` command that can be used to locate a subset of system packages,
     but it does not populate the `spack.yaml` file.
Matthieu Dorier's avatar
Matthieu Dorier committed
116 117 118 119 120 121 122 123 124 125
*  The `spack.yaml` file should contain the relevant variants for packages,
   in particular the transport methods to use with `libfabric`.
*  The path to the `spack.yaml` file should be of the form
   `<institution>/<platform>/spack.yaml`.
*  Please make sure that your `spack.yaml` is a reliable way to work with
   Mochi on the target platform, other people will rely on it!

You can also contribute changes to existing `spack.yaml` files, in particular
to add working compilers, system packages, etc. As always, please test that
new setups work before creating a merge request.