Skip to content
Snippets Groups Projects
Commit cdb7ac2c authored by Morris Jette's avatar Morris Jette
Browse files

Make capmc command more general

In order to test with larger systems, modify capmc script to generate
  output with arbitrary start and end NID values
parent 75a71f87
No related branches found
No related tags found
No related merge requests found
#!/bin/bash #!/bin/bash
echo $* >>/var/tmp/capmc.log echo $* >>/var/tmp/capmc.log
first_nid=1
last_nid=22000
if [ $# -lt 1 ] ; then if [ $# -lt 1 ] ; then
echo 'no argument' echo 'no argument'
exit 1 exit 1
...@@ -202,23 +207,23 @@ fi ...@@ -202,23 +207,23 @@ fi
if [ "$1" = "get_node_energy_counter" ] ; then if [ "$1" = "get_node_energy_counter" ] ; then
echo '{ echo '{
"e": 0, "e": 0,
"err_msg": "", "err_msg": "",
"nid_count": 3, "nid_count": 3,
"nodes": [ "nodes": [
{ {
"energy_ctr": 4761800, "energy_ctr": 4761800,
"nid": 1, "nid": 1,
"time": "2015-02-19 15:50:18.581552-06" "time": "2015-02-19 15:50:18.581552-06"
}, },
{ {
"energy_ctr": 4821800, "energy_ctr": 4821800,
"nid": 2, "nid": 2,
"time": "2015-02-19 15:50:18.581652-06" "time": "2015-02-19 15:50:18.581652-06"
}, },
{ {
"energy_ctr": 4821800, "energy_ctr": 4821800,
"nid": 3, "nid": 3,
"time": "2015-02-19 15:50:19.981752-06" "time": "2015-02-19 15:50:19.981752-06"
} }
] ]
...@@ -261,9 +266,10 @@ exit 0 ...@@ -261,9 +266,10 @@ exit 0
fi fi
if [ "$1" = "node_reinit" ] ; then if [ "$1" = "node_reinit" ] ; then
sleep 5
echo '{ echo '{
"e":0, "e":0,
"err_msg":"uccess" "err_msg":"Success"
}' }'
exit 0 exit 0
fi fi
...@@ -279,26 +285,26 @@ fi ...@@ -279,26 +285,26 @@ fi
if [ "$1" = "node_status" ] ; then if [ "$1" = "node_status" ] ; then
echo '{ echo '{
"e": 0, "e": 0,
"err_msg": "", "err_msg": "",
"off": [ "off": [
1, 1,
2, 2,
3, 3,
14, 14,
15 15
], ],
"on": [ "on": [
1, 1,
2, 2,
3, 3,
4, 4,
5, 5,
6 6
], ],
"ready": [ "ready": [
16, 16,
27, 27,
18 18
] ]
}' }'
...@@ -380,112 +386,195 @@ exit 0 ...@@ -380,112 +386,195 @@ exit 0
fi fi
if [ "$1" = "get_mcdram_capabilities" ] ; then if [ "$1" = "get_mcdram_capabilities" ] ; then
echo '{
"nids": ['
inx=$first_nid
while [ $inx -lt $last_nid ]
do
echo " {
\"mcdram_cfg\": \"flat,0,split,25,equal,50,cache,100\",
\"nid\": $inx
},"
inx=$((inx+1))
done
echo " {
\"mcdram_cfg\": \"flat,0,split,25,equal,50,cache,100\",
\"nid\": $inx
} "
echo ' ],
"err_msg": "Success; nids not eligible for numa operations were ignored",
"e": 0
}'
exit 0
fi
if [ "$1" = "get_mcdram_capabilitiesx" ] ; then
echo '{ echo '{
"nids": [ "nids": [
{ {
"mcdram_cfg": "flat,0,split,25,equal,50,cache,100", "mcdram_cfg": "flat,0,split,25,equal,50,cache,100",
"nid": 1 "nid": 1
}, },
{ {
"mcdram_cfg": "flat,0,split,25,equal,50,cache,100", "mcdram_cfg": "flat,0,split,25,equal,50,cache,100",
"nid": 2 "nid": 2
},
{
"mcdram_cfg": "flat,0,split,25,equal,50,cache,100",
"nid": 3
}, },
{ {
"mcdram_cfg": "flat,0,split,25,equal,50,cache,100", "mcdram_cfg": "flat,0,split,25,equal,50,cache,100",
"nid": 4 "nid": 3
} }
], ],
"err_msg": "Success; nids not eligible for mcdram operations were ignored", "err_msg": "Success; nids not eligible for mcdram operations were ignored",
"e": 0 "e": 0
}' }'
exit 0 exit 0
fi fi
if [ "$1" = "get_mcdram_cfg" ]; then if [ "$1" = "get_mcdram_cfg" ]; then
echo '{
"nids": ['
inx=$first_nid
while [ $inx -lt $last_nid ]
do
echo " {
\"mcdram_cfg\": \"flat\",
\"mcdram_pct\": \"0\",
\"mcdram_size\": \"8192MB\",
\"nid\": $inx
\"dram_size\": \"96GB\",
},"
inx=$((inx+1))
done
echo " {
\"mcdram_cfg\": \"flat\",
\"mcdram_pct\": \"0\",
\"mcdram_size\": \"8192MB\",
\"nid\": $inx
\"dram_size\": \"96GB\",
} "
echo ' ],
"err_msg": "Success; nids not eligible for numa operations were ignored",
"e": 0
}'
exit 0
fi
if [ "$1" = "get_mcdram_cfgx" ]; then
echo '{ echo '{
"nids": [ "nids": [
{ {
"mcdram_cfg": "flat", "mcdram_cfg": "flat",
"mcdram_pct": "0", "mcdram_pct": "0",
"mcdram_size": "8192MB", "mcdram_size": "8192MB",
"nid": 1, "nid": 1,
"dram_size": "96GB" "dram_size": "96GB"
}, },
{
"mcdram_cfg": "flat",
"mcdram_pct": "0",
"mcdram_size": "8192MB",
"nid": 2,
"dram_size": "96GB"
},
{ {
"mcdram_cfg": "flat", "mcdram_cfg": "flat",
"mcdram_pct": "0", "mcdram_pct": "0",
"mcdram_size": "8192MB", "mcdram_size": "8192MB",
"nid": 3, "nid": 2,
"dram_size": "96GB" "dram_size": "96GB"
}, },
{ {
"mcdram_cfg": "flat", "mcdram_cfg": "flat",
"mcdram_pct": "0", "mcdram_pct": "0",
"mcdram_size": "8192MB", "mcdram_size": "8192MB",
"nid": 4, "nid": 3,
"dram_size": "96GB" "dram_size": "96GB"
} }
], ],
"err_msg": "Success; nids not eligible for mcdram operations were ignored", "err_msg": "Success; nids not eligible for mcdram operations were ignored",
"e": 0 "e": 0
}' }'
exit 0 exit 0
fi fi
if [ "$1" = "get_numa_capabilities" ]; then if [ "$1" = "get_numa_capabilities" ]; then
echo '{
"nids": ['
inx=$first_nid
while [ $inx -lt $last_nid ]
do
echo " {
\"numa_cfg\": \"a2a,snc2,snc4,hemi,quad\",
\"nid\": $inx
},"
inx=$((inx+1))
done
echo " {
\"numa_cfg\": \"a2a,snc2,snc4,hemi,quad\",
\"nid\": $inx
} "
echo ' ],
"err_msg": "Success; nids not eligible for numa operations were ignored",
"e": 0
}'
exit 0
fi
if [ "$1" = "get_numa_capabilitiesx" ]; then
echo '{ echo '{
"nids": [ "nids": [
{ {
"numa_cfg": "a2a,snc2,snc4,hemi,quad", "numa_cfg": "a2a,snc2,snc4,hemi,quad",
"nid": 1 "nid": 1
}, },
{ {
"numa_cfg": "a2a,snc2,snc4,hemi,quad", "numa_cfg": "a2a,snc2,snc4,hemi,quad",
"nid": 2 "nid": 2
},
{
"numa_cfg": "a2a,snc2,snc4,hemi,quad",
"nid": 3
}, },
{ {
"numa_cfg": "a2a,snc2,snc4,hemi,quad", "numa_cfg": "a2a,snc2,snc4,hemi,quad",
"nid": 4 "nid": 3
} }
], ],
"err_msg": "Success; nids not eligible for numa operations were ignored", "err_msg": "Success; nids not eligible for numa operations were ignored",
"e": 0 "e": 0
}' }'
exit 0 exit 0
fi fi
if [ "$1" = "get_numa_cfg" ]; then if [ "$1" = "get_numa_cfg" ]; then
echo '{
"nids": ['
inx=$first_nid
while [ $inx -lt $last_nid ]
do
echo " {
\"numa_cfg\": \"a2a\",
\"nid\": $inx
},"
inx=$((inx+1))
done
echo " {
\"numa_cfg\": \"a2a\",
\"nid\": $inx
} "
echo ' ],
"err_msg": "Success; nids not eligible for numa operations were ignored",
"e": 0
}'
exit 0
fi
if [ "$1" = "get_numa_cfgx" ]; then
echo '{ echo '{
"nids": [ "nids": [
{ {
"numa_cfg": "a2a", "numa_cfg": "a2a",
"nid": 1 "nid": 1
}, },
{ {
"numa_cfg": "a2a", "numa_cfg": "a2a",
"nid": 2 "nid": 2
}, },
{ {
"numa_cfg": "a2a", "numa_cfg": "a2a",
"nid": 3 "nid": 3
} },
], ],
"err_msg": "Success; nids not eligible for numa operations were ignored", "err_msg": "Success; nids not eligible for numa operations were ignored",
"e": 0 "e": 0
}' }'
exit 0 exit 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment