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

Dash::copy from global to global seems error. #690

Open
zhukevin04 opened this issue Feb 17, 2020 · 2 comments
Open

Dash::copy from global to global seems error. #690

zhukevin04 opened this issue Feb 17, 2020 · 2 comments
Assignees

Comments

@zhukevin04
Copy link

Hi, we are using dash in a student project to implement matrix transpose in distributed memory, we want implement a block data copy from global to global by dash::copy. But there is a complied error.(try on development and bug-656-copy). If this is my code's own error, sorry about that.
Thanks

Error:

1.couldn't deduce template parameter 'ValueType' dash::copy(src_g_begin, src_g_end, des_g_begin); GlobOutputIt copy
2. mismatched types 'ValueType*' and 'dash::GlobIter<float, dash::BlockPattern<2 (dash::MemArrange)1, long int>, dash::GlobStaticMemdash::HostSpace, dash::GlobPtr<float, dash::GlobStaticMemdash::HostSpace >, dash::GlobRef >' dash::copy(src_g_begin, src_g_end, des_g_begin);

This is the function code like example bench.07.local-copy:

    for (index_t i = 0; i < blockDimy; i++) {
      for (index_t j = 0; j < blockDimx; j++) {

          index_t src_block_index = i * blockDimy + j;
          index_t des_block_index = j * blockDimx + i;
          auto source_block = data_temp.block(src_block_index);
          auto dest_block = data_out.block(des_block_index);
          size_t block_size = source_block.size();
          index_t copy_start_index = source_block.offset(0);
          index_t copy_end_index = copy_start_index + block_size;
          auto des_start_index = dest_block.offset(0);
          auto src_g_begin = data_temp.begin() + copy_start_index;
          auto src_g_end   = data_temp.begin() + copy_end_index;
          auto des_g_begin = data_out.begin() + des_start_index;

          dash::copy(src_g_begin, src_g_end, des_g_begin);
      }
    }

and the patterns are:

  dash::TeamSpec<2> ts;
  dash::SizeSpec<2> ss(testcase, testcase);
  dash::DistributionSpec<2> ds(dash::TILE(TILESIZE), dash::TILE(TILESIZE)); // TUNING
  ts.balance_extents();
  dash::Pattern<2> pattern(ss, ds, ts); 

  Array_t data_in(pattern);
  Array_t data_out(pattern);
  Array_t data_temp(pattern);
@rkowalewski
Copy link

Hello. Thank you for reporting this. It seems that we do not (yet) support global to global copies. What you can do as a short-term workaround is to implement the global copy yourself. If both arrays have the same patterns and sizes it is even simpler as you can copy the local portions on all units.

We have to look into implementing global to global.

@fuchsto fuchsto self-assigned this Apr 25, 2020
@fuchsto
Copy link
Member

fuchsto commented Apr 25, 2020

Global-to-global dash::copy is a feature that depends on the stale nviews feature-branch.
It already works as-is for one-dimensional ranges.
I will fork a feature branch named something like rviews or ranges for the one-dimensional part for you (@zhukevin04) to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants