Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace the 'threads' target property with the 'workers' and 'threading' properties #993

Merged
merged 42 commits into from
Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
0a19027
add a new workers target property and deprecate threads
cmnrd Mar 2, 2022
b8379fc
use workers in C++ code generation
cmnrd Mar 2, 2022
52084c3
use workers in Rust code generation
cmnrd Mar 2, 2022
ad8150b
bugfix
cmnrd Mar 2, 2022
a3abdc9
rename threads -> workers in C++ tests
cmnrd Mar 2, 2022
501ba42
update lfc and the test runner
cmnrd Mar 2, 2022
4a7cca6
adjust the C++ benchmark runner configuration
cmnrd Mar 2, 2022
d64a875
fix C++ examples
cmnrd Mar 2, 2022
2a5b2e3
update lfc test script
cmnrd Mar 2, 2022
a875515
Merge branch 'master' into workers
cmnrd Mar 2, 2022
c5260b8
fix typo after merge
cmnrd Mar 2, 2022
dcc328d
fix rust code generation
cmnrd Mar 2, 2022
bff9583
update the rust benchmark runner configuration
cmnrd Mar 2, 2022
8069bf8
add threading target property
cmnrd Mar 2, 2022
6b1cd9e
use threading and workers in the C generator
cmnrd Mar 2, 2022
8de7fd0
remove the threads property
cmnrd Mar 2, 2022
e8e1b1c
rename threads -> workers in examples and tests
cmnrd Mar 2, 2022
30fa3ee
update all the c benchmarks
cmnrd Mar 2, 2022
8d130a7
add --no-threading cli option and fix tests
cmnrd Mar 2, 2022
2752bd3
enable the workers property for all targets with multithreading
cmnrd Mar 2, 2022
ee8fe04
fix tests
cmnrd Mar 2, 2022
0b85e1e
Merge branch 'master' into workers
cmnrd Mar 3, 2022
bee3ce6
rename no-threading cli option to threading and add boolean argument
cmnrd Mar 3, 2022
666bcfd
Slightly adjusted how number of workers are adjusted in the C and Pyt…
Soroosh129 Mar 9, 2022
dbd4608
Merged in master and resolved conflict
lhstrh Mar 9, 2022
c290646
fix compile errors
cmnrd Mar 9, 2022
32af38d
remove workers from all C++ tests
cmnrd Mar 9, 2022
d905701
remove 'workers' from all the tests and some examples
cmnrd Mar 9, 2022
af64797
First step toward setting the number of cores in the C runtime
Soroosh129 Mar 9, 2022
9b1deb3
Slight adjustment to logic
Soroosh129 Mar 9, 2022
d78f8b1
Number of threads will now be decided based on NUMBER_OF_WORKERS
Soroosh129 Mar 9, 2022
c02ac8e
Account for workers = 0
Soroosh129 Mar 9, 2022
276cb25
Renamed _lf_number_of_threads and added WORKERS_NEEDED_FOR_FEDERATE
Soroosh129 Mar 9, 2022
57d3cba
Updated pointer to reactor-c
Soroosh129 Mar 9, 2022
0482f28
Apply suggestions from code review
lhstrh Mar 9, 2022
0c50408
Run tests with `threading=on` by default, `threading=off` as special …
lhstrh Mar 10, 2022
28242b8
Fix compile error
lhstrh Mar 10, 2022
34463fc
Added tests that verify `workers` property is heeded
lhstrh Mar 10, 2022
21be25c
Renamed AbstractTest to RuntimeTest and created a category for modal …
lhstrh Mar 10, 2022
dd7bc59
Do not perform single-threaded tests for C++
lhstrh Mar 10, 2022
75a8df8
Run the tests for modal reactors also with the multithreaded runtime
lhstrh Mar 10, 2022
3f9278b
Fixed typo
lhstrh Mar 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/scripts/test-lfc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ bin/lfc --output-path . test/C/src/Minimal.lf
# programs.
bin/lfc --runtime-version ca216ccc3da5ecff0e8013f75e275d7acac099de test/Cpp/src/Minimal.lf

