Skip to main content
Log in

A new constant-time parallel algorithm for merging

  • Published:
The Journal of Supercomputing Aims and scope Submit manuscript

Abstract

Merging is the process of constructing a sorted array C from two sorted arrays A and B of lengths \(n_A\) and \(n_B,\) respectively, such that array C contains the elements of arrays A and B. The problem is a fundamental subroutine in many applications such as tree reconstruction, database design, and sorting. In this paper, we present a constant-time integer merging algorithm on a shared memory model with a concurrent read operation. No constant-time algorithm for integer merging on this model was designed previously. The algorithm, which is based on cross-rank and address strategy, works when the elements of the inputs belong to the integer domain. The presented algorithm has the following advantages:- (1) running in constant time; (2) stable; (3) simple; (4) optimal when the domain of integers is less than or equal to the size of the inputs and the number of processors is equal to size of the inputs; and (5) deterministic.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3

Similar content being viewed by others

References

  1. Akl S, Santoro N (1987) Optimal parallel merging and sorting without memory conflicts. IEEE Trans Comput C–36(l1):1367–1369

    Article  MathSciNet  Google Scholar 

  2. Bahig H (2008) Parallel merging with restrictions. J Supercomput 43(1):99–104

    Article  MATH  Google Scholar 

  3. Bahig H (2011) Integer merging on PRAM. Computing 91(4):365–378

    Article  MathSciNet  MATH  Google Scholar 

  4. Bang-Jensen J, Huang J, Ibarra L (2007) Recognizing and representing proper interval graphs in parallel using merging and sorting. Discrete Appl Math 155(4):442–456

    Article  MathSciNet  MATH  Google Scholar 

  5. Berkman O, Vishkin U (1993) On parallel integer merging. Inf Comput 106:266–285

    Article  MathSciNet  MATH  Google Scholar 

  6. Bhatt P, Diks K, Hagerup T, Prasad V, Radzik T, Saxena S (1991) Improved deterministic parallel integer sorting. Inf Comput 94(1):29–47

    Article  MathSciNet  MATH  Google Scholar 

  7. Deo N, Jain A, Medidi M (1994) An optimal parallel algorithm for merging using multiselection. Inf Process Lett 50(2):81–88

    Article  MATH  Google Scholar 

  8. Deo N, Sarak D (1990) Parallel algorithms for merging and sorting. Inf Sci 51:121–131

    Article  Google Scholar 

  9. van Gelder A (1989) PRAM processor allocation: a hidden bottleneck in sublogarithmic algorithms. IEEE Trans Comput Arch 38(2):289–292

    Article  MathSciNet  MATH  Google Scholar 

  10. Green O, McColl R, Bader D (2012) GPU merge path: a GPU merging algorithm. In: The 26th ACM International Conference on Supercomputing, San Servolo Island, Venice, Italy June 25–29, pp 331–340

  11. Hagerup T, Kutylowski M (1997) Fast integer merging on the EREW PRAM. Algorithmica 17:55–66

    Article  MathSciNet  MATH  Google Scholar 

  12. Hagerup T, Rub C (1989) Optimal merging and sorting on the EREW PRAM. Inf Process Lett 33(4):181–185

    Article  MathSciNet  MATH  Google Scholar 

  13. Katajainen J, Levcopoulos C, Petersson O (1993) Space-efficient parallel merging. RAIRO Theor Inf Appl 27(4):295–310

    Article  MathSciNet  MATH  Google Scholar 

  14. Katsinis C (2004) Merging, sorting and matrix operations on the SOME-Bus multiprocessor architecture. Future Gener Comput Syst 20(4):643–661

    Article  Google Scholar 

  15. Kruskal C (1983) Searching, merging, and sorting in parallel computation. IEEE Trans Comput 32(10):942–946

    Article  MathSciNet  MATH  Google Scholar 

  16. Kubica M, Kulczynski T, Radoszewski J, Rytter W, Walen T (2013) A linear time algorithm for consecutive permutation pattern matching. Inf Process Lett 113:430–433

    Article  MathSciNet  MATH  Google Scholar 

  17. Laga A, Boukhobza J, Singhoff F, Koskas M (2017) Montres: merge on-the-run external sorting algorithm for large data volumes on SSD based storage systems. IEEE Trans Comput 66(10):1689–1702

    Article  MathSciNet  MATH  Google Scholar 

  18. Juneam N, Kantabutra S (2017) Fast and efficient parallel coarsest refinement. Fundam Inf 150:211–220

    Article  MathSciNet  MATH  Google Scholar 

  19. Mashimo S, Van Chu T, Kise K (2017) High-performance hardware merge sorter. In: 25th Annual International Symposium on Field-Programmable Custom Computing Machines, pp 1–8

  20. Matthews S, Williams T (2011) An efficient and extensible approach for compressing phylogenetic trees. BMC Bioinform 12(Suppl 10):S16

    Article  Google Scholar 

  21. Odeh S, Green O, Mwassi Z, Shmueli O, Birk Y (2012) Merge path—parallel merging made simple. In: 26th International Parallel and Distributed Processing Symposium Workshops and PhD Forum (IPDPSW), 21–25 May, pp 1611–1618

  22. OpenMP API User’s Guide. https://docs.oracle.com/cd/E19059-01/stud.10/819-0501/index.html

  23. Rajasekaran S, Sen S (1992) On parallel integer sorting. Acta Inf 29(1):1–15

    Article  MathSciNet  MATH  Google Scholar 

  24. Salah A, Li K, Li K (2016) Lazy-merge: a novel implementation for indexed parallel k-way in-place merging. IEEE Trans Parallel Distrib Syst 27(7):2049–2061

    Article  Google Scholar 

  25. Salton G (1989) Automatic text processing: the transformation, analysis, and retrieval of information by computer. Addison-Wesley, Reading

    Google Scholar 

  26. Sklyarov V, Skliarova I, Rjabov A, Sudnitson A (2017) Fast iterative circuits and RAM-based mergers to accelerate data sort in software/hardware systems. Proc Est Acad Sci 66(3):323–33

    Article  MATH  Google Scholar 

  27. Uyar A (2014) Parallel merge sort with double merging. In: 8th International Conference on Application of Information and Communication Technologies (AICT), 15–17 Oct, pp 490–494

  28. Xiang L, Ushijima K (2000) Optimal parallel merging algorithms on BSR, In: International Symposium on Parallel Architectures, Algorithms and Networks, 7–9 Dec, pp 12–17

  29. Zhong C, Wei W (2013) Efficient parallel multi-way merging on heterogeneous multi-core cluster. In: International Conference on Parallel Computing in Fluid Dynamics, 20–24 May , pp 112–123

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Hazem M. Bahig.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Bahig, H.M. A new constant-time parallel algorithm for merging. J Supercomput 75, 968–983 (2019). https://doi.org/10.1007/s11227-018-2623-z

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11227-018-2623-z

Keywords

Navigation