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

Release 1.4.0 to master #866

Merged
merged 1,008 commits into from
Aug 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1008 commits
Select commit Hold shift + click to select a range
359e0f0
fix third-party parameter passing
upsj Jun 7, 2021
80ac26b
vendor CAS module
upsj Jun 8, 2021
6c4b65f
fix find_package parameter order
upsj Jun 8, 2021
9e0c3c3
review updates
upsj Jun 8, 2021
afd28c6
simplify hwloc integration
upsj Jun 10, 2021
c2ff5e1
quiet OpenCV find_package
upsj Jun 16, 2021
d4929a3
add message if no OpenCV was found
upsj Jun 16, 2021
8e82035
add reference tests for simple solver kernels
upsj Jun 1, 2021
2c37f28
fix uninitialized data in tests
upsj Jun 11, 2021
e89e451
fail on unsupported build type
upsj Jun 16, 2021
37f7e81
fix Idr UBSAN warning
upsj Jun 16, 2021
5214ad1
fix ISAI out-of-bounds read
upsj Jun 16, 2021
85fcff8
run cuda-memcheck on amdci
upsj Jun 16, 2021
059076f
run cuda-memcheck with CUDA 10.1 on amdci
upsj Jun 17, 2021
b14d6c0
add matrix dimensions to matrix_statistics
upsj Jun 22, 2021
4f1273a
changes repetition flag type to string
MarcelKoch Jun 11, 2021
43c3329
adds repetition number to benchmark json output
MarcelKoch Jun 11, 2021
8c01897
adds include guard in benchmark/utils/timer.hpp
MarcelKoch Jun 11, 2021
232529c
checks benchmark completion in each iteration
MarcelKoch Jun 18, 2021
d78c174
enables adaptive benchmarking for preconditioner
MarcelKoch Jun 21, 2021
70207e8
Review update and `status` visability change
MarcelKoch Jun 22, 2021
3639dc9
increases the interval between two timings
MarcelKoch Jun 23, 2021
29be0c7
synchronizes all timers on `tic/toc`
MarcelKoch Jun 23, 2021
d3be987
adds switch deactivating timings in `run_control`
MarcelKoch Jun 23, 2021
edbec84
removes sync from `toc` call
MarcelKoch Jun 23, 2021
2163aa1
Review updates
MarcelKoch Jun 24, 2021
ffeb446
Add whitespace
Jun 28, 2021
f82502f
Write out dpcpp version number
Jun 28, 2021
bac95e9
Add FC to contributors.txt
Jun 29, 2021
c769fd2
update example output validation
upsj Jun 29, 2021
2691eab
fix Coo overwriting padding
upsj Jun 30, 2021
c9258dd
review updates
upsj Jun 30, 2021
a90d53c
review updates
upsj Jul 1, 2021
1d7a373
Add scalar jacobi framework
pratikvn Jun 29, 2021
a1c4f8f
Add scalar jacobi reference and omp kernels
pratikvn Jun 29, 2021
0b5c713
Add cuda and hip kernels
pratikvn Jun 29, 2021
ce8efdf
Add omp, cuda and hip tests
pratikvn Jun 30, 2021
b9b95cc
Review update: s/Diagonal matrix/blocks array
pratikvn Jul 1, 2021
8adf357
avoid benchmarking ELL format with heavy imbalance
upsj Jul 2, 2021
53cc179
use better ELL benchmark exclusion criterion
upsj Jul 3, 2021
17cb315
fix OpenMP Coo/Hybrid -> Csr conversion
upsj Jul 4, 2021
fd7a3c2
fix conversion benchmark repetition count
upsj Jul 4, 2021
451e063
add repetitions flag to benchmark script
upsj Jul 4, 2021
dc9626e
fix OpenMP Hybrid->Csr conversion
upsj Jul 4, 2021
d1d014a
fix benchmarks with BUILD_CUDA on non-GPU systems
upsj Jul 5, 2021
7aaedc1
check ELL imbalance limit in benchmarks directly
upsj Jul 5, 2021
9778e12
store benchmarking exceptions in JSON
upsj Jul 5, 2021
d1a6a68
review updates
upsj Jul 6, 2021
7c84f28
Merge Add missing examples in list
Jul 7, 2021
f5c987c
fix blas benchmark gemm
upsj Jul 8, 2021
a7a6397
add simple kernel support
upsj Mar 24, 2021
213c58d
Revert "add simple kernel support"
upsj Apr 2, 2021
236d8c6
add direct kernel launch wrappers
upsj Apr 2, 2021
b3be8b2
set correct nvcc flags
upsj Apr 2, 2021
0433b8e
work around icpc internal compiler error
upsj Apr 2, 2021
46a2d2b
workaround for MSVC extended-lambda issue
upsj Apr 2, 2021
75e09ef
unify cg and precision_conversion kernel files
upsj May 21, 2021
ab62da1
review updates and formatting
upsj May 21, 2021
a6c8598
unify kernel files
upsj May 21, 2021
4302389
make simple kernel launchers free functions
upsj May 21, 2021
187e7eb
make device mapping more flexible
upsj May 21, 2021
52ebda7
move dense operations to simple interface
upsj May 21, 2021
96ec6d7
add simple Krylov kernels
upsj May 21, 2021
2523f03
eliminate unnecessary stride parameters
upsj May 22, 2021
b2208cb
replace BLAS axpy and scal by simple kernels
upsj May 22, 2021
1087b33
don't preserve stride on create_with_same_config
upsj Jun 1, 2021
2c18d13
review updates
upsj Jun 1, 2021
004691e
unify simple solver kernel tests
upsj Jun 8, 2021
1f1a078
add tests for stride handling and zero division
upsj Jun 8, 2021
0a4d062
review updates
upsj Jun 8, 2021
67957bb
use consistent zero assignment in common kernels
upsj Jun 8, 2021
2f85a55
remove unstable bicg test
upsj Jun 8, 2021
3f8a3d8
add kernel launch tests
upsj Jun 9, 2021
f03ace1
simplify device_unpack_2d_impl parameters
upsj Jun 11, 2021
6cdfba8
adapt test_install paths
upsj Jun 11, 2021
c1e7347
fix kernel launch tests
upsj Jun 11, 2021
7a26fd7
add support for DPCPP_SINGLE_MODE to tests
upsj Jun 11, 2021
fd858a3
fix clang-cuda tests
upsj Jun 11, 2021
286966b
fix OpenMP collapse compilation issue
upsj Jun 11, 2021
47361c5
relax solver test precision
upsj Jun 11, 2021
acac9e0
use SYCL_DEVICE_TYPE/FILTER to make sure using gpu/cpu
yhmtsai May 20, 2021
cb8e046
remove OpenMP collapse(2)
upsj Jun 11, 2021
4e2c2f3
explicitly unroll OpenMP simple kernels
upsj Jun 11, 2021
2d48a77
avoid unrolling remainder loop
upsj Jun 11, 2021
fbc20fd
unroll width 4
upsj Jun 11, 2021
4f1ba9d
explicitly unroll remainder with width 4
upsj Jun 11, 2021
d654ead
add kernel_launch to format_header.sh config
upsj Jun 11, 2021
36beda7
keep stride in solver create_with_same_config
upsj Jun 17, 2021
aa86ad9
update documentation and assertions
upsj Jun 17, 2021
4fc79cc
fix remaining create_with_same_config test
upsj Jun 17, 2021
d0a6371
review updates
upsj Jun 23, 2021
4f65152
extract common code for simple kernel launch
upsj Jun 23, 2021
f19dc74
work around DPC++ use-after-free
upsj Jun 23, 2021
61edc0e
improve documentation for kernel_launch
upsj Jun 24, 2021
065a648
move simple dense kernel tests to common tests
upsj Jun 24, 2021
08a2256
increase BiCGSTAB test tolerances
upsj Jun 24, 2021
1e55da9
fix formatting
upsj Jun 24, 2021
6a52ee0
move kernel_launch defines into test CMakeLists
upsj Jun 24, 2021
05fabc3
update test_install path for formatting job
upsj Jun 29, 2021
15c0b0f
rename compile tests inside test/
upsj Jun 29, 2021
29d0e4b
remove circular dependency in kernel_launch header
upsj Jun 29, 2021
fd90794
review updates
upsj Jun 29, 2021
642c2a2
remove magic numbers for OpenMP unrolling
upsj Jun 29, 2021
595ea65
fix include position for kernel_launch tests
upsj Jun 29, 2021
c297269
fix single-precision dpcpp dense kernel tests
upsj Jun 29, 2021
147b4fd
skip DPCPP solver apply tests
upsj Jul 9, 2021
9d8b6ea
Add ostream overload for dim.
pratikvn Jul 6, 2021
9a06059
Add span length getter
pratikvn Jul 6, 2021
efb1a88
A cleaner ostream output.
pratikvn Jul 7, 2021
8043825
Review update
pratikvn Jul 8, 2021
5758d41
use consistent matrix index type in benchmark
upsj Jul 7, 2021
58e2ede
add DPC++ SPGEMM and SPGEAM kernels
upsj Jun 17, 2021
bbfd9b4
add dpcpp is_sorted_by_col_idxs kernel
upsj Jun 18, 2021
dbe6251
add dpcpp csrsort
upsj Jun 18, 2021
cfb2048
add dpcpp transpose kernels
upsj Jun 18, 2021
668e655
review updates
upsj Jul 14, 2021
a618e89
fixes dummy-hook's .git directory for multiple work trees
MarcelKoch Jul 9, 2021
10bee50
includes git-cmake-format fix
MarcelKoch Jul 9, 2021
67f7c16
enables overwriting hook by default
MarcelKoch Jul 14, 2021
dddaad0
clarify that git hooks may be overwritten
MarcelKoch Jul 13, 2021
f3ddf84
Review update:
MarcelKoch Jul 15, 2021
9b41d56
ResidualNorm stop can compute the needed info in gen/check
yhmtsai Jul 14, 2021
4f1a03f
allocate one/neg_one in the class
yhmtsai Jul 15, 2021
a2d0488
cp error between diff backend on the same device
yhmtsai Jul 9, 2021
3b21de1
memcpy only when their device are the same
yhmtsai Jul 9, 2021
5da5dd7
add a test to check free after kernel
yhmtsai Jul 11, 2021
cb924d4
add wait_and_throw, capture exception,add job/test
yhmtsai Jul 13, 2021
d933b3e
clog for copy via host when verbose>=1, and debug
yhmtsai Jul 15, 2021
b155ccf
check in git then get abs_path, avoid add_dep
yhmtsai Jul 16, 2021
928103b
update format header
yhmtsai Feb 19, 2021
7228f94
auto
yhmtsai Feb 19, 2021
ffe1230
manual modification
yhmtsai Feb 19, 2021
6370f76
auto dense
yhmtsai Feb 19, 2021
fa28497
dense, prefix_sum and uninitialized_array
yhmtsai Feb 24, 2021
c4e81dc
use warp_size 32 to check
yhmtsai May 20, 2021
76e0294
fix extract_diag, try default, and single test
yhmtsai May 20, 2021
ebbf4a9
use simple macro
yhmtsai May 21, 2021
9d548f1
add as_array and reduce_add_array for config
yhmtsai May 22, 2021
ac62588
fix dpcpp doesn't have subwarp and use ConfigSet
yhmtsai May 24, 2021
22ab0a0
move to new style for config selection
yhmtsai May 25, 2021
e3a4865
mv config to the first argument
yhmtsai May 25, 2021
ed501f1
update lateset ConfigSet and dense kernel/test
yhmtsai Jun 1, 2021
63e1a69
fix sellp stuck
yhmtsai Jun 2, 2021
8542769
add cp, update doc, mv mkl bind
yhmtsai Jul 8, 2021
45ecddb
MKL cmake, delete unused, simplify func, add job
yhmtsai Jul 13, 2021
b26a2ef
MKL static cmake
yhmtsai Jul 16, 2021
0ba615e
use mkl in ncols=1, add cuda descp in dpcpp thread
yhmtsai Jul 18, 2021
429cc96
improve document, fix auto usage in for, shared_memory usage
yhmtsai Jul 20, 2021
e4551c1
add some note to indicate the porting TODO
yhmtsai Jul 20, 2021
ce20100
explict type in for, use func not macro to skip, remove dup test
yhmtsai Jul 21, 2021
048570d
debug/static dpcpp -> debug/shared due to memory
yhmtsai Jul 21, 2021
c1eea63
initial the dpcpp porting script
yhmtsai May 27, 2021
777bf57
add range nonconst copy constructor
yhmtsai May 27, 2021
d779729
porting ell with some fix
yhmtsai May 27, 2021
ad497dd
update some regex and remove auto config add
yhmtsai Jul 7, 2021
cda47e8
add workaround for MSVC but it disable the dpcpp support possiblility…
yhmtsai Jul 7, 2021
baaa4bb
avoid templated constructor as cp/mv constuctor
yhmtsai Jul 7, 2021
5934bfd
ell test with single_mode
yhmtsai Jul 13, 2021
0643847
update script
yhmtsai Jul 19, 2021
080f3b8
delete debug comment, update description, refine format
yhmtsai Jul 19, 2021
e76167f
auto replace shared_memory and update ell
yhmtsai Jul 21, 2021
01f8c73
alter. to avoid constructor taking range itself
yhmtsai Jul 21, 2021
dc2b179
relax the error bound on adv_apply_on_small_mtx
yhmtsai Jul 22, 2021
270c08a
add ILU0 reference kernels
upsj Jul 15, 2021
fc0926d
add missing IC conjugate
upsj Jul 16, 2021
dd1bd22
anticipate Thomas' review comments
upsj Jul 16, 2021
ca99164
update tests
upsj Jul 23, 2021
5f3a951
fix ILU and IC kernels on CUDA 11.4
upsj Jul 23, 2021
d0e63ae
add inverse scale and axpy
upsj Jul 23, 2021
2d13593
Ignore IDE generated files
Jul 21, 2021
0949a64
Minor update and OS generated files
Jul 22, 2021
a94218d
dpcpp trans impl
yhmtsai Jul 18, 2021
f027f38
residual norm porting and enable the solver test
yhmtsai Jul 19, 2021
ffd9ee6
porting and formating
yhmtsai Jul 19, 2021
a995049
fix issue from porting and add atomic max bind
yhmtsai Jul 20, 2021
ac9f05d
move some dpcpp job to full pipeline
yhmtsai Jul 22, 2021
ce66a3c
bind mkl isn't in anymous, collect common gmres
yhmtsai Jul 23, 2021
34f1248
update the usage, doc, and ci
yhmtsai Jul 27, 2021
dcf5f57
impl residual norm directly and simplify host.
yhmtsai Jul 27, 2021
4dc0887
add the issue test for cuda/hip reset collision
yhmtsai Jun 9, 2021
1982665
add device
yhmtsai Jun 9, 2021
386a00a
put device in ginkgo_device not device_mutex
yhmtsai Jul 1, 2021
2824f69
use static getter to avoid the static issue in MSVC
yhmtsai Jul 1, 2021
ca1e0d2
add cudacuda and hiphip test
yhmtsai Jul 8, 2021
05adcb5
ensure ops affected by Reset after increase_exec
yhmtsai Jul 9, 2021
bf667d7
use device_class and move definition to cpp
yhmtsai Jul 29, 2021
7ac9596
handle deleter in create not destructor of class
yhmtsai Jul 29, 2021
db43783
increase/decrease num_exec when enabling module
yhmtsai Jul 30, 2021
13bb087
move all related to cmake into cpp not hpp
yhmtsai Aug 1, 2021
b58e746
use snake_case and move the compile_definitions
yhmtsai Aug 2, 2021
7db5c1c
scalar_jacobi on diff precision csr
yhmtsai Jul 14, 2021
fc1c35f
scalarjacobi allows diff system matrix and add DiagonalLinOpExtractable
yhmtsai Jul 14, 2021
b831d60
move diagonalextrable impl with instantiate
yhmtsai Jul 16, 2021
d0cd306
fix executor issue
yhmtsai Jul 19, 2021
aad5bdf
use template_conversion, add diagonal precision convert
yhmtsai Aug 2, 2021
cd75559
review update
yhmtsai Aug 3, 2021
f502268
use the baseline directly
yhmtsai Aug 3, 2021
c1feeb6
Fix README.md and INSTALL.md.
tcojean Aug 4, 2021
106a0ef
Disable the MSVC-CUDA 10.2 job.
tcojean Aug 4, 2021
65b464a
Review Updates.
tcojean Aug 4, 2021
8d667fe
correctly derive enablelogging from template parameter
MarcelKoch Jul 21, 2021
fc13249
remove copy of shared_ptr in `remove_logger`
MarcelKoch Jul 21, 2021
5432ee9
Review update
MarcelKoch Jul 22, 2021
98ac375
use shallow clones for Actions where possible
upsj Aug 5, 2021
5b7244d
allow bot pushes to trigger workflows
upsj Aug 5, 2021
e9578ff
use shallow clone also for OS X
upsj Aug 5, 2021
dea560b
remove fetch-depth default
upsj Aug 5, 2021
185f61e
porting and formating
yhmtsai Jul 19, 2021
778a91f
compile but idr still has issue on initial
yhmtsai Jul 20, 2021
4a5434f
add weird barrier in idr and fix precision
yhmtsai Jul 28, 2021
11a0606
oneDPL for complex generation
yhmtsai Jul 29, 2021
b9e6244
relax the error bound of hessenberg
yhmtsai Aug 3, 2021
d49c7be
rm dpct warning, use ref of uninitialized_array, reduce test code dup
yhmtsai Aug 3, 2021
c525aab
pass reference not pointer of UA, overlap shared
yhmtsai Aug 4, 2021
f0892e2
fix idr race condition
yhmtsai Aug 5, 2021
5860216
auto
yhmtsai Jul 21, 2021
40c620b
auto components
yhmtsai Jul 22, 2021
fb6509a
format matrix
yhmtsai Jul 22, 2021
0f04274
fix matrix format
yhmtsai Jul 22, 2021
63910f1
component fix
yhmtsai Jul 22, 2021
0c935d5
fix
yhmtsai Jul 22, 2021
cfc19da
del csr apply unsorted csr test, note csr lb arg
yhmtsai Jul 26, 2021
6d5b466
fix hip, keep consistence, rename cusparse->onemkl
yhmtsai Jul 29, 2021
5d92179
review update
yhmtsai Jul 30, 2021
f918087
delete EnableLinOp convert_to due to impl in dense
yhmtsai Aug 3, 2021
b8786ed
keep consist, fix exec test, collect csr common
yhmtsai Aug 4, 2021
acff91c
add strategy_name for csr strategy
yhmtsai Aug 5, 2021
7137a6f
use subgroup_tile sync, relax idr errorbound
yhmtsai Aug 6, 2021
bdbd085
Use invert diagonal instead.
pratikvn Aug 5, 2021
4b6b36b
Add convert to Dense kernel
pratikvn Aug 5, 2021
0b53587
Update Jacobi write for scalar.
pratikvn Aug 5, 2021
3ce29d5
Scalar Jacobi transpose
pratikvn Aug 5, 2021
249b076
Scalar Jacobi conj_transpose
pratikvn Aug 5, 2021
7aeea40
Add conj transpose kernel and update inv kernel
pratikvn Aug 5, 2021
3c8a356
Review update.
pratikvn Aug 6, 2021
ed2550b
Use simple kernels for conj and invert_diag
pratikvn Aug 6, 2021
dff2f3e
Use simple kernels for scalar apply, dense convert
pratikvn Aug 6, 2021
1da5a27
Review update.
pratikvn Aug 6, 2021
4e91906
Update doc
pratikvn Aug 6, 2021
7475a0f
Split common kernel implementations into cuda_hip and unified
tcojean Aug 6, 2021
d717c11
Format files
ginkgo-bot Aug 6, 2021
1f9c5cd
Review Updates.
tcojean Aug 6, 2021
5caa4fd
add gitlab option to ignore idr test result (cancelled)
yhmtsai Aug 9, 2021
a3c4814
skip idr test when the queue is on gpu
yhmtsai Aug 9, 2021
192ef94
match_edge issue on isolated item
yhmtsai Aug 17, 2021
722c517
fix ref issue, raise issue device test
yhmtsai Aug 17, 2021
de2cd71
fix device issue, use new GKO_FACTORY_PARAMETER_*
yhmtsai Aug 18, 2021
7578065
Update Changelog, Readme
tcojean Aug 10, 2021
44538ed
Bump third party libraries
tcojean Aug 10, 2021
555f65e
Review updates.
tcojean Aug 11, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 22 additions & 0 deletions .github/bot-base.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

set -e

API_HEADER="Accept: application/vnd.github.v3+json"
AUTH_HEADER="Authorization: token $GITHUB_TOKEN"

api_get() {
curl -X GET -s -H "${AUTH_HEADER}" -H "${API_HEADER}" "$1"
}

api_post() {
curl -X POST -s -H "${AUTH_HEADER}" -H "${API_HEADER}" "$1" -d "$2"
}

api_patch() {
curl -X PATCH -s -H "${AUTH_HEADER}" -H "${API_HEADER}" "$1" -d "$2"
}

api_delete() {
curl -X DELETE -s -H "${AUTH_HEADER}" -H "${API_HEADER}" "$1"
}
100 changes: 100 additions & 0 deletions .github/bot-pr-base.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#!/bin/bash

source .github/bot-base.sh

echo -n "Collecting information on triggering PR"
PR_URL=$(jq -r .pull_request.url "$GITHUB_EVENT_PATH")
if [[ "$PR_URL" == "null" ]]; then
# if this was triggered by an issue comment: get PR and commenter
echo -n .............
PR_URL=$(jq -er .issue.pull_request.url "$GITHUB_EVENT_PATH")
echo -n .
USER_LOGIN=$(jq -er ".comment.user.login" "$GITHUB_EVENT_PATH")
echo -n .
USER_URL=$(jq -er ".comment.user.url" "$GITHUB_EVENT_PATH")
echo -n .
else
# else it was triggered by a PR sync: get PR creator
USER_LOGIN=$(jq -er ".pull_request.user.login" "$GITHUB_EVENT_PATH")
echo -n .
USER_URL=$(jq -er ".pull_request.user.url" "$GITHUB_EVENT_PATH")
echo -n .
fi
echo -n .
PR_JSON=$(api_get $PR_URL)
echo -n .
PR_MERGED=$(echo "$PR_JSON" | jq -r .merged)
echo -n .
ISSUE_URL=$(echo "$PR_JSON" | jq -er ".issue_url")
echo -n .
BASE_REPO=$(echo "$PR_JSON" | jq -er .base.repo.full_name)
echo -n .
BASE_BRANCH=$(echo "$PR_JSON" | jq -er .base.ref)
echo -n .
HEAD_REPO=$(echo "$PR_JSON" | jq -er .head.repo.full_name)
echo -n .
HEAD_BRANCH=$(echo "$PR_JSON" | jq -er .head.ref)
echo .

