From d4ba5113f27eed7694d616679b8a94652da1e822 Mon Sep 17 00:00:00 2001 From: Albert Chu Date: Fri, 21 Jun 2024 11:20:49 -0700 Subject: [PATCH 1/2] powerman: increase maximum line length Problem: On very larger clusters command line operations of a large number of nodes (e.g. node[1,3,5,...,4997,4999]) can exceed internal buffers, leading to errors. Increase the internal maximum line length from 8K to 128K, which should handle any HPC cluster in existence today and larger ones in the future. Fixes #193 --- src/powerman/client_proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/powerman/client_proto.h b/src/powerman/client_proto.h index b50253df..2478b720 100644 --- a/src/powerman/client_proto.h +++ b/src/powerman/client_proto.h @@ -21,7 +21,7 @@ * If not quit, goto 3 */ -#define CP_LINEMAX 8192 /* max request/response line length */ +#define CP_LINEMAX 131072 /* max request/response line length */ #define CP_EOL "\r\n" /* line terminator */ #define CP_PROMPT "powerman> " /* prompt */ #define CP_VERSION "001 %s" CP_EOL From bd1bd2734c83fb0a02b8ada772516abccb32a460 Mon Sep 17 00:00:00 2001 From: Albert Chu Date: Fri, 21 Jun 2024 11:56:11 -0700 Subject: [PATCH 2/2] t: add giant input coverage Problem: There is no test to ensure that a giant input on the command line works with powerman. Add a test to t0039-llnl-el-capitan-cluster.t with an giant node input string. --- t/t0039-llnl-el-capitan-cluster.t | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/t/t0039-llnl-el-capitan-cluster.t b/t/t0039-llnl-el-capitan-cluster.t index c3bd9fcd..cf0d780d 100755 --- a/t/t0039-llnl-el-capitan-cluster.t +++ b/t/t0039-llnl-el-capitan-cluster.t @@ -106,6 +106,12 @@ test_expect_success 'powerman -q shows all off' ' makeoutput "" "$ALLSTR" "" >query5.exp && test_cmp query5.exp query5.out ' +test_expect_success 'powerman -q works with giant input' ' + nodes=$(echo elcap\[$(seq -s, 0 2 16382)\]) && + $powerman -h $testaddr -q $nodes >query6.out && + makeoutput "" "$nodes" "" >query6.exp && + test_cmp query6.exp query6.out +' test_expect_success 'stop powerman daemon' ' kill -15 $(cat powermand.pid) && wait