[Trilinos-Users] [EXTERNAL] Error with Tpetra's crs matrix insertglobalvalues method

Bradley, Andrew Michael ambradl at sandia.gov
Tue Jun 14 16:06:48 EDT 2016


Hi Ashesh,

I'm not seeing the error in your email, but I believe you intended to copy-paste it.

At a guess, I'm thinking that in the final line,
      A->insertGlobalValues (myGlobalElements[i], indices(), values());
you're nicely reusing the same indices and values arrays, but you're using the version of insertGlobalValues in which these ArrayViews are sized to number of entries you wish to insert. My guess is that insertGlobalValues is erroring on invalid entries beyond countN.

ArrayViews have view semantics, not copy, so you can take views of these to size the input arrays properly. Or you can use the version of insertGlobalValues to which you supply numEnt.

Feel free to email again with the error output if this guess did not help.

Cheers,
Andrew




From: Trilinos-Users <trilinos-users-bounces at trilinos.org> on behalf of Ashesh Chattopadhyay <ashesh6810 at gmail.com>
Sent: Tuesday, June 14, 2016 1:58 PM
To: Trilinos-Users at trilinos.org
Subject: [EXTERNAL] [Trilinos-Users] Error with Tpetra's crs matrix insertglobalvalues method
  




Hi all,
 Can you please help me understand where I am going wrong when I use insertglobalvalues  method in Tpetra's Crs matrix.

Array<scalar_type> values(NumEntries);
Array<size_t> indices(NumEntries);

  size_t countN=0;
      for(size_t j=0;j<4;j++)
      {
        if(N[j]>=0)
       {

        indices[countN]=N[j];
//    const scalar_type two    = static_cast<scalar_type> ( 2.0);
        values[countN]= -static_cast<scalar_type> (K(myGlobalElements[i],N[j]));
         values[countN]=two;

        countN=countN+1;
       }
      }




 A->insertGlobalValues (myGlobalElements[i], indices(), values());

 Here, K is a Kokkos View with type double.
 When I use this, the insertglobalvalues method is giving me an error:







-- 




Research Assistant, Multi-Scale Multi-Physics Computation Lab
 University of Texas at El Paso
 Texas, El Paso, USA

(+1) 915-355-5013
            


More information about the Trilinos-Users mailing list