Skip to content

Commit b439876

Browse files
authored
Update to add SPDX identifiers (#13)
* Add SPDX statement to files.
1 parent 122cce8 commit b439876

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+573
-18
lines changed

.clang-format

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2024 Binsparse Developers
2+
#
3+
# SPDX-License-Identifier: BSD-3-Clause
4+
15
---
26
BasedOnStyle: LLVM
37
PointerAlignment: Left

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2024 Binsparse Developers
2+
#
3+
# SPDX-License-Identifier: BSD-3-Clause
4+
15
name: "CI"
26

37
on:

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SPDX-FileCopyrightText: 2024 Binsparse Developers
2+
#
3+
# SPDX-License-Identifier: BSD-3-Clause
4+
5+
scripts
6+
venv
7+
build
8+
._*

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2024 Binsparse Developers
2+
#
3+
# SPDX-License-Identifier: BSD-3-Clause
4+
15
repos:
26

37
- repo: https://github.com/pre-commit/mirrors-clang-format
@@ -12,3 +16,8 @@ repos:
1216
- id: end-of-file-fixer
1317
- id: mixed-line-ending
1418
- id: check-added-large-files
19+
20+
- repo: https://github.com/fsfe/reuse-tool
21+
rev: v2.1.0
22+
hooks:
23+
- id: reuse

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2024 Binsparse Developers
2+
#
3+
# SPDX-License-Identifier: BSD-3-Clause
4+
15
cmake_minimum_required(VERSION 3.5)
26
project(binsparse-rc)
37

File renamed without changes.

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2024 Binsparse Developers
3+
4+
SPDX-License-Identifier: BSD-3-Clause
5+
-->
6+
17
# Binsparse C Reference Implementation
28

39
This library is a reference implementation of the [binsparse Binary Sparse Format Specification](https://github.com/GraphBLAS/binsparse-specification) written using C.

examples/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: 2024 Binsparse Developers
2+
#
3+
# SPDX-License-Identifier: BSD-3-Clause
4+
15
function(add_example example_name)
26
add_executable(${example_name} ${example_name}.c)
37
target_link_libraries(${example_name} binsparse-rc)
@@ -10,6 +14,7 @@ add_example(simple_write)
1014
add_example(mtx2bsp)
1115
add_example(bsp2mtx)
1216
add_example(check_equivalence)
17+
add_example(check_equivalence_parallel)
1318
add_example(bsp-ls)
1419
add_example(benchmark_read)
1520
add_example(benchmark_read_parallel)

examples/benchmark_read.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2024 Binsparse Developers
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
17
#include <binsparse/binsparse.h>
28
#include <stdlib.h>
39
#include <time.h>

examples/benchmark_read_parallel.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2024 Binsparse Developers
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
17
#include <binsparse/binsparse.h>
28
#include <stdlib.h>
39
#include <time.h>
@@ -61,8 +67,9 @@ int main(int argc, char** argv) {
6167
char* file_name = argv[1];
6268

6369
printf("Opening %s\n", file_name);
70+
fflush(stdout);
6471

65-
const int num_trials = 2;
72+
const int num_trials = 10;
6673

6774
int num_threads = 6;
6875

@@ -71,11 +78,10 @@ int main(int argc, char** argv) {
7178
size_t nbytes = 0;
7279

7380
// To flush the filesystem cache before each trial, change to `true`.
74-
bool cold_cache = true;
81+
bool cold_cache = false;
7582

7683
// If running warm cache experiments, read once to warm cache.
77-
if (!cold_cache && false) {
78-
printf("Warm cache read...\n");
84+
if (!cold_cache) {
7985
bsp_matrix_t mat = bsp_read_matrix_parallel(file_name, NULL, num_threads);
8086
bsp_destroy_matrix_t(mat);
8187
}
@@ -84,6 +90,7 @@ int main(int argc, char** argv) {
8490
if (cold_cache) {
8591
flush_cache();
8692
}
93+
fflush(stdout);
8794
double begin = gettime();
8895
bsp_matrix_t mat = bsp_read_matrix_parallel(file_name, NULL, num_threads);
8996
double end = gettime();
@@ -95,6 +102,7 @@ int main(int argc, char** argv) {
95102
double gbytes = ((double) nbytes) / 1024 / 1024 / 1024;
96103
double gbytes_s = gbytes / durations[i];
97104
printf("FORPARSER: %s,%lf,%lf\n", file_name, durations[i], gbytes_s);
105+
fflush(stdout);
98106
}
99107

100108
printf("[");

0 commit comments

Comments
 (0)