-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sc20 Revisions to scripting with spack (#93)
Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
- Loading branch information
1 parent
068e493
commit 4f75bcf
Showing
7 changed files
with
293 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
$ spack python | ||
Spack version 0.15.3 | ||
Spack version 0.15.4 | ||
Python 3.6.9, Linux x86_64 | ||
>>> exit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
>>> from spack.spec import Spec | ||
>>> s = Spec('zlib target=ivybridge') | ||
>>> s.concrete | ||
False | ||
>>> s.version | ||
Traceback (most recent call last): | ||
File "<console>", line 1, in <module> | ||
File "/home/spack/spack/lib/spack/spack/spec.py", line 3166, in version | ||
raise SpecError("Spec version is not concrete: " + str(self)) | ||
SpecError: Spec version is not concrete: zlib arch=linux-None-ivybridge | ||
>>> s.versions | ||
[:] | ||
>>> s.architecture | ||
linux-None-ivybridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
>>> s.concretize() | ||
>>> s.concrete | ||
True | ||
>>> s.version | ||
Version('1.2.11') | ||
>>> s.versions | ||
[Version('1.2.11')] | ||
>>> s.architecture | ||
linux-ubuntu18.04-ivybridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
>>> gcc_query_spec = Spec('%gcc') | ||
>>> gcc_specs = spack.store.db.query(gcc_query_spec) | ||
>>> result = filter(lambda spec: not spec.satisfies('^mpich'), gcc_specs) | ||
>>> import spack.cmd | ||
>>> spack.cmd.display_specs(result) | ||
-- linux-ubuntu18.04-x86_64 / gcc@7.5.0 ------------------------- | ||
autoconf@2.69 libiconv@1.16 m4@1.4.18 perl@5.30.3 zlib@1.2.11 | ||
automake@1.16.2 libpciaccess@0.13.5 ncurses@6.2 pkgconf@1.7.3 | ||
gdbm@1.18.1 libsigsegv@2.12 numactl@2.0.12 readline@8.0 | ||
hdf5@1.10.6 libtool@2.4.6 openmpi@3.1.6 util-macros@1.19.1 | ||
hwloc@1.11.11 libxml2@2.9.10 patchelf@0.10 xz@5.2.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
>>> import spack.store | ||
>>> help(spack.store.db.query) | ||
Help on method query in module spack.database: | ||
|
||
query(*args, **kwargs) method of spack.database.Database instance | ||
Query the Spack database including all upstream databases. | ||
|
||
Args: | ||
query_spec: queries iterate through specs in the database and | ||
return those that satisfy the supplied ``query_spec``. If | ||
query_spec is `any`, This will match all specs in the | ||
database. If it is a spec, we'll evaluate | ||
``spec.satisfies(query_spec)`` | ||
|
||
known (bool or any, optional): Specs that are "known" are those | ||
for which Spack can locate a ``package.py`` file -- i.e., | ||
Spack "knows" how to install them. Specs that are unknown may | ||
represent packages that existed in a previous version of | ||
Spack, but have since either changed their name or | ||
been removed | ||
|
||
installed (bool or any, or InstallStatus or iterable of | ||
InstallStatus, optional): if ``True``, includes only installed | ||
specs in the search; if ``False`` only missing specs, and if | ||
``any``, all specs in database. If an InstallStatus or iterable | ||
of InstallStatus, returns specs whose install status | ||
(installed, deprecated, or missing) matches (one of) the | ||
InstallStatus. (default: True) | ||
|
||
explicit (bool or any, optional): A spec that was installed | ||
following a specific user request is marked as explicit. If | ||
instead it was pulled-in as a dependency of a user requested | ||
spec it's considered implicit. | ||
|
||
start_date (datetime, optional): filters the query discarding | ||
specs that have been installed before ``start_date``. | ||
|
||
end_date (datetime, optional): filters the query discarding | ||
specs that have been installed after ``end_date``. | ||
|
||
hashes (container): list or set of hashes that we can use to | ||
restrict the search | ||
|
||
Returns: | ||
list of specs that match the query | ||
(END) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
>>> t = Spec('zlib target=ivybridge').concretized() | ||
>>> s == t | ||
True |
Oops, something went wrong.