Abstract
Declarative Programming Languages (DPLs) apply a process model of Horn clauses such as PARLOG[8] or a reduction model of λ-calculus such as SML[7] and are, in principle, well suited to multiprocessor implementation. However, the performance of a parallel declarative program can be impaired by a mismatch between the parallelism available in an application and the parallelism available in the architecture. A particularly attractive solution is to automatically match the parallelism of the program to the parallelism of the target hardware as a compilation step. In this paper, we present an optimizing compilation technique called granularity analysis which identifies and removes excess parallelism that would degrade performance. The main steps are: an analysis of the flow of data to form an attributed call graph between function (or predicate) arguments; and an asymptotic estimation of granularity of a function (or predicate) to generate approximate grain size. Compiled procedure calls can be annotated with grain size and a task scheduler can make scheduling decisions with the classification scheme of grains to control parallelism at run-time. The resulting granularity analysis scheme is suitable for exploiting adaptive parallelism of declarative programming languages on multiprocessors.
Similar content being viewed by others
References
Chang J H, DeGroot D. AND-parallelism of logic programs based on static data dependency analysis. In: Proc. of the 30th IEEE Conputer Society Int'l Conf., Feb. 1985, 218–226.
Conery J S, Kibler D F. AND-parallel and non-determinism in logic program. New Generation Computer, 1985, 3(1): 43–70.
DeGroot D. Restricted AND-parallelism. In: Proc. of Int'l Conf. on Fifth Generation Computer System, 1984, 47, Tokyo.
Goldberg B E. Multiprocessor execution of functional programs. International Journal of Parallel Programming, 1988, 17(5): 425–473.
Hudak P, Goldberg B E. Serial combinator: optimal grains of parallelism. LNCS 201, Springer-Verlag, Sept. 1985, 382–388.
McCreary C, Gill H. Automatic determination of grain size for efficient parallel processing. Communication of ACM, Sept. 1989, 1073–1078.
Milner R, Mitchell. Introduction to standard ML. Computer Science Department, University of Edinburgh, 1987, UK.
Papadopoulos G A. A high-level parallel implementation of PARLOG. Internal Report SYSC88-05, University of East Anglia, 1988, UK.
Sarkar V. Partitioning and Scheduling Parallel Programs for Multiprocessors. London: Pitman, 1989.
Tian X M, Wang D X, Shen M M, Zheng W M. A practical eager-lazy control method for dynamic deriving parallel tasks (in Chinese). Journal of Software, 1991, 2(5):1–8.
Tian X M, Wang D X, Shen M M, Zheng W M. An optimized parallel compiler for executing declarative programs on transputer array. In: Proc. of 15th World Transputer/Occam Conference, Apr. 1992 Aberdeen, UK.
Tian X M, Wang D X, Shen M M, Zheng W M. A parallel graph rewriting abstract machine and its efficient execution mechanism. In: Proc. of 1992 National Intelligent Information Technical Conference, Apr. 1992, Beijing.
Tian X M, Wang D X, Shen M M, Zheng W M. Heuristic compile-time granularity analysis of parallel graph rewriting language CGRL. Technical Report TR-9207-01, Tsinghua University, July 1992.
Tick E. Compile-time granularity analysis for parallel logic programming languages. In: Proc. of Int'l Conf. on Fifth Generation Computer Systems, Nov. 1988, 494–1000, Tokyo, Japan.
Wang D Xet al. A high-level compiling implementation of PARLOG based on extended graph rewriting. In: Proc. of Tools for Artifitial Intelligence 90, Washington D C, Nov. 1990.
Zhou G M, Tian X M, Wang D X, Wen D C. Strictness analysis based on projection. In: Proc. of 5th National Logic Programming Languages Conference, Oct. 1991, 8–14, Changsha, China.
Author information
Authors and Affiliations
Additional information
This work was partially supported by the National Natural Science Foundation of China under Grant 863-306-101 and the National Doctoral Subject Foundation under Grant 0249136.
Rights and permissions
About this article
Cite this article
Tian, X., Wang, D., Shen, M. et al. Granularity analysis for exploiting adaptive parallelism of declarative programs on multiprocessors. J. of Compt. Sci. & Technol. 9, 144–152 (1994). https://doi.org/10.1007/BF02939495
Received:
Revised:
Issue Date:
DOI: https://doi.org/10.1007/BF02939495