Skip to content

dash::copy (local range to global destination) not copying the whole range #346

Description

@fuerlinger
  dash::Array<int> arr(100);

  if( dash::myid()==0 ) {
    int buf[100];
    std::iota(buf, buf+100, 0);
    // copy local buffer to global array
    dash::copy(buf, buf+100, arr.begin());
  }
  arr.barrier();

  if( dash::myid()==0 ) {
    for( auto el: arr ) {
      cout << (int)el << " ";
    }
    cout << endl;
  }

Looks like the copy is performed only for the fist two units and the other transfers go haywire somewhere - CMake builds give an additional segfault, a build with the manual Makefile, strangely, doesn't.

mpirun -n 4 ./main
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
mpirun -n 5 ./main
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

std::copy works as expected (good!) but of course then the transfer is done element-by-element.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions