Skip to content

Commit

Permalink
Added support to display DXT issues using a JSON file
Browse files Browse the repository at this point in the history
  • Loading branch information
hammad45 committed Jan 26, 2023
1 parent 70c2717 commit 75b823a
Showing 1 changed file with 20 additions and 41 deletions.
61 changes: 20 additions & 41 deletions drishti/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import sys
import csv
import time
import json
import shlex
import datetime
import argparse
Expand Down Expand Up @@ -183,17 +184,9 @@
)

parser.add_argument(
'--rank_zero_imbalance',
'--json',
default=False,
action='store_true',
dest='rank_zero_imbalance',
help=argparse.SUPPRESS)

parser.add_argument(
'--unbalanced_workload',
default=False,
action='store_true',
dest='unbalanced_workload',
dest='json',
help=argparse.SUPPRESS)

args = parser.parse_args()
Expand Down Expand Up @@ -1457,39 +1450,25 @@ def main():

#########################################################################################################################################################################

if args.rank_zero_imbalance:
issue = 'Rank 0 is issuing a lot of I/O requests'

recommendation = [
{
'message': 'Consider using MPI-IO collective'
}
]
if args.json:
f = open(args.json)
data = json.load(f)

insights_dxt.append(
message(INSIGHTS_DXT_RANK_ZERO_IMBALANCE, TARGET_DEVELOPER, HIGH, issue, recommendation)
)

#########################################################################################################################################################################

if args.unbalanced_workload:
issue = 'Detected unbalanced workload between the ranks'

recommendation = [
{
'message': 'Consider better balancing the data transfer between the application ranks'
},
{
'message': 'Consider tuning the stripe size and count to better distribute the data'
},
{
'message': 'If the application uses netCDF and HDF5, double check the need to set NO_FILL values'
}
]
for key, value in data.items():
issue = value['issue']
recommendation = []
for rec in value['recommendations']:
new_message = {'message': rec}
recommendation.append(new_message)

insights_dxt.append(
message(INSIGHTS_DXT_RANK_IMBALANCE, TARGET_DEVELOPER, HIGH, issue, recommendation)
)
if key == "rank_zero_imbalance":
insights_dxt.append(
message(INSIGHTS_DXT_RANK_ZERO_IMBALANCE, TARGET_DEVELOPER, HIGH, issue, recommendation)
)
elif key == "unbalanced_workload":
insights_dxt.append(
message(INSIGHTS_DXT_RANK_IMBALANCE, TARGET_DEVELOPER, HIGH, issue, recommendation)
)

#########################################################################################################################################################################

Expand Down

0 comments on commit 75b823a

Please sign in to comment.