Skip to content

Commit

Permalink
Merge 'trilinos/Trilinos:develop' (4c45133) into 'tcad-charon/Trilino…
Browse files Browse the repository at this point in the history
…s:develop' (8ce2325).

* trilinos-develop:
  Xpetra: ETI - BlockedMap - 2019-09-09 - BugFix
  Tpetra: allow custom memory space (fix trilinos#5864)
  kokkos-kernels: permanent CUDA SPGEMM fix
  Epetra: remove const from OpenMP shared variables
  Epetra: fix GCC 9 OpenMP errors trilinos#5390
  Xpetra: ETI - BlockedMap - 2019-09-06 - Snapshot 001
  namespace and >> spacing
  Xpetra: ETI - BlockedMap
  fix dynamic profile errors with deprecated code disabled
  • Loading branch information
Jenkins Pipeline committed Sep 10, 2019
2 parents 8ce2325 + 4c45133 commit 98aab1e
Show file tree
Hide file tree
Showing 22 changed files with 3,895 additions and 839 deletions.
6 changes: 3 additions & 3 deletions packages/epetra/src/Epetra_CrsGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1875,7 +1875,7 @@ int Epetra_CrsGraph::MakeIndicesLocal(const Epetra_BlockMap& domainMap, const Ep
//==============================================================================
int Epetra_CrsGraph::OptimizeStorage() {
int NumIndices;
const int numMyBlockRows = NumMyBlockRows();
int numMyBlockRows = NumMyBlockRows();

Epetra_CrsGraphData::IndexData<int>& Data = CrsGraphData_->Data<int>();

Expand Down Expand Up @@ -1938,7 +1938,7 @@ int Epetra_CrsGraph::OptimizeStorage() {

if (!(StaticProfile())) {
#ifdef EPETRA_HAVE_OMP
#pragma omp parallel for default(none) shared(indexOffset,all_indices,indices)
#pragma omp parallel for default(none) shared(indexOffset,all_indices,indices,numMyBlockRows)
#endif
for(int i = 0; i < numMyBlockRows; i++) {
int numColIndices = indexOffset[i+1] - indexOffset[i];
Expand Down Expand Up @@ -1978,7 +1978,7 @@ int Epetra_CrsGraph::OptimizeStorage() {
int * indexOffset = CrsGraphData_->IndexOffset_.Values();

#ifdef EPETRA_HAVE_OMP
#pragma omp parallel for default(none) shared(indexOffset,old_all_indices,new_all_indices)
#pragma omp parallel for default(none) shared(indexOffset,old_all_indices,new_all_indices,numMyBlockRows)
#endif
for(int i = 0; i < numMyBlockRows; i++) {
int numColIndices = indexOffset[i+1] - indexOffset[i];
Expand Down
42 changes: 21 additions & 21 deletions packages/epetra/src/Epetra_CrsMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1316,12 +1316,12 @@ int Epetra_CrsMatrix::OptimizeStorage() {
All_Values_ = new double[numMyNonzeros];
if(All_Values_ == 0) throw ReportError("Error with All_Values_ allocation.", -99);

const int *const IndexOffset = Graph().IndexOffset();
const int numMyRows = NumMyRows_;
const int* IndexOffset = Graph().IndexOffset();
int numMyRows = NumMyRows_;
double ** Values_s = Values_;
double * All_Values_s = All_Values_;
#ifdef EPETRA_HAVE_OMP
#pragma omp parallel for default(none) shared(Values_s,All_Values_s)
#pragma omp parallel for default(none) shared(Values_s,All_Values_s,numMyRows,IndexOffset)
#endif
for (int i=0; i<numMyRows; i++) {
int NumEntries = Graph().NumMyIndices(i);
Expand Down Expand Up @@ -3328,8 +3328,8 @@ if (StorageOptimized() && Graph().StorageOptimized()) {
char matdescra[6] = "G//C/";
mkl_dcsrmv(&transa, &m, &NumCols, &alpha, matdescra, values, Indices, IndexOffset, IndexOffset + 1, x, &beta, y);
#elif defined(EPETRA_HAVE_OMP)
const int numMyRows = NumMyRows_;
#pragma omp parallel for default(none) shared(IndexOffset,values,Indices,y,x)
int numMyRows = NumMyRows_;
#pragma omp parallel for default(none) shared(IndexOffset,values,Indices,y,x,numMyRows)
for (int row=0; row<numMyRows; ++row)
{
const int curOffset = IndexOffset[row];
Expand Down Expand Up @@ -3371,11 +3371,11 @@ if (StorageOptimized() && Graph().StorageOptimized()) {
int* NumEntriesPerRow = Graph().NumIndicesPerRow();
int** Indices = Graph().Indices();
double** srcValues = Values();
const int numMyRows = NumMyRows_;
int numMyRows = NumMyRows_;

// Do actual computation
#ifdef EPETRA_HAVE_OMP
#pragma omp parallel for default(none) shared(NumEntriesPerRow,Indices,srcValues,y,x)
#pragma omp parallel for default(none) shared(NumEntriesPerRow,Indices,srcValues,y,x,numMyRows)
#endif
for(int i = 0; i < numMyRows; i++) {
int NumEntries = NumEntriesPerRow[i];
Expand All @@ -3391,11 +3391,11 @@ if (StorageOptimized() && Graph().StorageOptimized()) {
}
else { // Case where StorageOptimized is incompatible: Use general accessors.

const int numMyRows = NumMyRows_;
int numMyRows = NumMyRows_;

// Do actual computation
#ifdef EPETRA_HAVE_OMP
#pragma omp parallel for default(none) shared(x,y)
#pragma omp parallel for default(none) shared(x,y,numMyRows)
#endif
for(int i = 0; i < numMyRows; i++) {
int NumEntries = NumMyEntries(i);
Expand Down Expand Up @@ -3513,11 +3513,11 @@ void Epetra_CrsMatrix::GeneralMM(double ** X, int LDX, double ** Y, int LDY, int
return;
}

double ** const xp = X;
double ** const yp = Y;
const int numMyRows = NumMyRows_;
double ** xp = X;
double ** yp = Y;
int numMyRows = NumMyRows_;
#ifdef EPETRA_HAVE_OMP
#pragma omp parallel for default(none) shared(IndexOffset,Indices,values,NumVectors)
#pragma omp parallel for default(none) shared(IndexOffset,Indices,values,NumVectors,numMyRows,xp,yp)
#endif
for (int i=0; i < numMyRows; i++) {
int prevOffset = IndexOffset[i];
Expand All @@ -3541,12 +3541,12 @@ void Epetra_CrsMatrix::GeneralMM(double ** X, int LDX, double ** Y, int LDY, int
int* NumEntriesPerRow = Graph().NumIndicesPerRow();
int** Indices = Graph().Indices();
double** srcValues = Values();
double ** const xp = X;
double ** const yp = Y;
const int numMyRows = NumMyRows_;
double ** xp = X;
double ** yp = Y;
int numMyRows = NumMyRows_;

#ifdef EPETRA_HAVE_OMP
#pragma omp parallel for default(none) shared(NumEntriesPerRow,Indices,srcValues,NumVectors)
#pragma omp parallel for default(none) shared(NumEntriesPerRow,Indices,srcValues,NumVectors,numMyRows,xp,yp)
#endif
for (int i=0; i < numMyRows; i++) {
int NumEntries = NumEntriesPerRow[i];
Expand All @@ -3563,11 +3563,11 @@ void Epetra_CrsMatrix::GeneralMM(double ** X, int LDX, double ** Y, int LDY, int
}
else {

double ** const xp = X;
double ** const yp = Y;
const int numMyRows = NumMyRows_;
double ** xp = X;
double ** yp = Y;
int numMyRows = NumMyRows_;
#ifdef EPETRA_HAVE_OMP
#pragma omp parallel for default(none) shared(NumVectors)
#pragma omp parallel for default(none) shared(NumVectors,numMyRows,xp,yp)
#endif
for (int i=0; i < numMyRows; i++) {
int NumEntries = NumMyEntries(i);
Expand Down
30 changes: 15 additions & 15 deletions packages/epetra/src/Epetra_IntMultiVector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,9 @@ int Epetra_IntMultiVector::DoCopy(void)
int * from = Pointers_[i];
int * to = Values_+i*Stride_;
Pointers_[i] = to;
const int myLength = MyLength_;
int myLength = MyLength_;
#ifdef EPETRA_HAVE_OMP
#pragma omp parallel for default(none) shared(to,from)
#pragma omp parallel for default(none) shared(to,from,myLength)
for (int j=0; j<myLength; j++) to[j] = from[j];
#else
memcpy(to, from, myLength*sizeof(int));
Expand Down Expand Up @@ -569,11 +569,11 @@ int Epetra_IntMultiVector::PutScalar(int ScalarConstant) {

// Fills MultiVector with the value ScalarConstant **/

const int myLength = MyLength_;
int myLength = MyLength_;
for (int i = 0; i < NumVectors_; i++) {
int * const to = Pointers_[i];
int * to = Pointers_[i];
#ifdef EPETRA_HAVE_OMP
#pragma omp parallel for default(none) shared(ScalarConstant)
#pragma omp parallel for default(none) shared(ScalarConstant,myLength,to)
#endif
for (int j=0; j<myLength; j++) to[j] = ScalarConstant;
}
Expand Down Expand Up @@ -1099,16 +1099,16 @@ int Epetra_IntMultiVector::MinValue (int* Result) const {

int ierr = 0;

const int myLength = MyLength_;
int myLength = MyLength_;
UpdateOrdinalTemp();

for (int i=0; i < NumVectors_; i++)
{
const int * const from = Pointers_[i];
const int * from = Pointers_[i];
int MinVal = 2000000000; // 2 billion is close to largest 32 bit int
if (myLength>0) MinVal = from[0];
#ifdef EPETRA_HAVE_OMP
#pragma omp parallel default(none) shared(MinVal)
#pragma omp parallel default(none) shared(MinVal,myLength,from)
{
int localMinVal = MinVal;
#pragma omp for
Expand Down Expand Up @@ -1212,16 +1212,16 @@ int Epetra_IntMultiVector::MaxValue (int* Result) const {

int ierr = 0;

const int myLength = MyLength_;
int myLength = MyLength_;
UpdateOrdinalTemp();

for (int i=0; i < NumVectors_; i++)
{
const int * const from = Pointers_[i];
const int * from = Pointers_[i];
int MaxVal = -2000000000; // Negative 2 billion is close to smallest 32 bit int
if (myLength>0) MaxVal = from[0];
#ifdef EPETRA_HAVE_OMP
#pragma omp parallel default(none) shared(MaxVal)
#pragma omp parallel default(none) shared(MaxVal,myLength,from)
{
int localMaxVal = MaxVal;
#pragma omp for
Expand Down Expand Up @@ -1364,7 +1364,7 @@ Epetra_IntMultiVector& Epetra_IntMultiVector::operator = (const Epetra_IntMultiV
//=========================================================================
void Epetra_IntMultiVector::Assign(const Epetra_IntMultiVector& A) {

const int myLength = MyLength_;
int myLength = MyLength_;
if (NumVectors_ != A.NumVectors())
throw ReportError("Number of vectors incompatible in Assign. The this MultiVector has NumVectors = " + toString(NumVectors_)
+ ". The A MultiVector has NumVectors = " + toString(A.NumVectors()), -3);
Expand All @@ -1374,10 +1374,10 @@ void Epetra_IntMultiVector::Assign(const Epetra_IntMultiVector& A) {

int ** A_Pointers = A.Pointers();
for (int i = 0; i< NumVectors_; i++) {
int * const to = Pointers_[i];
const int * const from = A_Pointers[i];
int * to = Pointers_[i];
const int * from = A_Pointers[i];
#ifdef EPETRA_HAVE_OMP
#pragma omp parallel for default(none)
#pragma omp parallel for default(none) shared(myLength,to,from)
#endif
for (int j=0; j<myLength; j++) to[j] = from[j];
}
Expand Down
Loading

0 comments on commit 98aab1e

Please sign in to comment.