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 error when using dash::copy with 3D arrays #669

Closed
Mietzsch opened this issue Oct 1, 2019 · 6 comments
Closed

DASH error when using dash::copy with 3D arrays #669

Mietzsch opened this issue Oct 1, 2019 · 6 comments

Comments

@Mietzsch
Copy link

Mietzsch commented Oct 1, 2019

When this code is run with 4 or more units, I get the following error: [ 0 ERROR ] [ 3008 ] GlobPtrBase.h :264 | GlobPtr.increment | offset goes beyond the global memory end 1. I want to copy the last plane of the z NArray to a local vector. This is actually successfull as seen by the output, but I still get this error. When I change the dash::copy to std::copy, the issue is resolved, and if I want to copy the second-to-last plane, everything works fine. Even if I change the manual calculation z.begin()+z_size*(i3+1) to z.end() this gives the DASH-error. Note that with a unitcount of 4 and a 6x6x6 NArray, the array is distributed among units 0-2. I am using dash-0.4.0.

#include <iostream>
#include <libdash.h>

#include <vector>
using namespace std;

int main(int argc, char* argv[])
{
   dash::init(&argc, &argv);
   int mm1 = 6;
   int mm2 = 6;
   int mm3 = 6;

   auto distspec2 = dash::DistributionSpec<3>( dash::BLOCKED, dash::NONE , dash::NONE);
   dash::NArray<double, 3> z(mm1,mm2,mm3, distspec2);

   if(0 == dash::myid()) {
     z(4,5,5) = 10;
     z(4,1,3) = 10;
     z(5,5,5) = 10;
     z(5,1,3) = 10;
   }

   dash::barrier();

   if(dash::myid() == 0) {
     std::vector<double> z_local(mm1*mm2);
     int z_size = mm1*mm2;
     int i3 = 5;
     dash::copy(z.begin()+z_size*(i3), z.end(), z_local.data());
     printf("z(%d,1,3)=%f\n", i3, z_local[1*mm1+3]);
     printf("z(%d,5,5)=%f\n", i3, z_local[5*mm1+5]);
   }

   dash::finalize();

   return EXIT_SUCCESS;
}
@Mietzsch
Copy link
Author

Mietzsch commented Oct 1, 2019

Addition: I am using MPI version 3.3a2 and my build.sh can be found under #668.

@devreal
Copy link
Member

devreal commented Oct 1, 2019

Thanks for the report. I tried running your code on the latest development commit and that seems to work for me (only ran locally on my laptop but that should not have an impact on the issue). You said you used dash-0.4.0. Does that mean you're using the development branch, too?

@Mietzsch
Copy link
Author

Mietzsch commented Oct 1, 2019

Yes, I am using the development branch. I will upgrade to the latest commit and then check back.

@devreal
Copy link
Member

devreal commented Oct 1, 2019

We have had some significant work on dash::copy here: #659

@rkowalewski
Copy link

dash::copy was always ad is still a nightmare. We had lots of fixes in the past which probably are still lying around in some PRs and always got rejected. Let's look into it face to face if you are here at university again.

@Mietzsch
Copy link
Author

Mietzsch commented Oct 2, 2019

Well, at least this instance of the nightmare got fixed in last past months, it works with the most recent iteration of the development branch. Sorry for not checking beforehand and thanks to all.

@Mietzsch Mietzsch closed this as completed Oct 2, 2019
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