Skip to content

Commit 92db59d

Browse files
committed
fix: rename default to ring
1 parent 971eca1 commit 92db59d

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ jobs:
2929
run: |
3030
make CHARMC=./charm-v7.0.0/bin/charmc build-simulation
3131
32-
- name: Test allGather DEFAULT
32+
- name: Test allGather RING
3333
run: |
34-
make CHARMC=./charm-v7.0.0/bin/charmc TYPE=DEFAULT test-simulation
34+
make CHARMC=./charm-v7.0.0/bin/charmc TYPE=RING test-simulation
3535
3636
- name: Test allGather HYPERCUBE
3737
run: |

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CHARMC ?= charmc
22
FLAGS = -g -Wall -O2
3-
TYPE ?= DEFAULT
3+
TYPE ?= RING
44
ALLGATHER_DIR=./src/allGather
55
EXAMPLE_DIR=./example
66

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A library for implementing collectives commonly used in machine learning tasks i
44

55
## allGather
66

7-
allGather lets you gather data distributed accross different chare array elements. The library provides 3 algorithms for doing the allGather operations, namely naive, hypercube and flooding.
7+
allGather lets you gather data distributed accross different chare array elements. The library provides 3 algorithms for doing the allGather operations, namely ring, hypercube and flooding.
88

99
### How to use
1010

@@ -13,14 +13,14 @@ declare allGather as an extern module in your `.ci` file and include the `allGat
1313
```C++
1414
CkArrayOptions opts(n);
1515
opts.bindTo(sim);
16-
AllGather_array = CProxy_AllGather::ckNew(k, n, (int)allGatherType::ALL_GATHER_DEFAULT, opts);
16+
AllGather_array = CProxy_AllGather::ckNew(k, n, (int)allGatherType::ALL_GATHER_RING, opts);
1717
```
1818
1919
Here n refers to the size of the chare array, k refers to the number of data elements present in each chare array element and the third parameter lets you choose the algorithm you want to run. The algorithms are:
2020
2121
```C++
2222
enum allGatherType {
23-
ALL_GATHER_DEFAULT,
23+
ALL_GATHER_RING,
2424
ALL_GATHER_HYPERCUBE,
2525
ALL_GATHER_FLOODING
2626
};

example/user.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ start::start(CkArgMsg *msg) {
2828
AllGather_array = CProxy_AllGather::ckNew(k, n, (int)allGatherType::ALL_GATHER_HYPERCUBE, opts);
2929
#endif
3030

31-
#ifdef DEFAULT
32-
AllGather_array = CProxy_AllGather::ckNew(k, n, (int)allGatherType::ALL_GATHER_DEFAULT, opts);
31+
#ifdef RING
32+
AllGather_array = CProxy_AllGather::ckNew(k, n, (int)allGatherType::ALL_GATHER_RING, opts);
3333
#endif
3434

3535
sim.begin(AllGather_array);

src/allGather/allGather.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ AllGather::AllGather(int k, int n, int type) : k(k), n(n) {
4040
}
4141
}
4242
} break;
43-
case allGatherType::ALL_GATHER_DEFAULT: {
43+
case allGatherType::ALL_GATHER_RING: {
4444
} break;
4545
}
4646
}
@@ -75,15 +75,15 @@ void AllGather::startGather() {
7575
store[k * thisIndex + i] = data[i];
7676
}
7777
CkNcpyBuffer src(data, k*sizeof(long int), dum_dum, CK_BUFFER_UNREG);
78-
78+
7979
switch (type) {
80-
case allGatherType::ALL_GATHER_DEFAULT: {
80+
case allGatherType::ALL_GATHER_RING: {
8181
#ifdef TIMESTAMP
82-
thisProxy[(thisIndex + 1) % n].recvDefault(
82+
thisProxy[(thisIndex + 1) % n].recvRing(
8383
thisIndex, src, (timeStamp + alpha + beta * k * 8));
8484
timeStamp += alpha;
8585
#else
86-
thisProxy[(thisIndex + 1) % n].recvDefault(thisIndex, src, 0.0);
86+
thisProxy[(thisIndex + 1) % n].recvRing(thisIndex, src, 0.0);
8787
#endif
8888
} break;
8989
case allGatherType::ALL_GATHER_HYPERCUBE: {
@@ -108,19 +108,19 @@ void AllGather::startGather() {
108108
}
109109
}
110110

111-
void AllGather::recvDefault(int sender, CkNcpyBuffer src, double recvTime) {
111+
void AllGather::recvRing(int sender, CkNcpyBuffer src, double recvTime) {
112112
CkNcpyBuffer dst(store + sender * k, k * sizeof(long int), zero_copy_callback, CK_BUFFER_UNREG);
113113
dst.get(src);
114114
#ifdef TIMESTAMP
115115
timeStamp = std::max(recvTime, timeStamp);
116116
#endif
117117
if (((thisIndex + 1) % n) != sender) {
118118
#ifdef TIMESTAMP
119-
thisProxy[(thisIndex + 1) % n].recvDefault(
119+
thisProxy[(thisIndex + 1) % n].recvRing(
120120
sender, src, (timeStamp + alpha + beta * k * 8));
121121
timeStamp += alpha;
122122
#else
123-
thisProxy[(thisIndex + 1) % n].recvDefault(sender, src, 0.0);
123+
thisProxy[(thisIndex + 1) % n].recvRing(sender, src, 0.0);
124124
#endif
125125
}
126126
}

src/allGather/allGather.ci

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module allGather {
99
entry AllGather(int size, int n, int type);
1010
entry[reductiontarget] void initdone(int num);
1111
entry void startGather();
12-
entry void recvDefault(int sender, CkNcpyBuffer data, double recvTime);
12+
entry void recvRing(int sender, CkNcpyBuffer data, double recvTime);
1313
entry void local_buff_done(CkDataMsg *m);
1414
entry void Hypercube() {
1515
for(iter = 0; iter < numHypercubeIter; iter++) {

src/allGather/allGather.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class allGatherMsg : public CMessage_allGatherMsg {};
1313

1414
// NB: ALL_GATHER_HYPERCUBE only works when the size of chare array is a power of 2.
1515
enum allGatherType {
16-
ALL_GATHER_DEFAULT,
16+
ALL_GATHER_RING,
1717
ALL_GATHER_HYPERCUBE,
1818
ALL_GATHER_FLOODING
1919
};
@@ -47,7 +47,7 @@ public:
4747

4848
void startGather();
4949

50-
void recvDefault(int sender, CkNcpyBuffer data, double recvTime);
50+
void recvRing(int sender, CkNcpyBuffer data, double recvTime);
5151

5252
void local_buff_done(CkDataMsg *m);
5353

0 commit comments

Comments
 (0)