Automatic Parallelization of C Code Using OpenMP

  • Gaurav SingalEmail author
  • Dinesh Gopalani
  • Riti Kushwaha
  • Tapas Badal
Conference paper
Part of the Communications in Computer and Information Science book series (CCIS, volume 985)


Automatic parallelization is necessary for all system. Every person wants the program to execute as soon as possible. Now Days, programmer want to get run faster the sequential program. Automatic parallelization is the greatest challenge in now days. Parallelization implies converting the sequential code to parallel code to getting better utilization of multi-core processor. In parallelization, multi-core use the memory in sharing mode or massage passing. Now day’s programmers don’t want to take extra overheads of parallelization because they want it from the compiler that’s called automatic parallelization. Its main reason is to free the programmers from manual parallelization process. The conversion of a program into parallelize form is very complex work due to program analysis and an unknown value of the variable during compile time. The main reason of conversion is execution time of program due to loops, so the most challenging task is to parallelize the loops and run it on multi-core by breaking the loop iterations. In parallelization process, the compiler must have to check the dependent between loop statements that they are independent of each other. If they are dependent or effect the other statement by running the statement in parallel, so it does not convert it. After checking the dependency, test converts it into parallelization by using OpenMP API. We add some line of OpenMP for enabling parallelization in the loop.


OpenMP Automatic parallelization Data dependency C programming Lex and Yacc Language 


  1. 1.
    Li, Z., Yew, P.C., Zhu, C.Q.: An efficient data dependence analysis for parallelizing compilers. IEEE Trans. Parallel Distrib. Syst. 1(1), 26–34 (1990)CrossRefGoogle Scholar
  2. 2.
    Eigenmann, R., Hoeflinger, J., Padua, D.: On the automatic parallelization of the perfect benchmarks. IEEE Trans. Parallel Distrib. Syst. 9(1), 5–23 (1998)CrossRefGoogle Scholar
  3. 3.
    Banerjee, U.K.: Loop Parallelization. Kluwer Academic Publishers, Norwell (1994)CrossRefGoogle Scholar
  4. 4.
    Levine, J.R., Mason, T., Brown, D.: lex & yacc O’Reilly & Associates. Sebastopol (1990)Google Scholar
  5. 5.
    Chapman, B., Jost, G., Van Der Pas, R.: Using OpenMP: portable shared memory parallel programming, vol. 10. MIT press, Cambridge (2008)Google Scholar
  6. 6.
    Pugh, W., Wonnacott, D.: Eliminating false data dependences using the omega test. In: ACM SIGPLAN Notices, vol. 27, pp. 140–151. ACM (1992)Google Scholar
  7. 7.
    Kyriakopoulos, K., Psarris, K.: Efficient techniques for advanced data dependence analysis. In: Proceedings of the 14th International Conference on Parallel Architectures and Compilation Techniques, PACT 2005, pp. 143–156, Washington, DC, USA. IEEE Computer Society (2005)Google Scholar
  8. 8.
    Burke, M., Cytron, R.: Interprocedural dependence analysis and parallelization. SIGPLAN Not. 21(7), 162–175 (1986)CrossRefGoogle Scholar
  9. 9.
    Psarris, K., Kyriakopoulos, K.: An experimental evaluation of data dependence analysis techniques. IEEE Trans. Parallel Distrib. Syst. 15(3), 196–213 (2004)CrossRefGoogle Scholar
  10. 10.
    Pugh, W.: A practical algorithm for exact array dependence analysis. Commun. ACM 35(8), 102–114 (1992)CrossRefGoogle Scholar
  11. 11.
    Psarris, K.: The Banerjee-Wolfe and GCD tests on exact data dependence information. J. Parallel Distrib. Comput. 32(2), 119–138 (1996)MathSciNetCrossRefGoogle Scholar
  12. 12.
    Pugh, W.: The omega test: a fast and practical integer programming algorithm for dependence analysis. In: Proceedings of the 1991 ACM/IEEE Conference on Supercomputing, Supercomputing 1991, pp. 4–13, New York, NY, USA. ACM (1991)Google Scholar

Copyright information

© Springer Nature Singapore Pte Ltd. 2019

Authors and Affiliations

  • Gaurav Singal
    • 1
    Email author
  • Dinesh Gopalani
    • 2
  • Riti Kushwaha
    • 2
  • Tapas Badal
    • 1
  1. 1.CSE DepartmentBennett UniversityGreater NoidaIndia
  2. 2.Department of CSEMNITJaipurIndia

Personalised recommendations