|
5 | 5 | import sys |
6 | 6 | import csv |
7 | 7 | import time |
| 8 | +import json |
8 | 9 | import shlex |
9 | 10 | import datetime |
10 | 11 | import argparse |
|
183 | 184 | ) |
184 | 185 |
|
185 | 186 | parser.add_argument( |
186 | | - '--rank_zero_imbalance', |
| 187 | + '--json', |
187 | 188 | 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', |
197 | 190 | help=argparse.SUPPRESS) |
198 | 191 |
|
199 | 192 | args = parser.parse_args() |
@@ -1457,39 +1450,25 @@ def main(): |
1457 | 1450 |
|
1458 | 1451 | ######################################################################################################################################################################### |
1459 | 1452 |
|
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) |
1468 | 1456 |
|
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) |
1489 | 1463 |
|
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 | + ) |
1493 | 1472 |
|
1494 | 1473 | ######################################################################################################################################################################### |
1495 | 1474 |
|
|
0 commit comments