E
E
Ekaterina Frolova2019-05-11 15:37:29
C++ / C#
Ekaterina Frolova, 2019-05-11 15:37:29

openmp. How to parallelize a loop?

Hello, please help with the parallelization of this loop on OpenMP. Thanks in advance.

for (i = 0; i < N; i++)
        {
            result[i] = 0;
            for ( j=RowIndex[i]; j<RowIndex[i + 1]; j++)
            {
                if (i == col[j])
                    result[i] += val[j] * vector[col[j]];
                else
                {
                    result[i] += val[j] * vector[col[j]];
                    result[col[j]] += val[j] * vector[i];
                }
            }
        }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2019-05-11
@Ekaterina_f

OpenMP GCC ibm.com

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question