Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
02d0993
Create codeql.yml
brtnfld Dec 9, 2024
ac1dc7c
fixed syntax
brtnfld Dec 9, 2024
cc6a340
fixed syntax2
brtnfld Dec 9, 2024
c06c64b
fixed syntax3
brtnfld Dec 9, 2024
e26a4ed
fixed syntax4
brtnfld Dec 9, 2024
c071d5d
fixed syntax5
brtnfld Dec 9, 2024
20a90c6
fixed syntax6
brtnfld Dec 9, 2024
7284948
fixed syntax7
brtnfld Dec 9, 2024
39565ef
fixed syntax8
brtnfld Dec 9, 2024
9050634
fixed syntax9
brtnfld Dec 9, 2024
d6208c9
fixed syntax10
brtnfld Dec 9, 2024
7d86bdf
fixed syntax11
brtnfld Dec 9, 2024
adcfab1
fixed syntax12
brtnfld Dec 9, 2024
9ddc93d
fixed syntax12
brtnfld Dec 9, 2024
9a3c79f
fixed syntax14
brtnfld Dec 9, 2024
893fbd4
fixed syntax14
brtnfld Dec 9, 2024
9b27022
fixed syntax15
brtnfld Dec 9, 2024
b45e20f
fixed syntax16
brtnfld Dec 9, 2024
253533d
fixed syntax16
brtnfld Dec 9, 2024
26cb15a
fixed syntax17
brtnfld Dec 9, 2024
f7dd31b
fixed syntax18
brtnfld Dec 9, 2024
b59afe8
Merge remote-tracking branch 'upstream/develop' into develop
brtnfld Dec 9, 2024
eb7c21e
remove h5bench
brtnfld Dec 9, 2024
0869f1d
Create codeql.yml
brtnfld Dec 10, 2024
7c7ee74
codeQL testing (#1)
brtnfld Dec 12, 2024
68cffbe
Fix2 (#2)
brtnfld Dec 13, 2024
4bcc06b
Fix2 (#3)
brtnfld Dec 13, 2024
ca0469a
fix10
brtnfld Dec 13, 2024
430f10c
fix11
brtnfld Dec 13, 2024
b55750f
Committing clang-format changes
github-actions[bot] Dec 13, 2024
23511a6
critical fix
brtnfld Dec 13, 2024
42f5fad
Committing clang-format changes
github-actions[bot] Dec 13, 2024
f0d95f8
codeql fix
brtnfld Dec 13, 2024
74f1040
Committing clang-format changes
github-actions[bot] Dec 13, 2024
48bd5bb
fix
brtnfld Dec 14, 2024
5b47b7d
codeql fixes
brtnfld Feb 7, 2025
4e164fa
undo cron
brtnfld Feb 10, 2025
6b2b826
changed from strlcpy to snprintf
brtnfld Feb 10, 2025
a0f6884
Committing clang-format changes
github-actions[bot] Feb 10, 2025
58583cd
switched log macros to use snprintf
brtnfld Feb 10, 2025
422fe3b
fixed sscanf
brtnfld Feb 10, 2025
2cd7dca
removed snprintf
brtnfld Feb 10, 2025
b83a873
restore original
brtnfld Feb 11, 2025
c15ce54
Committing clang-format changes
github-actions[bot] Feb 11, 2025
842f4ff
typo
brtnfld Feb 11, 2025
afbb664
updated LOG prints
brtnfld Feb 11, 2025
f42d031
cleanup
brtnfld Feb 11, 2025
e18aa7a
cleanup
brtnfld Feb 11, 2025
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
17 changes: 17 additions & 0 deletions .github/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Query filters to include or exclude specific queries
query-filters:
- exclude:
# See: https://codeql.github.com/codeql-query-help/cpp/cpp-short-global-name/
id: cpp/short-global-name
- exclude:
# See: https://codeql.github.com/codeql-query-help/cpp/cpp-commented-out-code/
id: cpp/commented-out-code
- exclude:
# See: https://codeql.github.com/codeql-query-help/cpp/cpp-poorly-documented-function/
id: cpp/poorly-documented-function
- exclude:
# See: https://codeql.github.com/codeql-query-help/cpp/cpp-trivial-switch/
id: cpp/trivial-switch
- exclude:
# See: https://codeql.github.com/codeql-query-help/cpp/cpp-irregular-enum-init/
id: cpp/irregular-enum-init
23 changes: 23 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,26 @@ jobs:
uses: github/codeql-action/analyze@v3
with:
category: "/language:c-cpp"
output: sarif-results
upload: failure-only

- name: filter-sarif
uses: advanced-security/filter-sarif@main
with:
patterns: |
-**/*
src/**/*
input: sarif-results/cpp.sarif
output: sarif-results/cpp.sarif

- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: sarif-results/cpp.sarif

- name: Upload loc as a Build Artifact
uses: actions/upload-artifact@v4
with:
name: sarif-results
path: sarif-results
retention-days: 1
2 changes: 1 addition & 1 deletion .github/workflows/hdf5-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
ctest --output-on-failure

- name: Upload
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: git.txt
path: ${{ runner.workspace }}/vol-cache/hdf5/git.txt
4 changes: 2 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
jobs:
vol-cache:
runs-on: ubuntu-latest
timeout-minutes: 60
timeout-minutes: 20

steps:
- uses: actions/[email protected]
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
# Compile HDF5
mkdir -p hdf5/build
cd hdf5/build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HDF5_DIR -DHDF5_ENABLE_PARALLEL:BOOL=ON -DHDF5_ENABLE_THREADSAFE:BOOL=ON -DALLOW_UNSUPPORTED:BOOL=ON ..
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HDF5_DIR -DHDF5_ENABLE_PARALLEL:BOOL=ON -DHDF5_ENABLE_THREADSAFE:BOOL=ON -DHDF5_ALLOW_UNSUPPORTED:BOOL=ON ..
make -j2 install
cd -
cd argobots
Expand Down
33 changes: 26 additions & 7 deletions src/H5LS.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
extern int RANK;
extern int NPROC;

#define ERROR_MSG_SIZE 283
char error_msg[ERROR_MSG_SIZE];

/*
Get the corresponding mmap function struct based on the type of node local
storage The user can modify this function to other storage
Expand Down Expand Up @@ -131,8 +134,9 @@ herr_t readLSConf(char *fname, cache_storage_t *LS) {
MPI_Abort(MPI_COMM_WORLD, 100);
}
FILE *file = fopen(fname, "r");
LS->path = (char *)malloc(255);
strcpy(LS->path, "./");
LS->path = (char *)malloc(256);
strncpy(LS->path, "./", 255);
LS->path[255] = '\0';
LS->mspace_total = 137438953472;
strcpy(LS->type, "SSD");
strcpy(LS->scope, "LOCAL");
Expand All @@ -144,16 +148,24 @@ herr_t readLSConf(char *fname, cache_storage_t *LS) {
linenum++;
if (line[0] == '#')
continue;
if (sscanf(line, "%[^:]:%s", ip, mac) != 2) {
if (sscanf(line, "%255[^:]:%255s", ip, mac) != 2) {
if (RANK == io_node())
fprintf(stderr, "Syntax error, line %d\n", linenum);
continue;
}
ip[255] = '\0';
mac[255] = '\0';
if (strlen(ip) >= 256 || strlen(mac) >= 256) {
if (RANK == io_node())
fprintf(stderr, "Input too long, line %d\n", linenum);
continue;
}
if (!strcmp(ip, "HDF5_CACHE_STORAGE_PATH"))
if (strcmp(mac, "NULL") == 0)
LS->path = NULL;
else {
strcpy(LS->path, mac);
strncpy(LS->path, mac, 255);
LS->path[255] = '\0';
}

else if (!strcmp(ip, "HDF5_CACHE_FUSION_THRESHOLD")) {
Expand All @@ -166,9 +178,11 @@ herr_t readLSConf(char *fname, cache_storage_t *LS) {
else if (!strcmp(ip, "HDF5_CACHE_WRITE_BUFFER_SIZE"))
LS->write_buffer_size = (hsize_t)atof(mac);
else if (!strcmp(ip, "HDF5_CACHE_STORAGE_TYPE")) {
strcpy(LS->type, mac);
strncpy(LS->type, mac, sizeof(LS->type) - 1);
LS->type[sizeof(LS->type) - 1] = '\0';
} else if (!strcmp(ip, "HDF5_CACHE_STORAGE_SCOPE")) {
strcpy(LS->scope, mac);
strncpy(LS->scope, mac, sizeof(LS->scope) - 1);
LS->scope[sizeof(LS->scope) - 1] = '\0';
} else if (!strcmp(ip, "HDF5_CACHE_REPLACEMENT_POLICY")) {
if (get_replacement_policy_from_str(mac) > 0)
LS->replacement_policy = get_replacement_policy_from_str(mac);
Expand All @@ -190,7 +204,12 @@ herr_t readLSConf(char *fname, cache_storage_t *LS) {
(stat(LS->path, &sb) == 0 && S_ISDIR(sb.st_mode))) {
return 0;
} else {
LOG_ERROR(-1, "H5LSset: path %s does not exist\n", LS->path);
int ret = snprintf(error_msg, ERROR_MSG_SIZE,
"H5LSset: path %s does not exist\n", LS->path);
if (ret < 0 || ret >= ERROR_MSG_SIZE) {
LOG_WARN(-1, "path error message truncated");
}
LOG_ERROR(-1, "%s", error_msg);
MPI_Abort(MPI_COMM_WORLD, 112);
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/H5LS_SSD.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static herr_t H5Ssel_gather_write(hid_t space, hid_t tid, const void *buf,
char *p = (char *)buf;
int i;
for (i = 0; i < nseq; i++) {
int err = pwrite(fd, &p[off[i]], len[i], offset + off_contig);
pwrite(fd, &p[off[i]], len[i], offset + off_contig);
off_contig += len[i];
}
#ifdef __APPLE__
Expand All @@ -58,7 +58,6 @@ static herr_t H5LS_SSD_create_write_mmap(MMAP *mm, hsize_t size) {
strcpy(dname, mm->fname);
mkdirRecursive(dirname(dname), 0755); // dirname will change dname in linux.
// therefore, we make copy first.
struct stat info;
mm->fd = open(mm->fname, O_RDWR | O_CREAT | O_TRUNC, 0644);
return 0;
}
Expand Down Expand Up @@ -98,7 +97,6 @@ static herr_t H5LS_SSD_create_read_mmap(MMAP *mm, hsize_t size) {

/* clean up read mmap buffer, files */
static herr_t H5LS_SSD_remove_read_mmap(MMAP *mm, hsize_t size) {
herr_t ret;
munmap(mm->buf, size);
close(mm->fd);
if (access(mm->fname, F_OK) == 0)
Expand Down
Loading