Skip to content

Commit

Permalink
Minor adjustments, move error to the end of questions
Browse files Browse the repository at this point in the history
  • Loading branch information
alalazo committed Jun 12, 2024
1 parent 092e10b commit a80269a
Showing 1 changed file with 102 additions and 96 deletions.
198 changes: 102 additions & 96 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ <h2>Hands-on</h2>

# Use spack graph to get more insight on DAG structure
# To visualize: https://dreampuf.github.io/GraphvizOnline/
spack graph -d --color hdf5+mpi
spack graph -d --color hdf5~mpi

# Use a temporary environment to avoid reconcretizing
spack env activate --temp
Expand Down Expand Up @@ -317,12 +317,12 @@ <h2>How does reuse work?</h2>
# OpenMPI should not be reused
# from store or buildcache...
- type: local
exclude: ["openmpi"]
exclude: ["openmpi"]
- type: buildcache
exclude: ["openmpi"]
exclude: ["openmpi"]
# ...and it must be the only external used
- type: external
include: ["openmpi"]
include: ["openmpi"]
</code></pre>
</section>
<section>
Expand Down Expand Up @@ -423,90 +423,6 @@ <h2>Hands-on</h2>
</code></pre>
</section>
</section>
<section>
<section>
<h2>How are errors modeled?</h2>
</section>
<section>
<code>clingo</code> is not that helpful on unsat problems
<pre><code data-trim data-noescape data-line-numbers="1-4|4" class="prolog">
node("a").

attribute(P) :- node(P).
:- attribute(P).
</code></pre>
<pre><code data-trim data-noescape class="console">
$ clingo example.lp
clingo version 5.6.2
Reading from example.lp
Solving...
UNSATISFIABLE
</code></pre>
<pre><code data-trim data-noescape class="console">
$ spack spec foo
==> Error: UNSATISFIABLE
</code></pre>
</section>
<section>
Make errors part of a valid solution
<pre><code data-trim data-noescape data-line-numbers="1-4|4" class="prolog">
node("a").

attribute(P) :- node(P).
error("{P} cannot have an attribute!", P) :- attribute(P).
</code></pre>
<pre><code data-trim data-noescape class="console">
$ clingo example.lp
clingo version 5.6.2
Reading from example.lp
Solving...
Answer: 1
node("a") attribute("a") error("{P} cannot have an attribute!","a")
SATISFIABLE
</code></pre>
<pre><code data-trim data-noescape class="console">
$ spack spec foo
==> Error: foo cannot have an attribute!
</code></pre>
</section>
<section>
Highest priority optimization is <em>minimize errors</em>
</section>
<section>
<div>
<img src="dist/images/error-flow-chart.svg" style="background: none; border: 0px">
</div>
</section>
<section>
<pre><code data-trim data-noescape class="console tiny-text">
$ spack spec [email protected] ^[email protected]
==> Error: concretization failed for the following reasons:

1. Cannot select a single "version" for package "cmake"
2. Cannot satisfy 'cmake@:3.17'
3. Cannot satisfy 'cmake@:3.16'
4. Cannot satisfy '[email protected]:'
5. Cannot satisfy '[email protected]'
6. Cannot satisfy '[email protected]:'
required because hdf5 depends on [email protected]: when @1.13:
required because [email protected] ^[email protected] requested explicitly
7. Cannot satisfy '[email protected]'
required because [email protected] ^[email protected] requested explicitly
8. Cannot satisfy '[email protected]:' and '[email protected]
required because [email protected] ^[email protected] requested explicitly
required because hdf5 depends on [email protected]: when @1.13:
required because [email protected] ^[email protected] requested explicitly
9. Cannot satisfy '[email protected]' and '[email protected]:
required because [email protected] ^[email protected] requested explicitly
required because hdf5 depends on [email protected]: when @1.13:
required because [email protected] ^[email protected] requested explicitly
10. Cannot satisfy '[email protected]:' and '[email protected]
required because [email protected] ^[email protected] requested explicitly
required because hdf5 depends on [email protected]:
required because [email protected] ^[email protected] requested explicitly
</code></pre>
</section>
</section>
<section>
<section>
<h1 class="r-fit-text">What are runtimes in Spack 0.22?</h1>
Expand Down Expand Up @@ -776,7 +692,7 @@ <h2>What are requirements and strong preferences?</h2>
hdf5:
require:
- spec: "%gcc"
message: "This package must be built with GCC"
message: "This package must be built with GCC"
</code></pre>
</section>
<section>
Expand Down Expand Up @@ -833,15 +749,21 @@ <h2>What are requirements and strong preferences?</h2>
</section>
<section>
<h2>Hands-on</h2>
<pre><code data-trim data-noescape class="bash">
# Add a requirement to configuration,
# try to violate it, check the error message
<pre><code data-trim data-noescape class="yaml">
# Try to violate this requirement, check the error message
packages:
hdf5:
require:
- spec: "~mpi"
message: "HDF5 must be compiled without MPI"

