File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,7 @@ compute_nodes_total_cost=0
21
21
22
22
for queue in $queues ; do
23
23
24
- instance_type=$( cat " ${cluster_config_file} " \
25
- | jq -r --arg queue $queue ' .cluster.queue_settings | to_entries[].value.compute_resource_settings | to_entries[] | select(.key==$queue).value.instance_type' )
24
+ instance_type=$( cat " ${cluster_config_file} " | jq -r --arg queue $queue ' .cluster.queue_settings | to_entries[] | select(.key==$queue).value.compute_resource_settings | to_entries[]| .value.instance_type' )
26
25
27
26
compute_node_h_price=$( aws pricing get-products \
28
27
--region us-east-1 \
@@ -46,7 +45,7 @@ for queue in $queues; do
46
45
' Type=TERM_MATCH,Field=volumeApiName,Value=gp2' \
47
46
| jq -r ' .terms.OnDemand | to_entries[] | .value.priceDimensions | to_entries[] | .value.pricePerUnit.USD' )
48
47
49
- total_num_compute_nodes=$( /opt/slurm/bin/sinfo --noheader --partition=$queue | egrep -v " idle~" | awk ' {sum += $4} END {print sum}' )
48
+ total_num_compute_nodes=$( /opt/slurm/bin/sinfo --noheader --partition=$queue | egrep -v " idle~" | awk ' {sum += $4} END {if (sum) print sum; else print 0; }' )
50
49
51
50
ebs_volume_size=$( aws cloudformation describe-stacks --stack-name $stack_name --region $cfn_region | jq -r ' .Stacks[0].Parameters | map(select(.ParameterKey == "ComputeRootVolumeSize"))[0].ParameterValue' )
52
51
compute_ebs_volume_cost=$( echo " scale=2; $ebs_cost_gb_month * $total_num_compute_nodes * $ebs_volume_size / 720" | bc)
You can’t perform that action at this time.
0 commit comments