# -t,--threads Specify the default number of threads.
bin/lfc -t 2 test/C/src/Minimal.lf
bin/lfc -threads 2 test/C/src/Minimal.lf
# -w,--workers Specify the default number of worker threads.
bin/lfc -w 2 test/C/src/Minimal.lf
bin/lfc --workers 2 test/C/src/Minimal.lf
bin/lfc --threading true test/C/src/Minimal.lf
bin/lfc --threading false test/C/src/Minimal.lf

# --target-compiler <arg> Target compiler to invoke.
# (Added no-compile to avoid adding dependency.)
Expand Down
10 changes: 6 additions & 4 deletions benchmark/C/Savina/src/concurrency/Banking.lf
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@

target C {
/* [[[cog
if (threaded_runtime=="True"):
cog.outl(f"threads: {threads},")
if (threading=="True"):
cog.outl("threading: true,")
cog.outl(f"workers: {workers},")
cog.outl(f"scheduler: {scheduler},")
else:
cog.outl("threads: 0,")
cog.outl("threading: false,")
]]] */
threads: 0,
threading: false,
/// [[[end]]]
files: ["../include/PseudoRandom.h",
"/lib/c/reactor-c/util/deque.h",
Expand Down
9 changes: 5 additions & 4 deletions benchmark/C/Savina/src/concurrency/BoundedBuffer.lf
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@

target C {
/* [[[cog
if (threaded_runtime=="True"):
cog.outl(f"threads: {threads},")
if (threading=="True"):
cog.outl("threading: true,")
cog.outl(f"workers: {workers},")
cog.outl(f"scheduler: {scheduler},")
else:
cog.outl("threads: 0,")
cog.outl("threading: false,")
]]] */
threads: 0,
threading: false,
/// [[[end]]]
files: ["/lib/c/reactor-c/util/deque.h",
"/lib/c/reactor-c/util/deque.c",
Expand Down
9 changes: 5 additions & 4 deletions benchmark/C/Savina/src/concurrency/CigaretteSmoker.lf
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,14 @@

target C {
/* [[[cog
if (threaded_runtime=="True"):
cog.outl(f"threads: {threads},")
if (threading=="True"):
cog.outl("threading: true,")
cog.outl(f"workers: {workers},")
cog.outl(f"scheduler: {scheduler},")
else:
cog.outl("threads: 0,")
cog.outl("threading: false,")
]]] */
threads: 0,
threading: false,
/// [[[end]]]
files: "../include/PseudoRandom.h"
};
Expand Down
9 changes: 5 additions & 4 deletions benchmark/C/Savina/src/concurrency/Dictionary.lf
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@

target CCpp {
/* [[[cog
if (threaded_runtime=="True"):
cog.outl(f"threads: {threads},")
if (threading=="True"):
cog.outl("threading: true,")
cog.outl(f"workers: {workers},")
cog.outl(f"scheduler: {scheduler},")
else:
cog.outl("threads: 0,")
cog.outl("threading: false,")
]]] */
threads: 0,
threading: false,
/// [[[end]]]
build-type : RelWithDebInfo,
logging: "warn"
Expand Down
11 changes: 6 additions & 5 deletions benchmark/C/Savina/src/concurrency/LogisticMap.lf
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
*/

target C {
/* [[[cog
if (threaded_runtime=="True"):
cog.outl(f"threads: {threads},")
/* [[[cog
if (threading=="True"):
cog.outl("threading: true,")
cog.outl(f"workers: {workers},")
cog.outl(f"scheduler: {scheduler},")
else:
cog.outl("threads: 0,")
cog.outl("threading: false,")
]]] */
threads: 0,
threading: false,
/// [[[end]]]
}

Expand Down
9 changes: 5 additions & 4 deletions benchmark/C/Savina/src/concurrency/Philosophers.lf
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
*/
target C {
/* [[[cog
if (threaded_runtime=="True"):
cog.outl(f"threads: {threads},")
if (threading=="True"):
cog.outl("threading: true,")
cog.outl(f"workers: {workers},")
cog.outl(f"scheduler: {scheduler},")
else:
cog.outl("threads: 0,")
cog.outl("threading: false,")
]]] */
threads: 0,
threading: false,
/// [[[end]]]
logging: warn
};
Expand Down
9 changes: 5 additions & 4 deletions benchmark/C/Savina/src/concurrency/SleepingBarber.lf
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@
target C {
keepalive: true, // To silence warnings; because of the physical action.
/* [[[cog
if (threaded_runtime=="True"):
cog.outl(f"threads: {threads},")
if (threading=="True"):
cog.outl("threading: true,")
cog.outl(f"workers: {workers},")
cog.outl(f"scheduler: {scheduler},")
else:
cog.outl("threads: 0,")
cog.outl("threading: false,")
]]] */
threads: 0,
threading: false,
/// [[[end]]]
files: ["/lib/c/reactor-c/util/deque.h", "/lib/c/reactor-c/util/deque.c", "../include/PseudoRandom.h"]
};
Expand Down
9 changes: 5 additions & 4 deletions benchmark/C/Savina/src/concurrency/SortedList.lf
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@

target CCpp {
/* [[[cog
if (threaded_runtime=="True"):
cog.outl(f"threads: {threads},")
if (threading=="True"):
cog.outl("threading: true,")
cog.outl(f"workers: {workers},")
cog.outl(f"scheduler: {scheduler},")
else:
cog.outl("threads: 0,")
cog.outl("threading: false,")
]]] */
threads: 0,
threading: false,
/// [[[end]]]
files: "../include/PseudoRandom.h"
};
Expand Down
12 changes: 6 additions & 6 deletions benchmark/C/Savina/src/micro/Big.lf
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
* @author Arthur Deng
*/



target C{
/* [[[cog
if (threaded_runtime=="True"):
cog.outl(f"threads: {threads},")
if (threading=="True"):
cog.outl("threading: true,")
cog.outl(f"workers: {workers},")
cog.outl(f"scheduler: {scheduler},")
else:
cog.outl("threads: 0,")
]]] */
cog.outl("threading: false,")
]]] */
threading: false,
/// [[[end]]]
files: "../include/PseudoRandom.h"
};
Expand Down
9 changes: 5 additions & 4 deletions benchmark/C/Savina/src/micro/Chameneos.lf
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@

target C {
/* [[[cog
if (threaded_runtime=="True"):
cog.outl(f"threads: {threads},")
if (threading=="True"):
cog.outl("threading: true,")
cog.outl(f"workers: {workers},")
cog.outl(f"scheduler: {scheduler},")
else:
cog.outl("threads: 0,")
cog.outl("threading: false,")
]]] */
threads: 0,
threading: false,
/// [[[end]]]
logging: warn
}
Expand Down
9 changes: 5 additions & 4 deletions benchmark/C/Savina/src/micro/Counting.lf
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@

target C {
/* [[[cog
if (threaded_runtime=="True"):
cog.outl(f"threads: {threads},")
if (threading=="True"):
cog.outl("threading: true,")
cog.outl(f"workers: {workers},")
cog.outl(f"scheduler: {scheduler},")
else:
cog.outl("threads: 0,")
cog.outl("threading: false,")
]]] */
threads: 0,
threading: false,
/// [[[end]]]
}

Expand Down
9 changes: 5 additions & 4 deletions benchmark/C/Savina/src/micro/PingPong.lf
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@
*/
target C {
/* [[[cog
if (threaded_runtime=="True"):
cog.outl(f"threads: {threads},")
if (threading=="True"):
cog.outl("threading: true,")
cog.outl(f"workers: {workers},")
cog.outl(f"scheduler: {scheduler},")
else:
cog.outl("threads: 0,")
cog.outl("threading: false,")
]]] */
threads: 0,
threading: false,
/// [[[end]]]
fast: true
};
Expand Down
9 changes: 5 additions & 4 deletions benchmark/C/Savina/src/micro/ThreadRing.lf
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@

target C {
/* [[[cog
if (threaded_runtime=="True"):
cog.outl(f"threads: {threads},")
if (threading=="True"):
cog.outl("threading: true,")
cog.outl(f"workers: {workers},")
cog.outl(f"scheduler: {scheduler},")
else:
cog.outl("threads: 0,")
cog.outl("threading: false,")
]]] */
threads: 0,
threading: false,
/// [[[end]]]
};

Expand Down
9 changes: 5 additions & 4 deletions benchmark/C/Savina/src/micro/Throughput.lf
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,14 @@

target C {
/* [[[cog
if (threaded_runtime=="True"):
cog.outl(f"threads: {threads},")
if (threading=="True"):
cog.outl("threading: true,")
cog.outl(f"workers: {workers},")
cog.outl(f"scheduler: {scheduler},")
else:
cog.outl("threads: 0,")
cog.outl("threading: false,")
]]] */
threads: 2,
threading: false,
/// [[[end]]]
flags: "-lm"
};
Expand Down
9 changes: 5 additions & 4 deletions benchmark/C/Savina/src/parallelism/Apsp.lf
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@

target C {
/* [[[cog
if (threaded_runtime=="True"):
cog.outl(f"threads: {threads},")
if (threading=="True"):
cog.outl("threading: true,")
cog.outl(f"workers: {workers},")
cog.outl(f"scheduler: {scheduler},")
else:
cog.outl("threads: 0,")
cog.outl("threading: false,")
]]] */
threads: 0,
threading: false,
/// [[[end]]]
build-type : RelWithDebInfo,
cmake-include: ["../lib/matrix.cmake"],
Expand Down
9 changes: 5 additions & 4 deletions benchmark/C/Savina/src/parallelism/FilterBank.lf
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@

target C {
/* [[[cog
if (threaded_runtime=="True"):
cog.outl(f"threads: {threads},")
if (threading=="True"):
cog.outl("threading: true,")
cog.outl(f"workers: {workers},")
cog.outl(f"scheduler: {scheduler},")
else:
cog.outl("threads: 0,")
cog.outl("threading: false,")
]]] */
threads: 0,
threading: false,
/// [[[end]]]
fast: true
};
Expand Down
9 changes: 5 additions & 4 deletions benchmark/C/Savina/src/parallelism/GuidedSearch.lf
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@

target CCpp {
/* [[[cog
if (threaded_runtime=="True"):
cog.outl(f"threads: {threads},")
if (threading=="True"):
cog.outl("threading: true,")
cog.outl(f"workers: {workers},")
cog.outl(f"scheduler: {scheduler},")
else:
cog.outl("threads: 0,")
cog.outl("threading: false,")
]]] */
threads: 0,
threading: false,
/// [[[end]]]
build-type : RelWithDebInfo,
cmake-include: "GuidedSearch/GuidedSearch.cmake",
Expand Down
9 changes: 5 additions & 4 deletions benchmark/C/Savina/src/parallelism/MatMul.lf
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@

target C {
/* [[[cog
if (threaded_runtime=="True"):
cog.outl(f"threads: {threads},")
if (threading=="True"):
cog.outl("threading: true,")
cog.outl(f"workers: {workers},")
cog.outl(f"scheduler: {scheduler},")
else:
cog.outl("threads: 0,")
cog.outl("threading: false,")
]]] */
threads: 0,
threading: false,
/// [[[end]]]
cmake-include: "../lib/matrix.cmake",
files: ["../lib/matrix.c", "../include/matrix.h"],
Expand Down
8 changes: 5 additions & 3 deletions benchmark/C/Savina/src/parallelism/NQueens.lf
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@

target C{
/* [[[cog
if (threaded_runtime=="True"):
cog.outl(f"threads: {threads},")
if (threading=="True"):
cog.outl("threading: true,")
cog.outl(f"workers: {workers},")
cog.outl(f"scheduler: {scheduler},")
else:
cog.outl("threads: 0,")
cog.outl("threading: false,")
]]] */
threading: false,
/// [[[end]]]
logging: warn,
cmake-include: "/lib/c/reactor-c/util/deque.cmake",
Expand Down
9 changes: 5 additions & 4 deletions benchmark/C/Savina/src/parallelism/PiPrecision.lf
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@

target C {
/* [[[cog
if (threaded_runtime=="True"):
cog.outl(f"threads: {threads},")
if (threading=="True"):
cog.outl("threading: true,")
cog.outl(f"workers: {workers},")
cog.outl(f"scheduler: {scheduler},")
else:
cog.outl("threads: 0,")
cog.outl("threading: false,")
]]] */
threads: 0,
threading: false,
/// [[[end]]]
cmake-include: "PiPrecision.cmake"
};
Expand Down
Loading