Skip to content

Commit 75b823a

Browse files
committed
Added support to display DXT issues using a JSON file
1 parent 70c2717 commit 75b823a

File tree

1 file changed

+20
-41
lines changed

1 file changed

+20
-41
lines changed

drishti/main.py

Lines changed: 20 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import sys
66
import csv
77
import time
8+
import json
89
import shlex
910
import datetime
1011
import argparse
@@ -183,17 +184,9 @@
183184
)
184185

185186
parser.add_argument(
186-
'--rank_zero_imbalance',
187+
'--json',
187188
default=False,
188-
action='store_true',
189-
dest='rank_zero_imbalance',
190-
help=argparse.SUPPRESS)
191-
192-
parser.add_argument(
193-
'--unbalanced_workload',
194-
default=False,
195-
action='store_true',
196-
dest='unbalanced_workload',
189+
dest='json',
197190
help=argparse.SUPPRESS)
198191

199192
args = parser.parse_args()
@@ -1457,39 +1450,25 @@ def main():
14571450

14581451
#########################################################################################################################################################################
14591452

1460-
if args.rank_zero_imbalance:
1461-
issue = 'Rank 0 is issuing a lot of I/O requests'
1462-
1463-
recommendation = [
1464-
{
1465-
'message': 'Consider using MPI-IO collective'
1466-
}
1467-
]
1453+
if args.json:
1454+
f = open(args.json)
1455+
data = json.load(f)
14681456

1469-
insights_dxt.append(
1470-
message(INSIGHTS_DXT_RANK_ZERO_IMBALANCE, TARGET_DEVELOPER, HIGH, issue, recommendation)
1471-
)
1472-
1473-
#########################################################################################################################################################################
1474-
1475-
if args.unbalanced_workload:
1476-
issue = 'Detected unbalanced workload between the ranks'
1477-
1478-
recommendation = [
1479-
{
1480-
'message': 'Consider better balancing the data transfer between the application ranks'
1481-
},
1482-
{
1483-
'message': 'Consider tuning the stripe size and count to better distribute the data'
1484-
},
1485-
{
1486-
'message': 'If the application uses netCDF and HDF5, double check the need to set NO_FILL values'
1487-
}
1488-
]
1457+
for key, value in data.items():
1458+
issue = value['issue']
1459+
recommendation = []
1460+
for rec in value['recommendations']:
1461+
new_message = {'message': rec}
1462+
recommendation.append(new_message)
14891463

1490-
insights_dxt.append(
1491-
message(INSIGHTS_DXT_RANK_IMBALANCE, TARGET_DEVELOPER, HIGH, issue, recommendation)
1492-
)
1464+
if key == "rank_zero_imbalance":
1465+
insights_dxt.append(
1466+
message(INSIGHTS_DXT_RANK_ZERO_IMBALANCE, TARGET_DEVELOPER, HIGH, issue, recommendation)
1467+
)
1468+
elif key == "unbalanced_workload":
1469+
insights_dxt.append(
1470+
message(INSIGHTS_DXT_RANK_IMBALANCE, TARGET_DEVELOPER, HIGH, issue, recommendation)
1471+
)
14931472

14941473
#########################################################################################################################################################################
14951474

0 commit comments

Comments
 (0)