Skip to content

Commit f53c952

Browse files
committed
Wrote about use of OpenMP in parallelization for fsort() (involving condensed details for forder, fsort and reorder C files after some digging and understanding of the code)
1 parent 79d7b01 commit f53c952

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

man/openmp-utils.Rd

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
5757
\item\file{coalesce.c} - \code{\link{fcoalesce}()}
5858
59-
Parallelism is used here to reduce the time taken to fill NA values with the first non-NA value from other vectors. Operates over columns to replace NAs. OpenMP is used here to parallelize:
59+
Parallelism is used here to reduce the time taken to replace NA values with the first non-NA value from other vectors. OpenMP is used here to parallelize:
6060
\itemize{
6161
\item The operation that iterates over the rows to coalesce the data (which can be of type integer, real, or complex)
6262
\item The replacement of NAs with non-NA values from subsequent vectors
@@ -78,6 +78,16 @@
7878
There are no explicit pragmas for parallelizing loops, and instead the use of OpenMP here is in controlling access to shared resources (with the use of critical sections, for instance) in a multi-threaded environment.
7979
8080
\item\file{forder.c}, \file{fsort.c}, and \file{reorder.c} - \code{\link{forder}()} and related
81+
82+
Parallelism is used here in multiple operations that come together to sort a \code{data.table} using the Radix algorithm. OpenMP is used here to parallelize:
83+
84+
\itemize{
85+
\item The counting of unique values and recursively sorting subsets of data across different threads (specific to \file{forder.c})
86+
\item The process of finding the range and distribution of data for efficient grouping and sorting (applies for both \file{forder.c} and \file{fsort.c})
87+
\item Creation of histograms which are used to sort data based on significant bits (each thread processes a separate batch of the data, computes the MSB of each element, and then increments the corresponding bins), with the distribution and merging of buckets (specific to \file{fsort.c})
88+
\item The process of reordering a vector or each column in a list of vectors (such as in a \code{data.table}) based on a given vector that dictates the new ordering of elements (specific to \file{reorder.c})
89+
}
90+
8191
\item\file{froll.c}, \file{frolladaptive.c}, and \file{frollR.c} - \code{\link{froll}()} and family
8292
\item\file{fwrite.c} - \code{\link{fwrite}()}
8393

0 commit comments

Comments
 (0)