Skip to content

Commit e640c9e

Browse files
committed
ci: add github runner to test implementation
1 parent dfac8de commit e640c9e

File tree

3 files changed

+66
-4
lines changed

3 files changed

+66
-4
lines changed

.github/workflows/test.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: build and test collectiveSim
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
run:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: build charmc
17+
run: |
18+
sudo apt install gcc g++
19+
wget https://charm.cs.illinois.edu/distrib/charm-latest.tar.gz
20+
tar xzf charm-latest.tar.gz
21+
cd charm-v7.0.0
22+
./build charm++ netlrts-linux-x86_64 --with-production -j4
23+
24+
- name: build collectiveSim
25+
run: |
26+
make CHARMC=./charm-v7.0.0/bin/charmc collectiveSim
27+
28+
- name: build simulation
29+
run: |
30+
make CHARMC=./charm-v7.0.0/bin/charmc build-simulation
31+
32+
- name: Test allGather DEFAULT
33+
run: |
34+
make CHARMC=./charm-v7.0.0/bin/charmc TYPE=DEFAULT test-simulation
35+
36+
- name: Test allGather HYPERCUBE
37+
run: |
38+
make CHARMC=./charm-v7.0.0/bin/charmc TYPE=HYPERCUBE test-simulation
39+
40+
- name: Test allGather FLOODING
41+
run: |
42+
make CHARMC=./charm-v7.0.0/bin/charmc TYPE=FLOODING test-simulation

Makefile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,37 @@
11
CHARMC ?= charmc
2-
2+
FLAGS = -g -Wall -O2
3+
TYPE ?= DEFAULT
34
ALLGATHER_DIR=./src/allGather
45
EXAMPLE_DIR=./example
56

7+
68
allGather:
79
$(CHARMC) $(ALLGATHER_DIR)/allGather.ci
810
@mv allGather.decl.h $(ALLGATHER_DIR)/allGather.decl.h
911
@mv allGather.def.h $(ALLGATHER_DIR)/allGather.def.h
1012
$(CHARMC) -c $(ALLGATHER_DIR)/allGather.cc
1113
@echo "Built allGather Library"
1214

15+
16+
collectiveSim: allGather
17+
18+
1319
build-simulation: allGather
1420
$(CHARMC) $(EXAMPLE_DIR)/user.ci
1521
@mv user.decl.h $(EXAMPLE_DIR)/user.decl.h
1622
@mv user.def.h $(EXAMPLE_DIR)/user.def.h
17-
$(CHARMC) -I$(ALLGATHER_DIR) $(EXAMPLE_DIR)/user.cc
23+
$(CHARMC) -D$(TYPE) -I$(ALLGATHER_DIR) $(EXAMPLE_DIR)/user.cc
1824
$(CHARMC) -o sim user.o allGather.o
1925
@rm -f user.o allGather.o
2026
@echo "Built simulation"
2127

22-
run-simulation: build-simulation
28+
29+
test-simulation: build-simulation
2330
./charmrun +p19 ./sim 64 29 10 10
2431

32+
2533
clean:
2634
rm -f *.decl.h *.def.h *.o charmrun sim
2735

28-
.phony : run clean sim allGather
36+
37+
.phony : allGather build-simulation run-simulation clean

example/user.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,18 @@ start::start(CkArgMsg *msg) {
1919

2020
CkArrayOptions opts(n);
2121
opts.bindTo(sim);
22+
23+
#ifdef FLOODING
2224
AllGather_array = CProxy_AllGather::ckNew(k, n, (int)allGatherType::ALL_GATHER_FLOODING, opts);
25+
#endif
26+
27+
#ifdef HYPERCUBE
28+
AllGather_array = CProxy_AllGather::ckNew(k, n, (int)allGatherType::ALL_GATHER_HYPERCUBE, opts);
29+
#endif
30+
31+
#ifdef DEFAULT
32+
AllGather_array = CProxy_AllGather::ckNew(k, n, (int)allGatherType::ALL_GATHER_DEFAULT, opts);
33+
#endif
2334

2435
sim.begin(AllGather_array);
2536
}

0 commit comments

Comments
 (0)