Skip to content

Commit d065bdf

Browse files
authored
Merge pull request #8 from ashvardanian/main-dev
Stress Test & Fix Race Conditions Closes #5
2 parents 33751fb + 6e6f81a commit d065bdf

File tree

12 files changed

+1900
-743
lines changed

12 files changed

+1900
-743
lines changed

.vscode/launch.json

Lines changed: 83 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"version": "0.2.0",
66
"configurations": [
77
{
8-
"name": "Debug",
8+
"name": "Debug with GDB",
99
"type": "cppdbg",
1010
"request": "launch",
11-
"preLaunchTask": "Build: Debug",
11+
"preLaunchTask": "Build: Debug with GDB",
1212
"program": "${workspaceFolder}/build_debug/scripts/fork_union_test_cpp20",
1313
"cwd": "${workspaceFolder}",
1414
"args": [],
@@ -17,7 +17,13 @@
1717
"description": "Enable pretty-printing for gdb",
1818
"text": "-enable-pretty-printing",
1919
"ignoreFailures": true
20-
}
20+
},
21+
{
22+
"text": "break abort"
23+
},
24+
{
25+
"text": "break exit"
26+
},
2127
],
2228
"environment": [
2329
{
@@ -29,14 +35,85 @@
2935
"linux": {
3036
"MIMode": "gdb"
3137
},
32-
"osx": {
33-
"MIMode": "lldb"
34-
},
3538
"windows": {
3639
"program": "${workspaceFolder}\\build_debug\\scripts\\fork_union_test_cpp20.exe",
3740
"MIMode": "gdb",
3841
"miDebuggerPath": "C:\\MinGw\\bin\\gdb.exe"
3942
}
43+
},
44+
{
45+
"name": "Debug with LLDB",
46+
"type": "cppdbg",
47+
"request": "launch",
48+
"preLaunchTask": "Build: Debug with LLDB",
49+
"program": "${workspaceFolder}/build_debug/scripts/fork_union_test_cpp20",
50+
"cwd": "${workspaceFolder}",
51+
"args": [],
52+
"setupCommands": [
53+
{ // Display content in STL containers pretty
54+
"description": "Enable pretty-printing for gdb",
55+
"text": "-enable-pretty-printing",
56+
"ignoreFailures": true
57+
}
58+
],
59+
"environment": [
60+
{
61+
"name": "ASAN_OPTIONS",
62+
"value": "detect_leaks=0:atexit=1:strict_init_order=1:strict_string_checks=1"
63+
}
64+
],
65+
"stopAtEntry": false,
66+
"linux": {
67+
"MIMode": "gdb"
68+
},
69+
"osx": {
70+
"MIMode": "lldb"
71+
},
72+
},
73+
{
74+
"name": "Debug N-Body with GDB",
75+
"type": "cppdbg",
76+
"request": "launch",
77+
"preLaunchTask": "Build: Debug with GDB",
78+
"program": "${workspaceFolder}/build_debug/scripts/fork_union_nbody",
79+
"cwd": "${workspaceFolder}",
80+
"args": [],
81+
"setupCommands": [
82+
{ // Display content in STL containers pretty
83+
"description": "Enable pretty-printing for gdb",
84+
"text": "-enable-pretty-printing",
85+
"ignoreFailures": true
86+
}
87+
],
88+
"environment": [
89+
{
90+
"name": "ASAN_OPTIONS",
91+
"value": "detect_leaks=0:atexit=1:strict_init_order=1:strict_string_checks=1"
92+
},
93+
{
94+
"name": "NBODY_COUNT",
95+
"value": "128"
96+
},
97+
{
98+
"name": "NBODY_THREADS",
99+
"value": "17"
100+
},
101+
{
102+
"name": "NBODY_ITERATIONS",
103+
"value": "1000000"
104+
},
105+
{
106+
"name": "NBODY_BACKEND",
107+
"value": "fork_union_dynamic"
108+
},
109+
],
110+
"stopAtEntry": false,
111+
"linux": {
112+
"MIMode": "gdb"
113+
},
114+
"osx": {
115+
"MIMode": "lldb"
116+
},
40117
}
41118
]
42119
}

