From a9f47e8c1c1e18e69f5f4f552b699e53893ea33d Mon Sep 17 00:00:00 2001
From: Adrian Pope <apope@anl.gov>
Date: Mon, 27 Feb 2023 15:53:35 -0600
Subject: [PATCH] added comments to polaris scripts

---
 polaris/polaris_nodes_debug.sh  | 4 ++++
 polaris/polaris_nodes_demand.sh | 4 ++++
 polaris/polaris_nodes_prod.sh   | 7 +++++++
 polaris/polaris_nodes_resv.sh   | 4 ++++
 polaris/polaris_nodes_states.sh | 2 ++
 5 files changed, 21 insertions(+)

diff --git a/polaris/polaris_nodes_debug.sh b/polaris/polaris_nodes_debug.sh
index 9f0f405..3b72553 100755
--- a/polaris/polaris_nodes_debug.sh
+++ b/polaris/polaris_nodes_debug.sh
@@ -1,3 +1,7 @@
 #! /bin/bash
 
+# goal: show state of debug nodes excluded from prod queue
+# include: nodes marked as debug
+# output: hostname, state
+
 pbsnodes -a -F json | jq -r '.nodes[] | select(.resources_available.debug=="True") | [.resources_available.host,.state] | @tsv'
diff --git a/polaris/polaris_nodes_demand.sh b/polaris/polaris_nodes_demand.sh
index b77131a..9dd3b30 100755
--- a/polaris/polaris_nodes_demand.sh
+++ b/polaris/polaris_nodes_demand.sh
@@ -1,3 +1,7 @@
 #! /bin/bash
 
+# goal: show state of demand nodes excluded from prod queue
+# include: nodes marked as demand
+# output: hostname, state
+
 pbsnodes -a -F json | jq -r '.nodes[] | select(.resources_available.demand=="True") | [.resources_available.host,.state] | @tsv'
diff --git a/polaris/polaris_nodes_prod.sh b/polaris/polaris_nodes_prod.sh
index da743f1..3360ff4 100755
--- a/polaris/polaris_nodes_prod.sh
+++ b/polaris/polaris_nodes_prod.sh
@@ -1,3 +1,10 @@
 #! /bin/bash
 
+# goal: determine the max job size that could run in prod queue in near future
+# example: ./polaris_nodes_prod.sh | wc -l
+# include: nodes in "free" or "job-exclusive" state
+# exclude: nodes marked as "debug" or "demand"
+# output: hostname, state
+# issues: unsure how state relates to reservations on polaris
+
 pbsnodes -a -F json | jq -r '.nodes[] | select( (.state=="free" or .state=="job-exclusive") and .resources_available.debug!="True" and .resources_available.demand!="True") | [.resources_available.host,.state] | @tsv'
diff --git a/polaris/polaris_nodes_resv.sh b/polaris/polaris_nodes_resv.sh
index 6ceaa4a..e8d7eed 100755
--- a/polaris/polaris_nodes_resv.sh
+++ b/polaris/polaris_nodes_resv.sh
@@ -1,3 +1,7 @@
 #! /bin/bash
 
+# goal: show state of nodes currently under reservation
+# include: nodes with non-null resv attribute
+# output: hostname, resv attribute value, state
+
 pbsnodes -a -F json | jq -r '.nodes[] | select(.resv!=null) | [.resources_available.host,.resv,.state] | @tsv'
diff --git a/polaris/polaris_nodes_states.sh b/polaris/polaris_nodes_states.sh
index 0301998..fbe019e 100755
--- a/polaris/polaris_nodes_states.sh
+++ b/polaris/polaris_nodes_states.sh
@@ -1,3 +1,5 @@
 #! /bin/bash
 
+# goal: print list of current unique values for node state
+
 pbsnodes -a -F json | jq '[.nodes[].state] | unique'
-- 
GitLab