/home/kcamus/qaas_runs/169-443-9681/intel/AMG/build/AMG/AMG/seq_mv/csr_matvec.c: 445 - 648
--------------------------------------------------------------------------------

445: {
446:    HYPRE_Complex    *A_data    = hypre_CSRMatrixData(A);
447:    HYPRE_Int        *A_i       = hypre_CSRMatrixI(A);
448:    HYPRE_Int        *A_j       = hypre_CSRMatrixJ(A);
449:    HYPRE_Int         num_rows  = hypre_CSRMatrixNumRows(A);
450:    HYPRE_Int         num_cols  = hypre_CSRMatrixNumCols(A);
451: 
452:    HYPRE_Complex    *x_data = hypre_VectorData(x);
453:    HYPRE_Complex    *y_data = hypre_VectorData(y);
454:    HYPRE_Int         x_size = hypre_VectorSize(x);
455:    HYPRE_Int         y_size = hypre_VectorSize(y);
456:    HYPRE_Int         num_vectors = hypre_VectorNumVectors(x);
457:    HYPRE_Int         idxstride_y = hypre_VectorIndexStride(y);
458:    HYPRE_Int         vecstride_y = hypre_VectorVectorStride(y);
459:    HYPRE_Int         idxstride_x = hypre_VectorIndexStride(x);
460:    HYPRE_Int         vecstride_x = hypre_VectorVectorStride(x);
[...]
485:    hypre_assert( num_vectors == hypre_VectorNumVectors(y) );
486:  
487:    if (num_rows != x_size)
488:       ierr = 1;
489: 
490:    if (num_cols != y_size)
491:       ierr = 2;
492: 
493:    if (num_rows != x_size && num_cols != y_size)
[...]
499:    if (alpha == 0.0)
500:    {
501: #ifdef HYPRE_USING_OPENMP
502: #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE
503: #endif
504:       for (i = 0; i < num_cols*num_vectors; i++)
[...]
510:    if (x == y)
511:    {
512:       x_tmp = hypre_SeqVectorCloneDeep(x);
513:       x_data = hypre_VectorData(x_tmp);
[...]
520:    temp = beta / alpha;
521:    
522:    if (temp != 1.0)
523:    {
524:       if (temp == 0.0)
525:       {
526: #ifdef HYPRE_USING_OPENMP
527: #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE
528: #endif
529:          for (i = 0; i < num_cols*num_vectors; i++)
[...]
535: #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE
536: #endif
537:          for (i = 0; i < num_cols*num_vectors; i++)
[...]
545:    num_threads = hypre_NumThreads();
546:    if (num_threads > 1)
547:    {
548:       y_data_expand = hypre_CTAlloc(HYPRE_Complex, num_threads*y_size);
549: 
550:       if ( num_vectors==1 )
551:       {
552: 
553: #ifdef HYPRE_USING_OPENMP
554: #pragma omp parallel private(i,jj,j,my_thread_num,offset)
[...]
589:          for (i = 0; i < num_rows; i++)
590:          {
591:             for ( jv=0; jv<num_vectors; ++jv )
592:             {
593:                for (jj = A_i[i]; jj < A_i[i+1]; jj++)
594:                {
595:                   j = A_j[jj];
596:                   y_data[ j*idxstride_y + jv*vecstride_y ] +=
597:                      A_data[jj] * x_data[ i*idxstride_x + jv*vecstride_x];
[...]
603:       hypre_TFree(y_data_expand);
604: 
605:    }
606:    else 
607:    {
608:       for (i = 0; i < num_rows; i++)
609:       {
610:          if ( num_vectors==1 )
611:          {
612:             for (jj = A_i[i]; jj < A_i[i+1]; jj++)
613:             {
614:                j = A_j[jj];
615:                y_data[j] += A_data[jj] * x_data[i];
616:             }
617:          }
618:          else
619:          {
620:             for ( jv=0; jv<num_vectors; ++jv )
621:             {
622:                for (jj = A_i[i]; jj < A_i[i+1]; jj++)
623:                {
624:                   j = A_j[jj];
625:                   y_data[ j*idxstride_y + jv*vecstride_y ] +=
626:                      A_data[jj] * x_data[ i*idxstride_x + jv*vecstride_x ];
[...]
636:    if (alpha != 1.0)
637:    {
638: #ifdef HYPRE_USING_OPENMP
639: #pragma omp parallel for private(i) HYPRE_SMP_SCHEDULE
640: #endif
641:       for (i = 0; i < num_cols*num_vectors; i++)
642:          y_data[i] *= alpha;
643:    }
644: 
645:    if (x == y) hypre_SeqVectorDestroy(x_tmp);
646: 
647:    return ierr;
648: }