# Do the same with a strong preference, observe
# spack solve weights
# Use a strong preference, and do the same
packages:
hdf5:
prefer:
- "~mpi"

# Enforce virtuals in an environment using
# requirements
# Enforce virtuals in an environment using requirements
</code></pre>
</section>
</section>
Expand Down Expand Up @@ -908,6 +830,90 @@ <h2>Hands-on</h2>
</code></pre>
</section>
</section>
<section>
<section>
<h2>How are errors modeled?</h2>
</section>
<section>
<code>clingo</code> is not that helpful on unsat problems
<pre><code data-trim data-noescape data-line-numbers="1-4|4" class="prolog">
node("a").

attribute(P) :- node(P).
:- attribute(P).
</code></pre>
<pre><code data-trim data-noescape class="console">
$ clingo example.lp
clingo version 5.6.2
Reading from example.lp
Solving...
UNSATISFIABLE
</code></pre>
<pre><code data-trim data-noescape class="console">
$ spack spec foo
==> Error: UNSATISFIABLE
</code></pre>
</section>
<section>
Make errors part of a valid solution
<pre><code data-trim data-noescape data-line-numbers="1-4|4" class="prolog">
node("a").

attribute(P) :- node(P).
error("{P} cannot have an attribute!", P) :- attribute(P).
</code></pre>
<pre><code data-trim data-noescape class="console">
$ clingo example.lp
clingo version 5.6.2
Reading from example.lp
Solving...
Answer: 1
node("a") attribute("a") error("{P} cannot have an attribute!","a")
SATISFIABLE
</code></pre>
<pre><code data-trim data-noescape class="console">
$ spack spec foo
==> Error: foo cannot have an attribute!
</code></pre>
</section>
<section>
Highest priority optimization is <em>minimize errors</em>
</section>
<section>
<div>
<img src="dist/images/error-flow-chart.svg" style="background: none; border: 0px">
</div>
</section>
<section>
<pre><code data-trim data-noescape class="console tiny-text">
$ spack spec [email protected] ^[email protected]
==> Error: concretization failed for the following reasons:

1. Cannot select a single "version" for package "cmake"
2. Cannot satisfy 'cmake@:3.17'
3. Cannot satisfy 'cmake@:3.16'
4. Cannot satisfy '[email protected]:'
5. Cannot satisfy '[email protected]'
6. Cannot satisfy '[email protected]:'
required because hdf5 depends on [email protected]: when @1.13:
required because [email protected] ^[email protected] requested explicitly
7. Cannot satisfy '[email protected]'
required because [email protected] ^[email protected] requested explicitly
8. Cannot satisfy '[email protected]:' and '[email protected]
required because [email protected] ^[email protected] requested explicitly
required because hdf5 depends on [email protected]: when @1.13:
required because [email protected] ^[email protected] requested explicitly
9. Cannot satisfy '[email protected]' and '[email protected]:
required because [email protected] ^[email protected] requested explicitly
required because hdf5 depends on [email protected]: when @1.13:
required because [email protected] ^[email protected] requested explicitly
10. Cannot satisfy '[email protected]:' and '[email protected]
required because [email protected] ^[email protected] requested explicitly
required because hdf5 depends on [email protected]:
required because [email protected] ^[email protected] requested explicitly
</code></pre>
</section>
</section>

<!-- OCI build caches -->
<section>
Expand Down

0 comments on commit a80269a

Please sign in to comment.