.vscode/settings.json

Lines changed: 93 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,95 @@
11
{
2-
"cSpell.words": [
3-
"ashvardanian",
4-
"Condvar",
5-
"fprintf",
6-
"futex",
7-
"noexcept",
8-
"NUMA",
9-
"println",
10-
"repr",
11-
"SIMT",
12-
"STREQUAL",
13-
"syscall",
14-
"TSAN",
15-
"Vardanian"
16-
],
17-
"files.associations": {
18-
"atomic": "cpp",
19-
"array": "cpp",
20-
"bit": "cpp",
21-
"bitset": "cpp",
22-
"cctype": "cpp",
23-
"chrono": "cpp",
24-
"clocale": "cpp",
25-
"cmath": "cpp",
26-
"compare": "cpp",
27-
"concepts": "cpp",
28-
"condition_variable": "cpp",
29-
"cstdarg": "cpp",
30-
"cstddef": "cpp",
31-
"cstdint": "cpp",
32-
"cstdio": "cpp",
33-
"cstdlib": "cpp",
34-
"cstring": "cpp",
35-
"ctime": "cpp",
36-
"cwchar": "cpp",
37-
"cwctype": "cpp",
38-
"deque": "cpp",
39-
"string": "cpp",
40-
"unordered_map": "cpp",
41-
"vector": "cpp",
42-
"exception": "cpp",
43-
"algorithm": "cpp",
44-
"functional": "cpp",
45-
"iterator": "cpp",
46-
"memory": "cpp",
47-
"memory_resource": "cpp",
48-
"numeric": "cpp",
49-
"optional": "cpp",
50-
"random": "cpp",
51-
"ratio": "cpp",
52-
"string_view": "cpp",
53-
"system_error": "cpp",
54-
"tuple": "cpp",
55-
"type_traits": "cpp",
56-
"utility": "cpp",
57-
"initializer_list": "cpp",
58-
"iosfwd": "cpp",
59-
"istream": "cpp",
60-
"limits": "cpp",
61-
"mutex": "cpp",
62-
"new": "cpp",
63-
"numbers": "cpp",
64-
"ostream": "cpp",
65-
"semaphore": "cpp",
66-
"sstream": "cpp",
67-
"stdexcept": "cpp",
68-
"stop_token": "cpp",
69-
"streambuf": "cpp",
70-
"thread": "cpp",
71-
"cinttypes": "cpp",
72-
"typeinfo": "cpp",
73-
"__nullptr": "cpp",
74-
"__bit_reference": "cpp",
75-
"__hash_table": "cpp",
76-
"__split_buffer": "cpp",
77-
"ios": "cpp",
78-
"charconv": "cpp",
79-
"iomanip": "cpp",
80-
"span": "cpp",
81-
"variant": "cpp",
82-
"format": "cpp",
83-
"*.cmake.in": "cmake"
84-
}
2+
"cSpell.words": [
3+
"ashvardanian",
4+
"Condvar",
5+
"fprintf",
6+
"futex",
7+
"nbody",
8+
"noexcept",
9+
"NUMA",
10+
"OpenMP",
11+
"println",
12+
"repr",
13+
"rsqrt",
14+
"SIMT",
15+
"STREQUAL",
16+
"syscall",
17+
"TSAN",
18+
"Vardanian"
19+
],
20+
"files.associations": {
21+
"__bit_reference": "cpp",
22+
"__hash_table": "cpp",
23+
"__locale": "cpp",
24+
"__node_handle": "cpp",
25+
"__nullptr": "cpp",
26+
"__split_buffer": "cpp",
27+
"__verbose_abort": "cpp",
28+
"*.cmake.in": "cmake",
29+
"algorithm": "cpp",
30+
"array": "cpp",
31+
"atomic": "cpp",
32+
"bit": "cpp",
33+
"bitset": "cpp",
34+
"cctype": "cpp",
35+
"charconv": "cpp",
36+
"chrono": "cpp",
37+
"cinttypes": "cpp",
38+
"clocale": "cpp",
39+
"cmath": "cpp",
40+
"compare": "cpp",
41+
"complex": "cpp",
42+
"concepts": "cpp",
43+
"condition_variable": "cpp",
44+
"cstdarg": "cpp",
45+
"cstddef": "cpp",
46+
"cstdint": "cpp",
47+
"cstdio": "cpp",
48+
"cstdlib": "cpp",
49+
"cstring": "cpp",
50+
"ctime": "cpp",
51+
"cwchar": "cpp",
52+
"cwctype": "cpp",
53+
"deque": "cpp",
54+
"exception": "cpp",
55+
"format": "cpp",
56+
"forward_list": "cpp",
57+
"functional": "cpp",
58+
"initializer_list": "cpp",
59+
"iomanip": "cpp",
60+
"ios": "cpp",
61+
"iosfwd": "cpp",
62+
"istream": "cpp",
63+
"iterator": "cpp",
64+
"limits": "cpp",
65+
"locale": "cpp",
66+
"memory": "cpp",
67+
"memory_resource": "cpp",
68+
"mutex": "cpp",
69+
"new": "cpp",
70+
"numbers": "cpp",
71+
"numeric": "cpp",
72+
"optional": "cpp",
73+
"ostream": "cpp",
74+
"random": "cpp",
75+
"ratio": "cpp",
76+
"semaphore": "cpp",
77+
"span": "cpp",
78+
"sstream": "cpp",
79+
"stack": "cpp",
80+
"stdexcept": "cpp",
81+
"stop_token": "cpp",
82+
"streambuf": "cpp",
83+
"string": "cpp",
84+
"string_view": "cpp",
85+
"system_error": "cpp",
86+
"thread": "cpp",
87+
"tuple": "cpp",
88+
"type_traits": "cpp",
89+
"typeinfo": "cpp",
90+
"unordered_map": "cpp",
91+
"utility": "cpp",
92+
"variant": "cpp",
93+
"vector": "cpp"
94+
}
8595
}

