Skip to content

Commit 7d092f6

Browse files
authored
Merge pull request #167 from benibela/main
add entry benibela
2 parents adf85e3 + dcecd68 commit 7d092f6

File tree

5 files changed

+1242
-0
lines changed

5 files changed

+1242
-0
lines changed

entries/benibela/README

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
Billion Row Challenge Solver
2+
============================
3+
4+
This Pascal program is designed to solve the "Billion Row Challenge." It utilizes multiple threads to efficiently process a large dataset and compute statistics for each unique key. The program makes use of a custom hashmap implementation and performs sorting and combining steps to produce the final results.
5+
6+
Usage
7+
-----
8+
9+
To run the program, provide the input file as a command-line argument:
10+
11+
`./brows inputfile`
12+
13+
Replace `inputfile` with the path to your input file.
14+
15+
Program Overview
16+
----------------
17+
18+
The program is structured into several parts:
19+
20+
2. **Thread Configuration:**
21+
22+
* `THREAD_COUNT`: The number of threads used by the program. It is set to 16 by default.
23+
24+
3. **Custom HashMap:**
25+
26+
* The program uses a custom hashmap implementation (`TBRMap`) based on either the fast hashmap (`TXQBaseHashmapStr`) or a standard dictionary (`TDictionary`).
27+
28+
4. **Sorting Algorithm:**
29+
30+
* The program employs a QuickSort algorithm for sorting arrays of pointers.
31+
32+
5. **Multithreading:**
33+
34+
* The program utilizes multiple threads (`TProcessTextThread` and `TCombineCountersThread`) to process and combine data efficiently.
35+
36+
6. **File I/O:**
37+
38+
* The input file is memory-mapped (`Fpmmap`) for efficient access and processing.
39+
40+
Compilation
41+
-----------
42+
43+
To compile the program, use the Free Pascal Compiler (FPC) with the following command:
44+
45+
46+
`fpc brows.pas`
47+
48+
This will generate an executable file named `brows`.
49+
50+
License
51+
-------
52+
53+
This program is provided under the GNU Lesser General Public License (LGPL).
54+
55+
56+
Author
57+
------
58+
59+
This program was developed by \[Benito van der Zander\].
60+
61+
Feel free to modify and enhance the program according to your needs!

entries/benibela/src/brows.lpi

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<CONFIG>
3+
<ProjectOptions>
4+
<Version Value="12"/>
5+
<PathDelim Value="\"/>
6+
<General>
7+
<Flags>
8+
<MainUnitHasCreateFormStatements Value="False"/>
9+
<MainUnitHasTitleStatement Value="False"/>
10+
<MainUnitHasScaledStatement Value="False"/>
11+
</Flags>
12+
<SessionStorage Value="InProjectDir"/>
13+
<Title Value="brows"/>
14+
<UseAppBundle Value="False"/>
15+
<ResourceType Value="res"/>
16+
</General>
17+
<BuildModes>
18+
<Item Name="default" Default="True"/>
19+
</BuildModes>
20+
<PublishOptions>
21+
<Version Value="2"/>
22+
<UseFileFilters Value="True"/>
23+
</PublishOptions>
24+
<RunParams>
25+
<FormatVersion Value="2"/>
26+
</RunParams>
27+
<Units>
28+
<Unit>
29+
<Filename Value="brows.lpr"/>
30+
<IsPartOfProject Value="True"/>
31+
</Unit>
32+
<Unit>
33+
<Filename Value="fasthashmap.pas"/>
34+
<IsPartOfProject Value="True"/>
35+
</Unit>
36+
<Unit>
37+
<Filename Value="mmaputils.pas"/>
38+
<IsPartOfProject Value="True"/>
39+
</Unit>
40+
</Units>
41+
</ProjectOptions>
42+
<CompilerOptions>
43+
<Version Value="11"/>
44+
<PathDelim Value="\"/>
45+
<SearchPaths>
46+
<IncludeFiles Value="$(ProjOutDir)"/>
47+
<OtherUnitFiles Value="U:\components\pascal\data;..\..\import\synapse;U:\components\pascal\internet;U:\components\lazarus\dialogs;U:\components\pascal\system;\home\benito\hg\components\pascal\data\;\home\benito\hg\programs\contests\euler\;\home\benito\hg\components\pascal\internet\;\home\benito\hg\components\lazarus\dialogs\;\home\benito\hg\components\pascal\system\;\home\benito\hg\components\pascal\import\regexpr\source\"/>
48+
<SrcPath Value="\home\benito\hg\components\pascal\import\synapse\;..\..\import\synapse"/>
49+
</SearchPaths>
50+
<CodeGeneration>
51+
<Optimizations>
52+
<OptimizationLevel Value="4"/>
53+
</Optimizations>
54+
</CodeGeneration>
55+
</CompilerOptions>
56+
<Debugging>
57+
<Exceptions>
58+
<Item>
59+
<Name Value="EAbort"/>
60+
</Item>
61+
<Item>
62+
<Name Value="ECodetoolError"/>
63+
</Item>
64+
<Item>
65+
<Name Value="EFOpenError"/>
66+
</Item>
67+
</Exceptions>
68+
</Debugging>
69+
</CONFIG>

0 commit comments

Comments
 (0)