BASE_URL="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/$BASE_REPO"
HEAD_URL="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/$HEAD_REPO"

JOB_URL="https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"

bot_delete_comments_matching() {
local search_matching="$1"
COMMENTS=$(api_get "$ISSUE_URL/comments" | jq -r '.[] | select((.user.login == "ginkgo-bot") and (.body | startswith('"\"$search_matching\""'))) | .url')
for URL in $COMMENTS; do
api_delete "$URL" > /dev/null
done
}

bot_comment() {
api_post "$ISSUE_URL/comments" "{\"body\":\"$1\"}" > /dev/null
}

bot_error() {
echo "$1"
bot_comment "Error: $1"
exit 1
}

bot_get_all_changed_files() {
local pr_url="$1"
local pr_files=""
local page="1"
while true; do
# this api allows 100 items per page
# github action uses `bash -e`. The last empty page will leads jq error, use `|| :` to ignore the error.
local pr_page_files=$(api_get "$pr_url/files?&per_page=100&page=${page}" | jq -er '.[] | select(.status != "removed") | .filename' || :)
if [ "${pr_page_files}" = "" ]; then
break
fi
if [ ! "${pr_files}" = "" ]; then
# add the same new line format as jq output
pr_files="${pr_files}"$'\n'
fi
pr_files="${pr_files}${pr_page_files}"
page=$(( page + 1 ))
done
echo "${pr_files}"
}

# collect info on the user that invoked the bot
echo -n "Collecting information on triggering user"
USER_JSON=$(api_get $USER_URL)
echo .

USER_NAME=$(echo "$USER_JSON" | jq -r ".name")
if [[ "$USER_NAME" == "null" ]]; then
USER_NAME=$USER_LOGIN
fi
USER_EMAIL=$(echo "$USER_JSON" | jq -r ".email")
if [[ "$USER_EMAIL" == "null" ]]; then
USER_EMAIL="$USER_LOGIN@users.noreply.github.com"
fi
USER_COMBINED="$USER_NAME <$USER_EMAIL>"

if [[ "$PR_MERGED" == "true" ]]; then
bot_error "PR already merged!"
fi
44 changes: 44 additions & 0 deletions .github/bot-pr-format-base.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

source .github/bot-pr-base.sh

EXTENSION_REGEX='\.(cuh?|hpp|hpp\.inc?|cpp)$'
FORMAT_HEADER_REGEX='^(benchmark|core|cuda|hip|include/ginkgo/core|omp|reference|dpcpp)/'
FORMAT_REGEX='^(common|examples|test)/'

echo "Retrieving PR file list"
PR_FILES=$(bot_get_all_changed_files ${PR_URL})
NUM=$(echo "${PR_FILES}" | wc -l)
echo "PR has ${NUM} changed files"

TO_FORMAT="$(echo "$PR_FILES" | grep -E $EXTENSION_REGEX || true)"

git remote add fork "$HEAD_URL"
git fetch fork "$HEAD_BRANCH"

git config user.email "ginkgo.library@gmail.com"
git config user.name "ginkgo-bot"

# save scripts from develop
pushd dev_tools/scripts
cp add_license.sh format_header.sh update_ginkgo_header.sh /tmp
popd

# checkout current PR head
LOCAL_BRANCH=format-tmp-$HEAD_BRANCH
git checkout -b $LOCAL_BRANCH fork/$HEAD_BRANCH

# restore files from develop
cp /tmp/add_license.sh dev_tools/scripts/
cp /tmp/format_header.sh dev_tools/scripts/
cp /tmp/update_ginkgo_header.sh dev_tools/scripts/

# format files
CLANG_FORMAT=clang-format-9
dev_tools/scripts/add_license.sh
dev_tools/scripts/update_ginkgo_header.sh
for f in $(echo "$TO_FORMAT" | grep -E $FORMAT_HEADER_REGEX); do dev_tools/scripts/format_header.sh "$f"; done
for f in $(echo "$TO_FORMAT" | grep -E $FORMAT_REGEX); do "$CLANG_FORMAT" -i -style=file "$f"; done

