Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. export all_dirs=a20[w-z]
  4.  
  5. for dir in $all_dirs; do
  6. [ -d "${dir}" ] || continue # if not a directory, skip
  7. cd $dir/run
  8. echo 'cd into directory:' `pwd`
  9. grep walltotal timing*/model_timing_stats; grep integration timing*/model_timing_stats
  10. cd ../..
  11. done
  12.  
  13. echo
  14. echo "Summary, for plotting:"
  15. for dir in $all_dirs; do
  16. [ -d "${dir}" ] || continue # if not a directory, skip
  17. cd $dir/run
  18. echo $dir ' ' \
  19. `grep 'i:time integration' timing*/model_timing_stats | cut -c 48-58` \
  20. `grep 'i:time integration' timing*/model_timing_stats | cut -c 95-105` \
  21. `grep 'o:time integration' timing*/model_timing_stats | cut -c 48-58` \
  22. `grep 'o:time integration' timing*/model_timing_stats | cut -c 95-105`
  23. cd ../..
  24. done
  25.  
  26. echo
  27. echo "Copy into python for plotting:"
  28. echo "data = np.array(["
  29. for dir in $all_dirs; do
  30. [ -d "${dir}" ] || continue # if not a directory, skip
  31. cd $dir/run
  32. echo ' [' \
  33. `grep 'i:time integration' timing*/model_timing_stats | cut -c 48-58` ', '\
  34. `grep 'i:time integration' timing*/model_timing_stats | cut -c 95-105` ', '\
  35. `grep 'o:time integration' timing*/model_timing_stats | cut -c 48-58` ', '\
  36. `grep 'o:time integration' timing*/model_timing_stats | cut -c 95-105` \
  37. ' ],'
  38. cd ../..
  39. done
  40. echo " ])"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement