Skip to content

Commit

Permalink
Revert "Attempt to resolve merge conflicts with master. Tests not pas…
Browse files Browse the repository at this point in the history
…sing"

This reverts commit dd64983, reversing
changes made to 3e9d836.
  • Loading branch information
Soroosh129 committed Feb 26, 2022
1 parent dd64983 commit 901eea7
Show file tree
Hide file tree
Showing 63 changed files with 4,246 additions and 5,477 deletions.
4 changes: 0 additions & 4 deletions .github/scripts/test-lfc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ bin/lfc -f --rti rti test/C/src/Minimal.lf
bin/lfc --federated --rti rti test/C/src/Minimal.lf

# -h,--help Display this information.
bin/lfc -h
bin/lfc --help

# -l, --lint Enable linting during build.
Expand Down Expand Up @@ -73,8 +72,5 @@ bin/lfc -threads 2 test/C/src/Minimal.lf
# (Added no-compile to avoid adding dependency.)
bin/lfc --target-compiler gcc --no-compile test/C/src/Minimal.lf

# --version
bin/lfc --version

# Ensure that lfc is robust to symbolic links.
test_with_links "lfc"
8 changes: 8 additions & 0 deletions .github/workflows/lsp-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ jobs:
brew install protobuf
brew install protobuf-c
if: ${{ runner.os == 'macOS' }}
- name: Install dependencies Windows
uses: lukka/run-vcpkg@v4
with:
vcpkgArguments: protobuf
vcpkgGitCommitId: 6185aa76504a5025f36754324abf307cc776f3da
vcpkgDirectory: ${{ github.workspace }}/vcpkg/
vcpkgTriplet: x64-windows-static
if: ${{ runner.os == 'Windows' }}
- name: Check out lingua-franca repository
uses: actions/checkout@v2
with:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/py-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ jobs:
brew install protobuf
brew install coreutils
if: ${{ runner.os == 'macOS' }}
- name: Install dependencies Windows
uses: lukka/run-vcpkg@v4
with:
vcpkgArguments: protobuf
vcpkgGitCommitId: 6185aa76504a5025f36754324abf307cc776f3da
vcpkgDirectory: ${{ github.workspace }}/vcpkg/
vcpkgTriplet: x64-windows-static
if: ${{ runner.os == 'Windows' }}
- name: Install Google API Python Client
run: pip3 install --upgrade google-api-python-client
- name: Check out lingua-franca repository
Expand Down
2 changes: 1 addition & 1 deletion benchmark/C/Savina/src/BenchmarkRunner.lf
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ reactor BenchmarkRunner(num_iterations:int(12)) {
self->measuredTimes[self->count] = duration;
self->count += 1;

printf("Iteration %d - %.3f ms\n", self->count, toMS(duration));
printf("Iteration: %d\t Duration: %.3f msec\n", self->count, toMS(duration));

schedule(nextIteration, 0);

Expand Down
23 changes: 10 additions & 13 deletions benchmark/C/Savina/src/concurrency/SortedList.lf
Original file line number Diff line number Diff line change
Expand Up @@ -123,33 +123,30 @@ reactor Worker(
self->requests_sent++;
} else {
SET(finished, true);
self->requests_sent = 0;
}
=}
}

reactor LinkedList(num_workers: int(20)) {

state data_list: {=SortedLinkedList<int>*=};
state data_list: SortedLinkedList<int>;
state responses_to_send: int[];

logical action send_responses;

input finished: bool;
input print_result: bool;
input[num_workers] requests: message_t;
output[num_workers] responses: int;

reaction(startup) {=
self->data_list = new SortedLinkedList<int>();
self->data_list = SortedLinkedList<int>();
self->responses_to_send = (int*) malloc(self->num_workers * sizeof(int));
=}

reaction(finished) {=
reaction(print_result) {=
// check result
info_print("List Size = %d", self->data_list->size());
// reset local state
delete self->data_list;
self->data_list = new SortedLinkedList<int>();
info_print("List Size = %d", self->data_list.size());
// no need to reset local state
=}

reaction(send_responses) -> responses {=
Expand All @@ -166,19 +163,19 @@ reactor LinkedList(num_workers: int(20)) {
int value = requests[i]->value.value;
switch (requests[i]->value.type) {
case CONTAINS:
self->responses_to_send[i] = self->data_list->contains(value);
self->responses_to_send[i] = self->data_list.contains(value);
LOG_PRINT(
"Worker %ld checks if %d is contained in the list",
i, value
);
break;
case WRITE:
self->data_list->add(value);
self->data_list.add(value);
self->responses_to_send[i] = value;
LOG_PRINT("Worker %ld writes %d", i, value);
break;
case SIZE:
self->responses_to_send[i] = self->data_list->size();
self->responses_to_send[i] = self->data_list.size();
LOG_PRINT("Worker %ld reads the list size", i);
break;
}
Expand Down Expand Up @@ -379,7 +376,7 @@ main reactor(numIterations:int(12), numWorkers:int(20), numMessagesPerWorker:int

(runner.start)+ -> manager.start, workers.doWork;
manager.finished -> runner.finish;
manager.finished -> sorted_list.finished;
manager.finished -> sorted_list.print_result;

workers.request -> sorted_list.requests;
sorted_list.responses -> workers.response;
Expand Down
50 changes: 8 additions & 42 deletions benchmark/C/Savina/src/parallelism/FilterBank.lf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ target C {
]]] */
threads: 0,
/// [[[end]]]
fast: true
fast: true,
/* [[[cog
cog.outl(f'timeout: {time_steps} msec // Specifies number of samples.')
]]] */
//timeout: 34816 msec // Specifies number of samples.
/// [[[end]]]
};

import BenchmarkRunner from "../BenchmarkRunner.lf";
Expand All @@ -55,7 +60,7 @@ reactor Producer {
state cnt: int(0);
reaction (start) -> send_next {=
schedule(send_next, 0);
=}
=}
reaction (send_next) -> next, finish, send_next {=
if (self->cnt >= 34816) {
// reset state variable
Expand All @@ -74,15 +79,10 @@ reactor Producer {
* then start over again at 0.
*/
reactor Source(maxValue:int(1000)) {
input in_finished: bool;
input next: bool;
output value: double;

state current: size_t(0);

reaction (in_finished) {=
self->current = 0;
=}

reaction (next) -> value {=
SET(value, self->current);
Expand All @@ -94,8 +94,6 @@ reactor Source(maxValue:int(1000)) {
reactor Bank(bank_index: size_t(0), columns: size_t(16384), channels: size_t(8)) {
input in: double;
output out: double;

input in_finished: bool;

delay0 = new Delay(length=columns);
fir0 = new FirFilter(bank_index=bank_index, peek_length=columns, first = true);
Expand All @@ -108,13 +106,7 @@ reactor Bank(bank_index: size_t(0), columns: size_t(16384), channels: size_t(8))
fir0.out -> sample.in;
sample.out -> delay1.in;
delay1.out -> fir1.in;
fir1.out -> out;

in_finished -> delay0.in_finished;
in_finished -> fir0.in_finished;
in_finished -> sample.in_finished;
in_finished -> delay1.in_finished;
in_finished -> fir1.in_finished;
fir1.out -> out;
}

/**
Expand All @@ -128,20 +120,11 @@ reactor Delay(length: size_t(16383), period:time(1 msec)) {

input in: double;
output out: double;

input in_finished: bool;

reaction(startup) {=
self->buffer = calloc(self->length - 1, sizeof(double));
self->pointer = 0;
=}

reaction (in_finished) {=
for (size_t i = 0; i < self->length - 1; i++) {
self->buffer[i] = 0;
}
self->pointer = 0;
=}

reaction(in) -> out {=
// info_print("Delay %d output: %f", self->pointer, self->buffer[self->pointer]);
Expand Down Expand Up @@ -177,8 +160,6 @@ reactor FirFilter(bank_index:size_t(0), peek_length:size_t(16384), first:bool(tr

input in: double;
output out: double;

input in_finished: bool;

reaction(startup) {=
// Allocate local state.
Expand All @@ -201,14 +182,6 @@ reactor FirFilter(bank_index:size_t(0), peek_length:size_t(16384), first:bool(tr
}
self->data_index = 0;
=}

reaction(in_finished) {=
for (size_t i = 0; i < self->peek_length; i++) {
self->data[i] = 0;
}
self->data_index = 0;
self->data_full = false;
=}

reaction(in) -> out {=
self->data[self->data_index++] = in->value;
Expand Down Expand Up @@ -243,8 +216,6 @@ reactor SampleFilter(sample_rate: size_t(16384)) {

input in: double;
output out: double;

input in_finished: bool;

reaction(in) -> out {=
if(self->samples_received == 0) {
Expand All @@ -256,10 +227,6 @@ reactor SampleFilter(sample_rate: size_t(16384)) {
}
self->samples_received = (self->samples_received + 1) % self->sample_rate;
=}

reaction(in_finished) {=
in_finished = 0;
=}
}

/**
Expand Down Expand Up @@ -311,7 +278,6 @@ main reactor (numIterations:int(12), columns: size_t(16384), channels: size_t(8)
=}
runner.start -> producer.start;
producer.finish -> runner.finish;
(producer.finish)+ -> banks.in_finished;
producer.next -> source.next;
(source.value)+ -> banks.in;
banks.out -> combine.inValues;
Expand Down
1 change: 0 additions & 1 deletion benchmark/C/Savina/src/parallelism/PiPrecision.lf
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ reactor Manager(numWorkers:int(20), scale:uint32_t({=5000ul=})) {
free(solution_pruned);
mpf_clear(self->result);
mpf_clear(self->tolerance);
self->termsRequested = 0;
SET(finished, true);
=}

Expand Down
2 changes: 1 addition & 1 deletion benchmark/runner/conf/target/lf-c-unthreaded.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ gen: ["cog", "-r", "${args:benchmark.targets.lf-c.gen_args}",
"-D", "threaded_runtime=False",
"src/${benchmark.targets.lf-c.lf_file}"]
compile: ["${lf_path}/bin/lfc", "src/${benchmark.targets.lf-c.lf_file}"]
run: ["bin/${benchmark.targets.lf-c.binary}"]
run: ["bash", "-c", "seq ${iterations} | xargs -I{} bin/${benchmark.targets.lf-c.binary}"]
parser:
_target_: "parser.parse_lfc_output"
10 changes: 9 additions & 1 deletion benchmark/runner/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,16 @@ def parse_lfcpp_output(lines):
return times


parse_lfc_output = parse_lfcpp_output
def parse_lfc_output(lines):
times = []
for line in lines:
prefix = "---- Elapsed physical time (in nsec): "
if line.startswith(prefix):
p = len(prefix)
ns = int(line[p:].replace(",", ""))
times.append(ns / 1000000.0)

return times

def parse_lf_rust_output(lines):
times = []
Expand Down
9 changes: 0 additions & 9 deletions example/Cpp/src/AlarmClock/AlarmClock.cmake

This file was deleted.

40 changes: 0 additions & 40 deletions example/Cpp/src/AlarmClock/AlarmClock.lf

This file was deleted.

Loading

0 comments on commit 901eea7

Please sign in to comment.