Paraphrasing: Generating Parallel Programs Using Refactoring

  • Christopher Brown
  • Kevin Hammond
  • Marco Danelutto
  • Peter Kilpatrick
  • Holger Schöner
  • Tino Breddin
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7542)


Refactoring is the process of changing the structure of a program without changing its behaviour. Refactoring has so far only really been deployed effectively for sequential programs. However, with the increased availability of multicore (and, soon, manycore) systems, refactoring can play an important role in helping both expert and non-expert parallel programmers structure and implement their parallel programs. This paper describes the design of a new refactoring tool that is aimed at increasing the programmability of parallel systems. To motivate our design, we refactor a number of examples in C, C++ and Erlang into good parallel implementations, using a set of formal pattern rewrite rules.


Matrix Factorization Sequential Program Parallel Pattern Program Transformation Stochastic Gradient Descent 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Netflix Prize Forum/Grand Prize Award (September 2009),
  2. 2.
    Aldinucci, M., Danelutto, M.: Stream Parallel Skeleton Optimization. In: Proc. of PDCS: Intl. Conference on Parallel and Distributed Computing and Systems, pp. 955–962. IASTED, ACTA Press, Cambridge, Massachusetts (1999)Google Scholar
  3. 3.
    Aldinucci, M., Danelutto, M., Kilpatrick, P., Meneghin, M., Torquati, M.: Accelerating Code on Multi-cores with FastFlow. In: Jeannot, E., Namyst, R., Roman, J. (eds.) Euro-Par 2011, Part II. LNCS, vol. 6853, pp. 170–181. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  4. 4.
    Backus, J.: Can Programming be Liberated from the von Neumann Style? Communications of the ACM 21(8), 613–641 (1978)MathSciNetCrossRefzbMATHGoogle Scholar
  5. 5.
    Benkner, S., Pllana, S., Träff, J.L., Tsigas, P., Dolinsky, U., Augonnet, C., Bachmayer, B., Kessler, C.W., Moloney, D., Osipov, V.: PEPPHER: Efficient and Productive Usage of Hybrid Computing Systems. IEEE Micro 31(5), 28–41 (2011)CrossRefGoogle Scholar
  6. 6.
    Bird, R.S.: Lectures on Constructive Functional Programming. In: Broy, M. (ed.) Constructive Methods in Computer Science. NATO ASI Series F, vol. 55, pp. 151–218. Springer (1988); Also available as Technical Monograph PRG-69, from the Programming Research Group, Oxford UniversityGoogle Scholar
  7. 7.
    Bravenboer, M., Kalleberg, K.T., Vermaas, R., Visser, E.: Stratego/xt 0.17. A Language and Toolset for Program Transformation. Sci. Comput. Program. 72(1-2), 52–70 (2008)MathSciNetCrossRefGoogle Scholar
  8. 8.
    Brown, C., Li, H., Thompson, S.: An Expression Processor: A Case Study in Refactoring Haskell Programs. In: Page, R., Horváth, Z., Zsók, V. (eds.) TFP 2010. LNCS, vol. 6546, pp. 31–49. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  9. 9.
    Brown, C., Loidl, H.-W., Hammond, K.: ParaForming: Forming Parallel Haskell Programs Using Novel Refactoring Techniques. In: Peña, R., Page, R. (eds.) TFP 2011. LNCS, vol. 7193, pp. 82–97. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  10. 10.
    Burstall, R.M., Darlington, J.: A Transformation System for Developing Recursive Programs. J. ACM 24(1), 44–67 (1977)MathSciNetCrossRefzbMATHGoogle Scholar
  11. 11.
    Cesarini, F., Thompson, S.: ERLANG Programming, 1st edn. O’Reilly Media, Inc. (2009)Google Scholar
  12. 12.
    Dig, D.: A Refactoring Approach to Parallelism. IEEE Softw. 28, 17–22 (2011)CrossRefGoogle Scholar
  13. 13.
    Gemulla, R., Haas, P.J., Sismanis, Y., Teflioudi, C., Makari, F.: Large-Scale Matrix Factorization with Distributed Stochastic Gradient Descent. In: NIPS 2011 Workshop on Big Learning, Sierra Nevada, Spain (December 2011)Google Scholar
  14. 14.
    Hammond, K., Aldinucci, M., Brown, C., Cesarini, F., Danelutto, M., González-Vélez, H., Kilpatrick, P., Keller, R., Rossbory, M., Shainer, G.: The ParaPhrase: Project: Parallel Patterns for Adaptive Heterogeneous Multicore Systems. In: Beckert, B., de Boer, F., Bonsangue, M., Damiani, F. (eds.) FMCO 2011. LNCS, vol. 7542, pp. 218–236. Springer, Heidelberg (2012)Google Scholar
  15. 15.
    Klusik, U., Loogen, R., Priebe, S., Rubio, F.: Implementation Skeletons in Eden: Low-Effort Parallel Programming. In: Mohnen, M., Koopman, P. (eds.) IFL 2000. LNCS, vol. 2011, pp. 71–88. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  16. 16.
    Koren, Y., Bell, R., Volinsky, C.: Matrix Factorization Techniques for Recommender Systems. IEEE Computer 42(8), 30–37 (2009)CrossRefGoogle Scholar
  17. 17.
    Li, H., Thompson, S.: A Comparative Study of Refactoring Haskell and Erlang Programs. In: SCAM 2006, pp. 197–206. IEEE (September 2006)Google Scholar
  18. 18.
    Li, H., Thompson, S.: A Domain-Specific Language for Scripting Refactorings in Erlang. Technical Report 5-11, University of Kent (October 2011)Google Scholar
  19. 19.
    Li, H., Thompson, S.: A User-extensible Refactoring Tool for Erlang Programs. Technical Report 4-11, University of Kent (October 2011)Google Scholar
  20. 20.
    Matsuzaki, K., Iwasaki, H., Emoto, K., Hu, Z.: A Library of Constructive Skeletons for Sequential Style of Parallel Programming. In: Proceedings of the 1st International Conference on Scalable Information Systems, InfoScale 2006. ACM, New York (2006)Google Scholar
  21. 21.
    Mens, T., Tourwé, T.: A Survey of Software Refactoring. IEEE Trans. Softw. Eng. 30(2), 126–139 (2004)CrossRefGoogle Scholar
  22. 22.
    Moore, G.E.: Cramming more components onto integrated circuits. In: Readings in Computer Architecture, pp. 56–59. Morgan Kaufmann Publishers Inc., San Francisco (2000)Google Scholar
  23. 23.
    Nugteren, C., Corporaal, H., Mesman, B.: Skeleton-based Automatic Parallelization of Image Processing Algorithms for GPUs. In: ICSAMOS 2011, pp. 25–32 (2011)Google Scholar
  24. 24.
    Opdyke, W.F.: Refactoring Object-Oriented Frameworks. PhD thesis, Department of Computer Science, University of Illinois at Urbana-Champaign, Champaign, IL, USA (1992)Google Scholar
  25. 25.
    Padioleau, Y., Lawall, J.L., Muller, G.: SmPL: A Domain-Specific Language for Specifying Collateral evolutions in Linux device drivers. In: International ERCIM Workshop on Software Evolution, Lille, France (April 2006)Google Scholar
  26. 26.
    Partsch, H., Steinbruggen, R.: Program Transformation Systems. ACM Comput. Surv. 15(3), 199–236 (1983)MathSciNetCrossRefGoogle Scholar
  27. 27.
    Sankaran, S., Squyres, J.M., Barrett, B., Lumsdaine, A., Duell, J., Hargrove, P., Roman, E.: The LAM/MPI Checkpoint/Restart Framework: System-Initiated Checkpointing. International Journal of High Performance Computing Applications 19(4), 479–493 (2005)CrossRefGoogle Scholar
  28. 28.
    Skillicorn, D.B.: The Bird-Meertens Formalism as a Parallel Model. In: Software for Parallel Computation. NATO ASI Series F, vol. 106, pp. 120–133. Springer (1993)Google Scholar
  29. 29.
    Wloka, J., Sridharan, M., Tip, F.: Refactoring for Reentrancy. In: ESEC/FSE 2009, pp. 173–182. ACM, Amsterdam (2009)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Christopher Brown
    • 1
  • Kevin Hammond
    • 1
  • Marco Danelutto
    • 2
  • Peter Kilpatrick
    • 3
  • Holger Schöner
    • 4
  • Tino Breddin
    • 5
  1. 1.School of Computer ScienceUniversity of St. AndrewsScotlandUK
  2. 2.Dept. Computer ScienceUniv. PisaPisaItaly
  3. 3.Sch. Electronics, Electrical Eng. and Comp. Sci.Queen’s University BelfastUK
  4. 4.Software Competence Centre Hagenberg GmbHAustria
  5. 5.Erlang SolutionsLondonUK

Personalised recommendations