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

Gather scatter #52

Draft
wants to merge 58 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
e5824d5
Start working on batchgather
pmarguinaud May 13, 2020
8906c08
First working test_batchgather.cc
pmarguinaud May 15, 2020
42ad722
Save
pmarguinaud May 16, 2020
b32d684
Drop view last dimension, create view without check
pmarguinaud May 17, 2020
6c16d78
dropDimension is an external template
pmarguinaud May 18, 2020
726e613
Convert a view to a list of ArrayView<byte,2>
pmarguinaud May 18, 2020
56ffc8a
Use ioFieldDesc
pmarguinaud May 19, 2020
f9a929e
Split into several files; first working gather
pmarguinaud May 19, 2020
6ffc7ca
Refactor
pmarguinaud May 20, 2020
8a38618
Split into several files
pmarguinaud May 20, 2020
f869fd2
Cleaning
pmarguinaud May 20, 2020
1acc57d
Cleaning
pmarguinaud May 20, 2020
1f31855
Add trace
pmarguinaud May 20, 2020
d38948f
Add trace
pmarguinaud May 20, 2020
ac62479
Cleaning
pmarguinaud May 20, 2020
192cf21
Try grep function
pmarguinaud May 20, 2020
fbb4699
Cleaning
pmarguinaud May 21, 2020
8e3671f
Cleaning
pmarguinaud May 21, 2020
b7d59aa
Cleaning
pmarguinaud May 21, 2020
0179045
Cleaning
pmarguinaud May 21, 2020
e894b5a
Cleaning
pmarguinaud May 21, 2020
5fd5172
Cleaning
pmarguinaud May 21, 2020
eb2980d
Cleaning
pmarguinaud May 21, 2020
d319595
Cleaning
pmarguinaud May 21, 2020
af51904
Cleaning
pmarguinaud May 21, 2020
457d403
Cleaning
pmarguinaud May 21, 2020
bb184ad
Cleaning
pmarguinaud May 21, 2020
0efd0d8
Cleaning
pmarguinaud May 21, 2020
61b1dc0
Cleaning
pmarguinaud May 21, 2020
ae522ab
Cleaning
pmarguinaud May 21, 2020
0019e26
Cleaning
pmarguinaud May 21, 2020
ce4fb69
Use size_t in vector.h
pmarguinaud May 21, 2020
cd4ad44
New GatherScatter routines
pmarguinaud May 21, 2020
d615126
Cleaning
pmarguinaud May 21, 2020
aea8531
Scatter works
pmarguinaud May 21, 2020
bd28475
Cleaning
pmarguinaud May 22, 2020
6683127
Add size accessor to distribution
pmarguinaud May 22, 2020
8630dd8
Cleaning
pmarguinaud May 22, 2020
8e8f79d
Add missing header
pmarguinaud May 22, 2020
e135172
Change printf format
pmarguinaud May 22, 2020
4e6926a
Cleaning
pmarguinaud May 22, 2020
064179f
Cleaning
pmarguinaud May 28, 2020
c824bff
Add block dimension
pmarguinaud May 28, 2020
f8aaa39
test_gatherscatter_ngptotxnflevg
pmarguinaud May 28, 2020
4908463
Fiddle with templates
pmarguinaud May 29, 2020
4bac9da
Fiddle with templates
pmarguinaud May 29, 2020
00c9641
Fiddle with templates
pmarguinaud May 29, 2020
81cf89e
Test gather
pmarguinaud May 29, 2020
3f14811
Test gather/scatter options
pmarguinaud May 29, 2020
6932a92
More Atlas traces
pmarguinaud Jun 3, 2020
b1179c5
Prepare for NPROMA blocks
pmarguinaud Jun 3, 2020
412ae85
Prepare for NPROMA blocks
pmarguinaud Jun 3, 2020
15aaf87
Test gather/scatter for (1:NPROMA,1:NFLEVG,1:NGPBLKS)
pmarguinaud Jun 3, 2020
1cec258
Clean simple test case
pmarguinaud Jun 4, 2020
44cba0d
Remove useless test case
pmarguinaud Jun 4, 2020
90753b2
Cleanup
pmarguinaud Jun 4, 2020
6724f9f
Handle other types/ranks
pmarguinaud Jun 4, 2020
196d2d8
Use viewLoop template
pmarguinaud Jun 16, 2020
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
Prev Previous commit
Next Next commit
Cleaning
  • Loading branch information
pmarguinaud committed May 21, 2020
commit 8e3671f375ebed1843e32b2dbab07578ecf3b414
16 changes: 5 additions & 11 deletions src/tests/functionspace/GatherScatter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ATLAS_TRACE_SCOPE ("GatherScatter::GatherScatter")
}
}

void GatherScatter::gather (std::vector<ioFieldDesc> & floc, std::vector<ioFieldDesc> & fglo) const
void GatherScatter::gather (ioFieldDesc_v & floc, ioFieldDesc_v & fglo) const
{
ATLAS_TRACE_SCOPE ("GatherScatter::gather")
{
Expand All @@ -79,12 +79,6 @@ ATLAS_TRACE_SCOPE ("GatherScatter::gather")
atlas::idx_t nprc = comm.size ();
atlas::idx_t lprc = comm.rank ();

class offlen_t
{
public:
atlas::gidx_t off = 0, len = 0;
};

atlas::idx_t ldim = dist.nb_pts ()[lprc];

// Sort fields by owner
Expand All @@ -101,8 +95,8 @@ ATLAS_TRACE_SCOPE ("GatherScatter::gather")

// SEND

std::vector<offlen_t> fld_loc (nfld + 1);
std::vector<offlen_t> prc_loc (nprc + 1);
offlen_v fld_loc (nfld + 1);
offlen_v prc_loc (nprc + 1);

for (atlas::idx_t jfld = 0; jfld < nfld; jfld++)
{
Expand All @@ -116,8 +110,8 @@ ATLAS_TRACE_SCOPE ("GatherScatter::gather")

// RECV

std::vector<offlen_t> prc_glo (nprc + 1);
std::vector<offlen_t> fld_glo (nfld + 1);
offlen_v prc_glo (nprc + 1);
offlen_v fld_glo (nfld + 1);

for (atlas::idx_t jfld = 0; jfld < nfld; jfld++)
if (lprc == fglo[jfld].owner ())
Expand Down
13 changes: 12 additions & 1 deletion src/tests/functionspace/GatherScatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ class GatherScatter
atlas::idx_t prc = std::numeric_limits<atlas::idx_t>::min ();
};

class offlen_t
{
public:
atlas::gidx_t off = 0, len = 0;
};

using offlen_v = std::vector<offlen_t>;
using ioFieldDesc_v = std::vector<ioFieldDesc>;

atlas::idx_t max, nprc;

std::vector<atlas::gidx_t> _prcloc2glo;
Expand All @@ -26,6 +35,9 @@ class GatherScatter
public:
GatherScatter (const atlas::StructuredGrid & _grid, const atlas::grid::Distribution & _dist);

void gather (ioFieldDesc_v & floc, ioFieldDesc_v & fglo) const;

private:
atlas::gidx_t prcloc2glo (atlas::idx_t iprc, atlas::idx_t jloc) const
{
return _prcloc2glo[iprc * max + jloc];
Expand All @@ -36,7 +48,6 @@ class GatherScatter
return _glo2prcloc[jglo];
}

void gather (std::vector<ioFieldDesc> & floc, std::vector<ioFieldDesc> & fglo) const;


};
Expand Down