Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 4 additions & 2 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: clang-format Check
on:
pull_request:

jobs:
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip-ci')"
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/checkout@v4.1.7

- name: Run clang-format style check for C programs.
uses: DoozyX/clang-format-lint-action@v0.14
uses: DoozyX/clang-format-lint-action@v0.18.2
with:
source: '.'
extensions: 'c,h,cpp,hpp'
Expand Down
27 changes: 22 additions & 5 deletions .github/workflows/clang-format-fix.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,41 @@
name: clang-format Check
# NOTE: This action requires write permissions to be set in your GitHub
# repo/fork for it to be able to commit changes.
#
# This is currently enabled via:
#
# settings > Actions > General > Workflow permissions
#
# which you will need to set to "Read and write permissions"
#
name: clang-format Commit Changes
on:
workflow_dispatch:
push:

permissions:
contents: read

jobs:
formatting-check:
name: Formatting Check
name: Commit Format Changes
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip-ci')"
permissions:
contents: write # In order to allow EndBug/add-and-commit to commit changes
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/checkout@v4.1.7

- name: Run clang-format style check for C programs.
uses: DoozyX/clang-format-lint-action@v0.14
uses: DoozyX/clang-format-lint-action@v0.18.2
with:
source: '.'
extensions: 'c,h,cpp,hpp'
clangFormatVersion: 10
inplace: True
style: file
# exclude: './config '
- uses: EndBug/add-and-commit@v7

- uses: EndBug/add-and-commit@v9.1.3
with:
author_name: github-actions
author_email: github-actions[bot]@users.noreply.github.com
Expand Down
14 changes: 9 additions & 5 deletions src/H5LS.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ herr_t readLSConf(char *fname, cache_storage_t *LS) {
if (get_replacement_policy_from_str(mac) > 0)
LS->replacement_policy = get_replacement_policy_from_str(mac);
} else {
LOG_WARN(-1, "Unknown configuration setup:", ip);
snprintf(error_msg, ERROR_MSG_SIZE, "Unknown configuration setup: %s",
ip);
LOG_WARN(-1, "%s", error_msg);
}
}
if (LS->mspace_total < LS->write_buffer_size) {
Expand All @@ -202,7 +204,7 @@ herr_t readLSConf(char *fname, cache_storage_t *LS) {
struct stat sb;
if (strcmp(LS->type, "GPU") == 0 || strcmp(LS->type, "MEMORY") == 0 ||
(stat(LS->path, &sb) == 0 && S_ISDIR(sb.st_mode))) {
return 0;
return SUCCEED;
} else {
int ret = snprintf(error_msg, ERROR_MSG_SIZE,
"H5LSset: path %s does not exist\n", LS->path);
Expand All @@ -212,6 +214,7 @@ herr_t readLSConf(char *fname, cache_storage_t *LS) {
LOG_ERROR(-1, "%s", error_msg);
MPI_Abort(MPI_COMM_WORLD, 112);
}
return SUCCEED;
}

/*-------------------------------------------------------------------------
Expand Down Expand Up @@ -295,14 +298,15 @@ herr_t H5LSset(cache_storage_t *LS, char *type, char *path,
struct stat sb;
if (strcmp(type, "GPU") == 0 || strcmp(type, "MEMORY") == 0 ||
(stat(path, &sb) == 0 && S_ISDIR(sb.st_mode))) {
return 0;
return SUCCEED;
} else {
LOG_ERROR(-1,
"ERROR in name space for cache storage: %s does "
"not exist\n",
path);
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
}
return SUCCEED;
} /* end H5LSset */

/*-------------------------------------------------------------------------
Expand Down Expand Up @@ -451,7 +455,7 @@ herr_t H5LSclaim_space(cache_storage_t *LS, hsize_t size, cache_claim_t type,
}
}

return 0;
return SUCCEED;
}

/*-------------------------------------------------------------------------
Expand Down Expand Up @@ -490,7 +494,7 @@ herr_t H5LSremove_cache(cache_storage_t *LS, cache_t *cache) {
#ifndef NDEBUG
LOG_INFO(-1, "H5LSremove_space DONE");
#endif
return 0;
return SUCCEED;
} /* end H5LSremove_cache() */

/*-------------------------------------------------------------------------
Expand Down
Loading