cyclops-community / ctf

Cyclops Tensor Framework: parallel arithmetic on multidimensional arrays
Other
199 stars 53 forks source link

Slice of small tensor never completes #84

Closed ryanlevy closed 4 years ago

ryanlevy commented 4 years ago

I believe this was working as of 15425218222271deca8260a0608f7afcf61e2deb but not 343333b7e271c282397e76af1dea876d2a6f95f4 This code either segfaults or hangs depending on process count/node layout

      vector<int> inds = {1,1,1};
      CTF::Tensor<> A(3,inds.data());
      vector<int64_t> awi = {0};
      double val = 7.;
      CTF::Matrix<double> B(1,1);
      if(world.rank == 0)
        B.write(1,awi.data(),&val);
      else
        B.write(0,awi.data(),&val);
      B.print();
      //--------end setup---------
      vector<int> offU(3,0.);
      vector<int> qd(3,1.);

      vector<int> start = {0,0};
      vector<int> end   = {1,1};
      //-----this either seg faults or hangs-----
      A.slice(offU.data(),qd.data(),0.,B,start.data(),end.data(),1.);
      A.print();

(this was using Intel compilers and MKL)

solomonik commented 4 years ago

@ryanlevy thanks for the report, pushed what I believe should be a fix, please let me know if it addresses the problem, did not try this test case.

ryanlevy commented 4 years ago

Looks like this has fixed my problem, thank you for the quick response!