Skip to content

Conversation

@garlick
Copy link
Member

@garlick garlick commented Oct 4, 2025

Problem: LLNL's El Capitan system employs a node type that may be interesting to include in future tests of Flux's resource representation, particularly as it evolves beyond Rv1.

Add a representative hwloc XML dump from

  • HPE/Cray EX255A login node on tuolomne
  • hwloc-2.12.1-4.t4
  • rhwloc_local_topology_xml() from flux-core-0.77.0

Add a simple Rv1 encode test.

Problem: LLNL's El Capitan system employs a node type that may
be interesting to include in future tests of Flux's resource
representation, particularly as it evolves beyond Rv1.

Add a representative hwloc XML dump from
- HPE/Cray EX255A login node on tuolomne
- hwloc-2.12.1-4.t4
- rhwloc_local_topology_xml() from flux-core-0.77.0

Add a simple Rv1 encode test.
@garlick
Copy link
Member Author

garlick commented Oct 4, 2025

This was just an idle thought this morning. If we don't want largish XML (144K here) blobs accumulating in our source tree, I can withdraw.

BTW, I didn't find the lshw -xml runes to generate an XML file that flux R encode --xml could read, so I Just did this. I'm assuming there is a way to get a usable dump and I'm just clueless, but if not, maybe this addition to flux-R or something like it should be tacked on?

diff --git a/src/cmd/flux-R.c b/src/cmd/flux-R.c
index 24f21aa1e..01453b06c 100644
--- a/src/cmd/flux-R.c
+++ b/src/cmd/flux-R.c
@@ -46,6 +46,7 @@ int cmd_decode (optparse_t *p, int argc, char **argv);
 int cmd_verify (optparse_t *p, int argc, char **argv);
 int cmd_set_property (optparse_t *p, int argc, char **argv);
 int cmd_parse_config (optparse_t *p, int argc, char **argv);
+int cmd_local_xml (optparse_t *p, int argc, char **argv);
 
 static struct optparse_option global_opts[] =  {
     OPTPARSE_TABLE_END
@@ -233,6 +234,13 @@ static struct optparse_subcommand subcommands[] = {
       0,
       parse_config_opts,
     },
+    { "local-xml",
+      "PATH",
+      "Dump local hwloc XML to stdout",
+      cmd_local_xml,
+      0,
+      NULL,
+    },
     OPTPARSE_SUBCMD_END
 };
 
@@ -904,6 +912,18 @@ int cmd_parse_config (optparse_t *p, int argc, char **argv)
     return 0;
 }
 
+int cmd_local_xml (optparse_t *p, int argc, char **argv)
+{
+    char *xml;
+
+    if (!(xml = rhwloc_local_topology_xml (0)))
+        log_err_exit ("failed to gather local topology XML");
+    if (fwrite (xml, strlen (xml), 1, stdout) < 1)
+        log_err_exit ("stdout write failure");
+    free (xml);
+    return 0;
+}
+

@codecov
Copy link

codecov bot commented Oct 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.00%. Comparing base (fe9e824) to head (eb381df).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7111      +/-   ##
==========================================
+ Coverage   83.99%   84.00%   +0.01%     
==========================================
  Files         550      550              
  Lines       93130    93130              
==========================================
+ Hits        78227    78238      +11     
+ Misses      14903    14892      -11     

see 9 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@grondo
Copy link
Contributor

grondo commented Oct 6, 2025

BTW, I didn't find the lshw -xml runes to generate an XML file that flux R encode --xml could read, so I Just did this

This works for me:

$ lstopo --of xml | flux R encode --xml=- | jq
{
  "version": 1,
  "execution": {
    "R_lite": [
      {
        "rank": "0",
        "children": {
          "core": "0-95",
          "gpu": "0-3"
        }
      }
    ],
    "starttime": 0.0,
    "expiration": 0.0,
    "nodelist": [
      "tuolumne2149"
    ]
  }
}

What was the error you were getting?

@garlick
Copy link
Member Author

garlick commented Oct 6, 2025

Oh, derp. I used lshw not lstopo

$ lshw -xml|flux R encode --xml=-
flux-R: rlist_from_hwloc: Invalid argument

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants