-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update using hatchet at llnl page (#60)
* update using hatchet at llnl page - move to separate RST file to bring page up a level in TOC - add script for reading in one or many SPOT files * add code snippet for finding hatchet and its dependencies * minor updates * fixes
- Loading branch information
Showing
3 changed files
with
112 additions
and
24 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
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
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,111 @@ | ||
.. Copyright 2017-2022 Lawrence Livermore National Security, LLC and other | ||
Hatchet Project Developers. See the top-level LICENSE file for details. | ||
SPDX-License-Identifier: MIT | ||
***************************** | ||
Using Hatchet on LLNL Systems | ||
***************************** | ||
|
||
Hatchet installations are available on both Intel and IBM systems at Lawrence | ||
Livermore National Laboratory. | ||
|
||
To use one of these global installations, add the following to your Python | ||
script or Jupyter notebook. This code allows you to use hatchet and its | ||
dependencies. | ||
|
||
.. code-block:: python | ||
:caption: Starter commands to find hatchet and its dependencies | ||
import sys | ||
import platform | ||
from IPython.display import HTML, display | ||
machine = platform.uname().machine | ||
sys.path.append(input_deploy_dir_str + "/hatchet-venv/" + machine + "/lib/python3.7/site-packages") | ||
sys.path.append(input_deploy_dir_str + "/hatchet/" + machine) | ||
sys.path.append(input_deploy_dir_str + "/spotdb") | ||
import datetime as dt | ||
import hatchet | ||
import spotdb | ||
The following Python script loads a single SPOT/cali file into hatchet using | ||
Hatchet's ``from_spotdb()``. This returns a list of hatchet ``GraphFrames``, | ||
and we use ``pop()`` to access the single ``GraphFrame`` in the list. | ||
|
||
.. code-block:: python | ||
:caption: Python script to load a single SPOT file into hatchet | ||
import sys | ||
import platform | ||
from IPython.display import HTML, display | ||
machine = platform.uname().machine | ||
sys.path.append(input_deploy_dir_str + "/hatchet-venv/" + machine + "/lib/python3.7/site-packages") | ||
sys.path.append(input_deploy_dir_str + "/hatchet/" + machine) | ||
sys.path.append(input_deploy_dir_str + "/spotdb") | ||
import datetime as dt | ||
import hatchet | ||
import spotdb | ||
input_deploy_dir_str = "/usr/gapps/spot/live/" | ||
input_db_uri_str = "./mpi" | ||
input_run_ids_str = "c5UcO9xwAUKNVVFg1_0.cali" | ||
db = spotdb.connect(input_db_uri_str) | ||
runs = input_run_ids_str.split(',') | ||
gfs = hatchet.GraphFrame.from_spotdb(db, runs) | ||
gf = gfs.pop() | ||
launchdate = dt.datetime.fromtimestamp(int(gf.metadata["launchdate"])) | ||
jobsize = int(gf.metadata.get("jobsize", 1)) | ||
print("launchdate: {}, jobsize: {}".format(launchdate, jobsize)) | ||
print(gf.tree()) | ||
display(HTML(gf.dataframe.to_html())) | ||
The following Python script loads multiple SPOT/cali files (most likely | ||
contained in the same directory) into hatchet using Hatchet's | ||
``from_spotdb()``. The files are specified as a single string, and commas | ||
delineate each file. The result is a list of hatchet ``GraphFrames``, one for | ||
each file. | ||
|
||
.. code-block:: python | ||
:caption: Python script to load multiple SPOT files into hatchet | ||
import sys | ||
import platform | ||
from IPython.display import HTML, display | ||
machine = platform.uname().machine | ||
sys.path.append(input_deploy_dir_str + "/hatchet-venv/" + machine + "/lib/python3.7/site-packages") | ||
sys.path.append(input_deploy_dir_str + "/hatchet/" + machine) | ||
sys.path.append(input_deploy_dir_str + "/spotdb") | ||
import datetime as dt | ||
import hatchet | ||
import spotdb | ||
input_deploy_dir_str = "/usr/gapps/spot/live/" | ||
input_db_uri_str = "./mpi" | ||
input_run_ids_str = "./mpi/cQ-CGJlYj-uFT2yv-_0.cali,./mpi/cQ-CGJlYj-uFT2yv-_1.cali,./mpi/cQ-CGJlYj-uFT2yv-_2.cali" | ||
db = spotdb.connect(input_db_uri_str) | ||
runs = input_run_ids_str.split(',') | ||
gfs = hatchet.GraphFrame.from_spotdb(db, runs) | ||
for idx, gf in enumerate(gfs): | ||
launchdate = dt.datetime.fromtimestamp(int(gf.metadata["launchdate"])) | ||
jobsize = int(gf.metadata.get("jobsize", 1)) | ||
print("launchdate: {}, jobsize: {}".format(launchdate, jobsize)) | ||
print(gf.tree()) | ||
display(HTML(gf.dataframe.to_html())) |