|
346 | 346 | raise FileNotFoundError(Fore.RED + "The plugin {} is not found. Please verify that you are using the correct file path.".format( |
347 | 347 | clean_control["plot"][key]["plugin"])) |
348 | 348 |
|
| 349 | + # Create plot directory to save plots |
| 350 | + print_info("Creating directory to save plots.") |
| 351 | + os.makedirs("data/plots", exist_ok=True) |
| 352 | + |
349 | 353 | print_info("Generating directive list for worker nodes.") |
350 | 354 | # Generate and slice directive list that will be sent out to the workers |
351 | 355 | clean_directive_list = sst.generate_clean(clean_control["plot"], ROOT_PATH + "/data/plots", ROOT_PATH + "/data") |
|
603 | 607 | except subprocess.SubprocessError: |
604 | 608 | logger.warning("ERROR: Evaluation for model {} failed. Please review logfile {} for error diagnostics.".format(model_name, file_output)) |
605 | 609 |
|
606 | | - |
607 | 610 | # Close the training plugin log file |
608 | 611 | fout.close() |
609 | 612 |
|
|
635 | 638 | logger.warning("INFO: Received task list {} from manager.".format(task_list)) |
636 | 639 |
|
637 | 640 | if task_list != []: |
| 641 | + logger.warning("INFO: Beginning cleaning stage plotting.") |
| 642 | + |
| 643 | + for task in task_list: |
| 644 | + logger.warning("INFO: Generating plot {}.".format(task[2])) |
| 645 | + file_output = "data/.logs/worker-1/{}-plot-{}".format(TIME, task[2]) |
| 646 | + logger.warning("INFO: Saving output of plotting plugin to logfile {}.".format(file_output)) |
| 647 | + fout = open(file_output, "wt") |
| 648 | + |
| 649 | + clean_param = clean_factory(task[1], task[2], task[3], ROOT_PATH) |
| 650 | + |
| 651 | + try: |
| 652 | + subprocess.run([PYTHON_PATH, task[0], "clean", clean_param], stdout=fout, stderr=fout) |
| 653 | + |
| 654 | + except subprocess.SubprocessError: |
| 655 | + logger.warning("ERROR: Plotting failed. Please review logfile {} for error diagnostics.".format(file_output)) |
| 656 | + |
| 657 | + fout.close() |
| 658 | + |
638 | 659 | comm.send(1, dest=0, tag=1) |
639 | 660 |
|
640 | 661 | else: |
|
812 | 833 | except subprocess.SubprocessError: |
813 | 834 | logger.warning("ERROR: Evaluation for model {} failed. Please review logfile {} for error diagnostics.".format(model_name, file_output)) |
814 | 835 |
|
815 | | - |
816 | 836 | # Close the training plugin log file |
817 | 837 | fout.close() |
818 | 838 |
|
|
844 | 864 | logger.warning("INFO: Received task list {} from manager.".format(task_list)) |
845 | 865 |
|
846 | 866 | if task_list != []: |
| 867 | + logger.warning("INFO: Beginning cleaning stage plotting.") |
| 868 | + |
| 869 | + for task in task_list: |
| 870 | + logger.warning("INFO: Generating plot {}.".format(task[2])) |
| 871 | + file_output = "data/.logs/worker-2/{}-plot-{}".format(TIME, task[2]) |
| 872 | + logger.warning("INFO: Saving output of plotting plugin to logfile {}.".format(file_output)) |
| 873 | + fout = open(file_output, "wt") |
| 874 | + |
| 875 | + clean_param = clean_factory(task[1], task[2], task[3], ROOT_PATH) |
| 876 | + |
| 877 | + try: |
| 878 | + subprocess.run([PYTHON_PATH, task[0], "clean", clean_param], stdout=fout, stderr=fout) |
| 879 | + |
| 880 | + except subprocess.SubprocessError: |
| 881 | + logger.warning("ERROR: Plotting failed. Please review logfile {} for error diagnostics.".format(file_output)) |
| 882 | + |
| 883 | + fout.close() |
| 884 | + |
847 | 885 | comm.send(1, dest=0, tag=2) |
848 | 886 |
|
849 | 887 | else: |
|
1021 | 1059 | except subprocess.SubprocessError: |
1022 | 1060 | logger.warning("ERROR: Evaluation for model {} failed. Please review logfile {} for error diagnostics.".format(model_name, file_output)) |
1023 | 1061 |
|
1024 | | - |
1025 | 1062 | # Close the training plugin log file |
1026 | 1063 | fout.close() |
1027 | 1064 |
|
|
1053 | 1090 | logger.warning("INFO: Received task list {} from manager.".format(task_list)) |
1054 | 1091 |
|
1055 | 1092 | if task_list != []: |
| 1093 | + logger.warning("INFO: Beginning cleaning stage plotting.") |
| 1094 | + |
| 1095 | + for task in task_list: |
| 1096 | + logger.warning("INFO: Generating plot {}.".format(task[2])) |
| 1097 | + file_output = "data/.logs/worker-3/{}-plot-{}".format(TIME, task[2]) |
| 1098 | + logger.warning("INFO: Saving output of plotting plugin to logfile {}.".format(file_output)) |
| 1099 | + fout = open(file_output, "wt") |
| 1100 | + |
| 1101 | + clean_param = clean_factory(task[1], task[2], task[3], ROOT_PATH) |
| 1102 | + |
| 1103 | + try: |
| 1104 | + subprocess.run([PYTHON_PATH, task[0], "clean", clean_param], stdout=fout, stderr=fout) |
| 1105 | + |
| 1106 | + except subprocess.SubprocessError: |
| 1107 | + logger.warning("ERROR: Plotting failed. Please review logfile {} for error diagnostics.".format(file_output)) |
| 1108 | + |
| 1109 | + fout.close() |
| 1110 | + |
1056 | 1111 | comm.send(1, dest=0, tag=3) |
1057 | 1112 |
|
1058 | 1113 | else: |
|
1230 | 1285 | except subprocess.SubprocessError: |
1231 | 1286 | logger.warning("ERROR: Evaluation for model {} failed. Please review logfile {} for error diagnostics.".format(model_name, file_output)) |
1232 | 1287 |
|
1233 | | - |
1234 | 1288 | # Close the training plugin log file |
1235 | 1289 | fout.close() |
1236 | 1290 |
|
|
1262 | 1316 | logger.warning("INFO: Received task list {} from manager.".format(task_list)) |
1263 | 1317 |
|
1264 | 1318 | if task_list != []: |
| 1319 | + logger.warning("INFO: Beginning cleaning stage plotting.") |
| 1320 | + |
| 1321 | + for task in task_list: |
| 1322 | + logger.warning("INFO: Generating plot {}.".format(task[2])) |
| 1323 | + file_output = "data/.logs/worker-4/{}-plot-{}".format(TIME, task[2]) |
| 1324 | + logger.warning("INFO: Saving output of plotting plugin to logfile {}.".format(file_output)) |
| 1325 | + fout = open(file_output, "wt") |
| 1326 | + |
| 1327 | + clean_param = clean_factory(task[1], task[2], task[3], ROOT_PATH) |
| 1328 | + |
| 1329 | + try: |
| 1330 | + subprocess.run([PYTHON_PATH, task[0], "clean", clean_param], stdout=fout, stderr=fout) |
| 1331 | + |
| 1332 | + except subprocess.SubprocessError: |
| 1333 | + logger.warning("ERROR: Plotting failed. Please review logfile {} for error diagnostics.".format(file_output)) |
| 1334 | + |
| 1335 | + fout.close() |
| 1336 | + |
1265 | 1337 | comm.send(1, dest=0, tag=4) |
1266 | 1338 |
|
1267 | 1339 | else: |
|
1439 | 1511 | except subprocess.SubprocessError: |
1440 | 1512 | logger.warning("ERROR: Evaluation for model {} failed. Please review logfile {} for error diagnostics.".format(model_name, file_output)) |
1441 | 1513 |
|
1442 | | - |
1443 | 1514 | # Close the training plugin log file |
1444 | 1515 | fout.close() |
1445 | 1516 |
|
|
1471 | 1542 | logger.warning("INFO: Received task list {} from manager.".format(task_list)) |
1472 | 1543 |
|
1473 | 1544 | if task_list != []: |
| 1545 | + logger.warning("INFO: Beginning cleaning stage plotting.") |
| 1546 | + |
| 1547 | + for task in task_list: |
| 1548 | + logger.warning("INFO: Generating plot {}.".format(task[2])) |
| 1549 | + file_output = "data/.logs/worker-5/{}-plot-{}".format(TIME, task[2]) |
| 1550 | + logger.warning("INFO: Saving output of plotting plugin to logfile {}.".format(file_output)) |
| 1551 | + fout = open(file_output, "wt") |
| 1552 | + |
| 1553 | + clean_param = clean_factory(task[1], task[2], task[3], ROOT_PATH) |
| 1554 | + |
| 1555 | + try: |
| 1556 | + subprocess.run([PYTHON_PATH, task[0], "clean", clean_param], stdout=fout, stderr=fout) |
| 1557 | + |
| 1558 | + except subprocess.SubprocessError: |
| 1559 | + logger.warning("ERROR: Plotting failed. Please review logfile {} for error diagnostics.".format(file_output)) |
| 1560 | + |
| 1561 | + fout.close() |
| 1562 | + |
1474 | 1563 | comm.send(1, dest=0, tag=5) |
1475 | 1564 |
|
1476 | 1565 | else: |
|
1648 | 1737 | except subprocess.SubprocessError: |
1649 | 1738 | logger.warning("ERROR: Evaluation for model {} failed. Please review logfile {} for error diagnostics.".format(model_name, file_output)) |
1650 | 1739 |
|
1651 | | - |
1652 | 1740 | # Close the training plugin log file |
1653 | 1741 | fout.close() |
1654 | 1742 |
|
|
1680 | 1768 | logger.warning("INFO: Received task list {} from manager.".format(task_list)) |
1681 | 1769 |
|
1682 | 1770 | if task_list != []: |
| 1771 | + logger.warning("INFO: Beginning cleaning stage plotting.") |
| 1772 | + |
| 1773 | + for task in task_list: |
| 1774 | + logger.warning("INFO: Generating plot {}.".format(task[2])) |
| 1775 | + file_output = "data/.logs/worker-6/{}-plot-{}".format(TIME, task[2]) |
| 1776 | + logger.warning("INFO: Saving output of plotting plugin to logfile {}.".format(file_output)) |
| 1777 | + fout = open(file_output, "wt") |
| 1778 | + |
| 1779 | + clean_param = clean_factory(task[1], task[2], task[3], ROOT_PATH) |
| 1780 | + |
| 1781 | + try: |
| 1782 | + subprocess.run([PYTHON_PATH, task[0], "clean", clean_param], stdout=fout, stderr=fout) |
| 1783 | + |
| 1784 | + except subprocess.SubprocessError: |
| 1785 | + logger.warning("ERROR: Plotting failed. Please review logfile {} for error diagnostics.".format(file_output)) |
| 1786 | + |
| 1787 | + fout.close() |
| 1788 | + |
1683 | 1789 | comm.send(1, dest=0, tag=6) |
1684 | 1790 |
|
1685 | 1791 | else: |
|
1857 | 1963 | except subprocess.SubprocessError: |
1858 | 1964 | logger.warning("ERROR: Evaluation for model {} failed. Please review logfile {} for error diagnostics.".format(model_name, file_output)) |
1859 | 1965 |
|
1860 | | - |
1861 | 1966 | # Close the training plugin log file |
1862 | 1967 | fout.close() |
1863 | 1968 |
|
|
1889 | 1994 | logger.warning("INFO: Received task list {} from manager.".format(task_list)) |
1890 | 1995 |
|
1891 | 1996 | if task_list != []: |
| 1997 | + logger.warning("INFO: Beginning cleaning stage plotting.") |
| 1998 | + |
| 1999 | + for task in task_list: |
| 2000 | + logger.warning("INFO: Generating plot {}.".format(task[2])) |
| 2001 | + file_output = "data/.logs/worker-7/{}-plot-{}".format(TIME, task[2]) |
| 2002 | + logger.warning("INFO: Saving output of plotting plugin to logfile {}.".format(file_output)) |
| 2003 | + fout = open(file_output, "wt") |
| 2004 | + |
| 2005 | + clean_param = clean_factory(task[1], task[2], task[3], ROOT_PATH) |
| 2006 | + |
| 2007 | + try: |
| 2008 | + subprocess.run([PYTHON_PATH, task[0], "clean", clean_param], stdout=fout, stderr=fout) |
| 2009 | + |
| 2010 | + except subprocess.SubprocessError: |
| 2011 | + logger.warning("ERROR: Plotting failed. Please review logfile {} for error diagnostics.".format(file_output)) |
| 2012 | + |
| 2013 | + fout.close() |
| 2014 | + |
1892 | 2015 | comm.send(1, dest=0, tag=7) |
1893 | 2016 |
|
1894 | 2017 | else: |
|
0 commit comments