# restore formatting scripts so they don't appear in the diff
git checkout -- dev_tools/scripts/*.sh
19 changes: 19 additions & 0 deletions .github/check-format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

cp .github/bot-pr-format-base.sh /tmp
source /tmp/bot-pr-format-base.sh

# check for changed files, replace newlines by \n
LIST_FILES=$(git diff --name-only | sed '$!s/$/\\n/' | tr -d '\n')

git diff > /tmp/format.patch
mv /tmp/format.patch .

bot_delete_comments_matching "Error: The following files need to be formatted"

if [[ "$LIST_FILES" != "" ]]; then
MESSAGE="The following files need to be formatted:\n"'```'"\n$LIST_FILES\n"'```'
MESSAGE="$MESSAGE\nYou can find a formatting patch under **Artifacts** [here]"
MESSAGE="$MESSAGE($JOB_URL) or run "'`format!` if you have write access to Ginkgo'
bot_error "$MESSAGE"
fi
15 changes: 15 additions & 0 deletions .github/format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

cp .github/bot-pr-format-base.sh /tmp
source /tmp/bot-pr-format-base.sh

# check for changed files, replace newlines by \n
LIST_FILES=$(git diff --name-only | sed '$!s/$/\\n/' | tr -d '\n')

# commit changes if necessary
if [[ "$LIST_FILES" != "" ]]; then
git commit -a -m "Format files

Co-authored-by: $USER_COMBINED"
git push fork $LOCAL_BRANCH:$HEAD_BRANCH 2>&1 || bot_error "Cannot push formatted branch, are edits for maintainers allowed?"
fi
46 changes: 46 additions & 0 deletions .github/label.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

source .github/bot-pr-base.sh

echo "Retrieving PR file list"
PR_FILES=$(bot_get_all_changed_files ${PR_URL})
NUM=$(echo "${PR_FILES}" | wc -l)
echo "PR has ${NUM} changed files"

echo "Retrieving PR label list"
OLD_LABELS=$(api_get "$ISSUE_URL" | jq -er '[.labels | .[] | .name]')


label_match() {
if echo "$PR_FILES" | grep -qE "$2"; then
echo "+[\"$1\"]"
fi
}

LABELS="[]"
LABELS=$LABELS$(label_match mod:core '(^core/|^include/)')
LABELS=$LABELS$(label_match mod:reference '^reference/')
LABELS=$LABELS$(label_match mod:openmp '^omp/')
LABELS=$LABELS$(label_match mod:cuda '(^cuda/|^common/)')
LABELS=$LABELS$(label_match mod:hip '(^hip/|^common/)')
LABELS=$LABELS$(label_match mod:dpcpp '^dpcpp/')
LABELS=$LABELS$(label_match reg:benchmarking '^benchmark/')
LABELS=$LABELS$(label_match reg:example '^examples/')
LABELS=$LABELS$(label_match reg:build '(cm|CM)ake')
LABELS=$LABELS$(label_match reg:ci-cd '(^\.github/|\.yml$)')
LABELS=$LABELS$(label_match reg:documentation '^doc/|\.md$')
LABELS=$LABELS$(label_match reg:testing /test/)
LABELS=$LABELS$(label_match reg:helper-scripts '^dev_tools/')
LABELS=$LABELS$(label_match type:factorization /factorization/)
LABELS=$LABELS$(label_match type:matrix-format /matrix/)
LABELS=$LABELS$(label_match type:multigrid /multigrid/)
LABELS=$LABELS$(label_match type:preconditioner /preconditioner/)
LABELS=$LABELS$(label_match type:reordering /reorder/)
LABELS=$LABELS$(label_match type:solver /solver/)
LABELS=$LABELS$(label_match type:stopping-criteria /stop/)

# if all mod: labels present: replace by mod:all
LABELS=$(echo "$LABELS" | sed 's/.*mod:.*mod:.*mod:.*mod:.*mod:.*mod:[^"]*"\]/[]+["mod:all"]/')

PATCH_BODY=$(jq -rn "{labels:($OLD_LABELS + $LABELS | unique)}")
api_patch "$ISSUE_URL" "$PATCH_BODY" > /dev/null
23 changes: 23 additions & 0 deletions .github/rebase.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

source .github/bot-pr-base.sh

git remote add base "$BASE_URL"
git remote add fork "$HEAD_URL"

git fetch base $BASE_BRANCH
git fetch fork $HEAD_BRANCH

git config user.email "$USER_EMAIL"
git config user.name "$USER_NAME"

LOCAL_BRANCH=rebase-tmp-$HEAD_BRANCH
git checkout -b $LOCAL_BRANCH fork/$HEAD_BRANCH

bot_delete_comments_matching "Error: Rebase failed"

# do the rebase
git rebase base/$BASE_BRANCH 2>&1 || bot_error "Rebase failed, see the related [Action]($JOB_URL) for details"

# push back
git push --force-with-lease fork $LOCAL_BRANCH:$HEAD_BRANCH 2>&1 || bot_error "Cannot push rebased branch, are edits for maintainers allowed?"
65 changes: 65 additions & 0 deletions .github/workflows/bot-pr-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
on:
issue_comment:
types: [created]
name: OnCommentPR
jobs:
label:
runs-on: ubuntu-latest
if: github.event.issue.pull_request != '' && github.event.comment.body == 'label!' && (github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
steps:
- name: Checkout the latest code (shallow clone)
uses: actions/checkout@v2
with:
ref: develop
- name: Add appropriate labels
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
run: cp .github/label.sh /tmp && /tmp/label.sh
check_format:
name: check-format
runs-on: ubuntu-18.04
if: github.event.issue.pull_request != '' && github.event.comment.body == 'check-format!' && (github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
steps:
- name: Checkout the latest code (shallow clone)
uses: actions/checkout@v2
with:
ref: develop
- name: Check for formatting changes
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
run: cp .github/check-format.sh /tmp && /tmp/check-format.sh
- name: Upload code formatting patch
if: failure()
uses: actions/upload-artifact@v2
with:
name: patch
path: format.patch
format:
name: format
runs-on: ubuntu-18.04
if: github.event.issue.pull_request != '' && github.event.comment.body == 'format!' && (github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
steps:
- name: Checkout the latest code (shallow clone)
uses: actions/checkout@v2
with:
ref: develop
persist-credentials: false
- name: Commit formatting changes
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
run: cp .github/format.sh /tmp && /tmp/format.sh
rebase:
name: rebase
if: github.event.issue.pull_request != '' && github.event.comment.body == 'rebase!' && (github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
runs-on: ubuntu-latest
steps:
- name: Checkout the latest code
uses: actions/checkout@v2
with:
ref: develop
fetch-depth: 0
persist-credentials: false
- name: Automatic Rebase
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
run: cp .github/rebase.sh /tmp && /tmp/rebase.sh
18 changes: 18 additions & 0 deletions .github/workflows/bot-pr-created.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
pull_request_target:
types: [opened]

name: OnNewPR
jobs:
label:
runs-on: ubuntu-latest
if: github.event.pull_request.author_association == 'COLLABORATOR' || github.event.pull_request.author_association == 'MEMBER' || github.event.pull_request.author_association == 'OWNER'
steps:
- name: Checkout the latest code (shallow clone)
uses: actions/checkout@v2
with:
ref: develop
- name: Add appropriate labels
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
run: .github/label.sh
24 changes: 24 additions & 0 deletions .github/workflows/bot-pr-updated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
pull_request_target:
types: [opened,synchronize]

name: OnSyncPR
jobs:
check-format:
runs-on: ubuntu-18.04
if: github.event.pull_request.author_association == 'COLLABORATOR' || github.event.pull_request.author_association == 'MEMBER' || github.event.pull_request.author_association == 'OWNER'
steps:
- name: Checkout the latest code (shallow clone)
uses: actions/checkout@v2
with:
ref: develop
- name: Check for formatting changes
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
run: cp .github/check-format.sh /tmp && /tmp/check-format.sh
- name: Upload code formatting patch
if: failure()
uses: actions/upload-artifact@v2
with:
name: patch
path: format.patch
4 changes: 3 additions & 1 deletion .github/workflows/joss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ jobs:
runs-on: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
- name: Checkout the latest code (shallow clone)
uses: actions/checkout@v2

- name: setup
run: sudo apt-get install texlive-xetex pandoc pandoc-citeproc
- name: info
Expand Down
Loading