cArrayGraph.py 819 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Stephen Stengel <stephen.stengel@cwu.edu> 40819903
  5. #C array grapher
  6. import sys
  7. import os
  8. import plotting
  9. def main(args):
  10. if len(args) != 4:
  11. print("bad input");
  12. sys.exit(-1)
  13. else:
  14. filename = sys.argv[1]
  15. picFile = sys.argv[2]
  16. testType = sys.argv[3]
  17. #m n t time name
  18. data = plotting.readListListFromFile(filename)
  19. # ~ X, Y, Z = plotting.convertToThreeArrays(data)
  20. M, N, T, TIME, NAME = plotting.convertToFiveArrays(data)
  21. print("Still working!")
  22. plotting.printGraph(M, T, TIME,
  23. "Time for " + str(testType) + " Method.",
  24. "Square Size (M)", "Threads (T)", "Time in seconds", picFile)
  25. os.system("sync")
  26. # ~ os.system(f"optipng ../pics/{picOutName}.png")
  27. return 0
  28. if __name__ == '__main__':
  29. import sys
  30. sys.exit(main(sys.argv))