.vscode/tasks.json

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,40 @@
22
"version": "2.0.0",
33
"tasks": [
44
{
5-
"label": "Build: Debug",
5+
"label": "Build: Debug with GDB",
66
"command": "cmake -D CMAKE_BUILD_TYPE=Debug -B build_debug && cmake --build build_debug --config Debug",
77
"args": [],
88
"type": "shell",
9+
"linux": {
10+
"environment": [
11+
{
12+
"name": "CXX",
13+
"value": "g++"
14+
},
15+
{
16+
"name": "CC",
17+
"value": "gcc"
18+
}
19+
]
20+
},
21+
},
22+
{
23+
"label": "Build: Debug with LLDB",
24+
"command": "cmake -D CMAKE_BUILD_TYPE=Debug -B build_debug && cmake --build build_debug --config Debug",
25+
"args": [],
26+
"type": "shell",
27+
"linux": {
28+
"environment": [
29+
{
30+
"name": "CXX",
31+
"value": "clang++-15"
32+
},
33+
{
34+
"name": "CC",
35+
"value": "clang-15"
36+
}
37+
]
38+
},
939
"osx": {
1040
"environment": [
1141
{

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.14)
33
project(
44
fork_union
55
VERSION 0.3.3
6-
DESCRIPTION "Minimalistic C++ thread-pool designed for SIMT-style 'Fork-Join' parallelism"
6+
DESCRIPTION "OpenMP-style cross-platform fine-grained parallelism library"
77
LANGUAGES CXX
88
)
99

Cargo.toml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "fork_union"
3-
description = "Minimalistic scoped thread-pool designed for SIMT-style 'Fork-Join' parallelism"
3+
description = "OpenMP-style cross-platform fine-grained parallelism library"
44
version = "0.3.3"
55
edition = "2021"
66
authors = ["Ash Vardanian"]
@@ -10,5 +10,12 @@ repository = "https://github.com/ashvardanian/fork_union"
1010
[lib]
1111
path = "fork_union.rs"
1212

13-
[dependencies]
14-
crossbeam-utils = "0.8.21"
13+
[[example]]
14+
name = "nbody"
15+
path = "scripts/nbody.rs"
16+
test = false
17+
bench = false
18+
19+
[dev-dependencies]
20+
rayon = "1.10"
21+
rand = "0.9"

0 commit comments

Comments
 (0)