Skip to content

Commit 6d7e2a3

Browse files
committed
docs: update README
1 parent 92db59d commit 6d7e2a3

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

README.md

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,12 @@ enum allGatherType {
2828

2929
##### [NOTE]: `ALL_GATHER_HYPERCUBE` only works when n(size of chare array) is a power of 2.
3030

31-
You must also declare a callback to a function which the library can return to after its done and it must only take a pointer to `allGatherMsg` as its argument. To start operations, each chare array element must call startGather:
31+
You must also declare a callback to a function which the library can return to after its done and it must only take a pointer to `allGatherMsg` as its argument. To start operations, each chare array element must make a local pointer to the library chare array element bound to it and call init.
3232

3333
```C++
34-
AllGather_array({{CHARE_ARRAY_INDEX}}).startGather(data, k, cb);
35-
void done(allGatherMsg *msg);
34+
AllGather* libptr = AllGather_array({{CHARE_ARRAY_INDEX}}).ckLocal();
35+
libptr->init(result, data, cb);
3636
```
37+
Here, result is a pointer to where the user wants the result of allGather operation to be stored(note that it must be of size n * k), data refers to per chare array element contributed data and cb refers to the callback.
3738
38-
Here data refers to per chare array element data and cb refers to the callback.
39-
40-
Once the library is done, it will call the callback function and give it the gathered data as an allGatherMsg. To extract data from it, simply call get_data and the data will always have a size of `n X k`. The structure of `allGatherMsg` is:
41-
42-
```C++
43-
class allGatherMsg : public CMessage_allGatherMsg {
44-
private:
45-
long int *data;
46-
public:
47-
long int *get_data();
48-
allGatherMsg(long int *d);
49-
};
50-
```
39+
Once the library is done, it will send an empty message (a kick if you will) telling the user that the result is now available in the destination that the user specified earlier.

0 commit comments

Comments
 (0)