filename
stringlengths
19
182
omp_pragma_line
stringlengths
24
416
context_chars
int64
100
100
text
stringlengths
152
177k
KarypisLab/K-Truss/src/util.c
#pragma omp parallel for schedule(static)
100
32_t v=0; v < nvtxs; ++v) { xadj[1+v] = graph->xadj[v]; } /* shift adjncy values by 1 */ <LOOP-START>for(ssize_t e=0; e < nedges; ++e) { ++(graph->adjncy[e]); }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(static)<OMP-END>
KarypisLab/K-Truss/src/util.c
#pragma omp parallel for schedule(static) reduction(+:nnz)
100
int64_t count_nnz( int64_t const N, int32_t const * const supports) { int64_t nnz = 0; <LOOP-START>for(int64_t e = 0; e < N; ++e) { if(supports[e] > 0) { ++nnz; } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(static) reduction(+:nnz)<OMP-END>
KarypisLab/K-Truss/src/util.c
#pragma omp parallel for schedule(static) reduction(+:total_support)
100
support( int64_t const N, int32_t const * const supports) { int64_t total_support = 0; <LOOP-START>for(int64_t e = 0; e < N; ++e) { if(supports[e] > 0) { total_support += supports[e]; } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(static) reduction(+:total_support)<OMP-END>
KarypisLab/K-Truss/src/kt_sbucket.c
#pragma omp parallel for schedule(static, 1)
100
st)); ++big_slist; /* +1 to allow slist[-1] to be valid */ /* allocate each thread-bucket */ <LOOP-START>for(int bucket=0; bucket < nbuckets; ++bucket) { support_bucket_t * sbucket = &(sbuckets[bucket]); sbucket->nsupports = nsupports; sbucket->nowned_edges = 0; sbucket->slist = big_slist; sbucket->list_head = gk_malloc(sbucket->nsupports * sizeof(*sbucket->list_head), "list_head"); ssize_t * const shead = sbucket->list_head; for(int32_t s=0; s < sbucket->nsupports; ++s) { shead[s] = -1; } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(static, 1)<OMP-END>
KarypisLab/K-Truss/src/and.c
#pragma omp parallel for schedule(dynamic, DYNAMIC_CHUNK)
100
>ktmax = ktmax; vault->ktedges = gk_malloc(xadj[nvtxs] * sizeof(*vault->ktedges), "ktedges"); <LOOP-START>for(int32_t v=0; v < nvtxs; ++v) { for(ssize_t e = xadj[v]; e < xadj[v+1]; ++e) { /* -1 to revert the shift-by-one ordering */ int32_t const v1 = vault->iperm[v]; int32_t const v2 = vault->iperm[adjncy[e]]; vault->ktedges[e].vi = gk_min(v1, v2); vault->ktedges[e].vj = gk_max(v1, v2); vault->ktedges[e].k = supports[e]; } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(dynamic, DYNAMIC_CHUNK)<OMP-END>
KarypisLab/K-Truss/src/and.c
#pragma omp parallel for schedule(dynamic, DYNAMIC_CHUNK)
100
to 'u' vertices in ugraph. */ int32_t * u_vtxs = gk_malloc(nedges * sizeof(*u_vtxs), "u_vtxs"); <LOOP-START>for(int32_t v=0; v < nvtxs; ++v) { for(ssize_t e = vault->ugraph->xadj[v]; e < vault->ugraph->xadj[v+1]; ++e) { u_vtxs[e] = v; } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(dynamic, DYNAMIC_CHUNK)<OMP-END>
KarypisLab/K-Truss/src/and.c
#pragma omp parallel for schedule(dynamic, DYNAMIC_CHUNK)
100
graph */ int64_t * lgraph_maps = gk_malloc(nedges * sizeof(*lgraph_maps), "lgraph_maps"); <LOOP-START>for(int32_t v=0; v < nvtxs; ++v) { for(ssize_t le = vault->lgraph->xadj[v]; le < vault->lgraph->xadj[v+1]; ++le) { int32_t const u = vault->lgraph->adjncy[le]; /* find corresponding edge in ugraph */ for(ssize_t ue = vault->ugraph->xadj[u]; ue < vault->ugraph->xadj[u+1]; ++ue) { if(vault->ugraph->adjncy[ue] == v) { lgraph_maps[le] = ue; } } } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(dynamic, DYNAMIC_CHUNK)<OMP-END>
KarypisLab/K-Truss/src/and.c
#pragma omp parallel for schedule(static)
100
gk_malloc(nedges * sizeof(*need_update), "need_update_new"); /* reset update messages */ <LOOP-START>for(int64_t e=0; e < nedges; ++e) { need_update[e] = 1; need_update_new[e] = 0; }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(static)<OMP-END>
KarypisLab/K-Truss/src/and.c
#pragma omp parallel for schedule(dynamic, DYNAMIC_CHUNK) \
100
g); bool done = false; /* * Main loop. */ while(!done) { int64_t nchanges = 0; <LOOP-START>reduction(+: nchanges) for(int64_t e=0; e < nedges; ++e) { if(!need_update[e]) { continue; } int const tid = omp_get_thread_num(); int32_t const new_support = p_update_edge(vault->lgraph, vault->ugraph, lgraph_maps, supports, triangle_buf[tid], h_index[tid], h_index_buf[tid], e, u_vtxs[e], need_update_new); if(supports[e] != new_support) { /* benign race condition as long as writes to int32_t are atomic */ supports[e] = new_support; ++nchanges; } /* reset update */ need_update[e] = 0; }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(dynamic, DYNAMIC_CHUNK) \<OMP-END>
KarypisLab/K-Truss/src/and.c
#pragma omp parallel for reduction(max: max_ktruss)
100
mp; } /* end main loop */ gk_stopwctimer(vault->timer_ktpeeling); int32_t max_ktruss = 0; <LOOP-START>for(int64_t e=0; e < nedges; ++e) { /* +2 because of the k-truss definition... */ supports[e] += 2; max_ktruss = gk_max(max_ktruss, supports[e]); }<LOOP-END> <OMP-START>#pragma omp parallel for reduction(max: max_ktruss)<OMP-END>
KarypisLab/K-Truss/src/kt.c
#pragma omp parallel for schedule(static) reduction(+:total_sup)
100
shead[k] = ti; slist[ti].peid = -1; /* add up sups[:] */ int64_t total_sup = 0; <LOOP-START>for(int64_t e = 0; e < nedges; ++e) { if(sups[e] >= 0) { total_sup += sups[e]; } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(static) reduction(+:total_sup)<OMP-END>
KarypisLab/K-Truss/src/kt.c
#pragma omp parallel for schedule(static) reduction(+:total_sup)
100
goto BACK; } gk_stopwctimer(timer_currk); /* add up sups[:] */ total_sup = 0; <LOOP-START>for(int64_t e = 0; e < nedges; ++e) { if(sups[e] >= 0) { total_sup += sups[e]; } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(static) reduction(+:total_sup)<OMP-END>
KarypisLab/K-Truss/src/multistage-peeling.c
#pragma omp parallel for
100
2_t * const restrict supports = dgraph->supports; /* initialize the start of each adj. list */ <LOOP-START>for(int32_t vi=0; vi < nvtxs; ++vi) { dgraph->xaii[vi].start = 0; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
KarypisLab/K-Truss/src/multistage-peeling.c
#pragma omp parallel for schedule(static)
100
s after peeling: %"PRId64"\n", ntriangles); /* adjust for */ if(params->outfile != NULL) { <LOOP-START>for(int64_t e=0; e < nedges; ++e) { dgraph->supports[e] += 2; }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(static)<OMP-END>
kaserashi/Parallelization-of-Smith-Waterman-Algorithm/parallelcode.c
#pragma omp parallel for
100
ray[i][0]=0; } compval = 0; //parallelization of for loop to minimizethe time if done serially <LOOP-START>for(i = 1; i <= lenA; ++i) { #pragma omp parallel for for(j = 1; j <= lenB; ++j) { if(FASTA1[i-1] == FASTA2[j-1]) { compval = (SWArray[i-1][j-1] + Match); } if(compval < ((SWArray[i-1][j]) + Gap)) { compval = ((SWArray[i-1][j]) + Gap); } if(compval<(SWArray[i][j-1]+Gap)) { compval=((SWArray[i][j-1])+Gap); } if(compval < 0) { compval = 0; } if(FASTA1[i-1] != FASTA2[j-1]) { if(compval < (SWArray[i-1][j-1] + MissMatch)) { compval = SWArray[i-1][j-1] + MissMatch; } if(compval < ((SWArray[i-1][j]) + Gap)) { compval = ((SWArray[i-1][j]) + Gap); } if(compval < ((SWArray[i][j-1]) + Gap)) { compval = ((SWArray[i][j-1]) + Gap); } if(compval < 0) { compval = 0; } } SWArray[i][j] = compval; compval = 0; } }<LOOP-END> <OMP-START>#pragma omp parallel for <OMP-END>
kaserashi/Parallelization-of-Smith-Waterman-Algorithm/parallelcode.c
#pragma omp parallel for
100
minimizethe time if done serially #pragma omp parallel for for(i = 1; i <= lenA; ++i) { <LOOP-START>for(j = 1; j <= lenB; ++j) { if(FASTA1[i-1] == FASTA2[j-1]) { compval = (SWArray[i-1][j-1] + Match); } if(compval < ((SWArray[i-1][j]) + Gap)) { compval = ((SWArray[i-1][j]) + Gap); } if(compval<(SWArray[i][j-1]+Gap)) { compval=((SWArray[i][j-1])+Gap); } if(compval < 0) { compval = 0; } if(FASTA1[i-1] != FASTA2[j-1]) { if(compval < (SWArray[i-1][j-1] + MissMatch)) { compval = SWArray[i-1][j-1] + MissMatch; } if(compval < ((SWArray[i-1][j]) + Gap)) { compval = ((SWArray[i-1][j]) + Gap); } if(compval < ((SWArray[i][j-1]) + Gap)) { compval = ((SWArray[i][j-1]) + Gap); } if(compval < 0) { compval = 0; } } SWArray[i][j] = compval; compval = 0; }<LOOP-END> <OMP-START>#pragma omp parallel for <OMP-END>
rohinarora/OpenMP/Dense_MatMul_OpenMP/M-M_blocked_omp.c
#pragma omp parallel for private(i, j, k, kk, jj, sum) shared(a, b, c, en) default(none) collapse(3) schedule(dynamic, 4)
100
is is the only portion of the code you should modify to improve performance. */ //double x = 0; <LOOP-START>{ for (kk = 0; kk < en; kk += B) for (jj = 0; jj < en; jj += B) for (i = 0; i < M; i++) for (j = jj; j < jj + B; j++) { sum = c[i][j]; for (k = kk; k < kk + B; k=k+4) { //sum += a[i][k] * b[k][j]; sum += a[i][k+0] * b[k+0][j]; sum += a[i][k+1] * b[k+1][j]; sum += a[i][k+2] * b[k+2][j]; sum += a[i][k+3] * b[k+3][j]; } c[i][j] = sum; } }<LOOP-END> <OMP-START>#pragma omp parallel for private(i, j, k, kk, jj, sum) shared(a, b, c, en) default(none) collapse(3) schedule(dynamic, 4)<OMP-END>
rohinarora/OpenMP/Dense_MatMul_OpenMP/M-M_omp.c
#pragma omp parallel for private(x, i, j, k)
100
This is the only portion of the code you should modify to improve performance. */ double x = 0; <LOOP-START>{ for (i = 0; i < M; i++) { for (j = 0; j < M; j++) { x = 0; for (k = 0; k < M; k++) { x += a[i][k] * b[k][j]; } c[i][j] = x; } } }<LOOP-END> <OMP-START>#pragma omp parallel for private(x, i, j, k)<OMP-END>
rohinarora/OpenMP/Code/src/3_mandel_fix.c
#pragma omp parallel for default(shared) firstprivate(eps) private(c, i, j)
100
ains the Mandelbrot set, // testing each point to see whether it is inside or outside the set. <LOOP-START>for (i = 0; i < NPOINTS; i++) { for (j = 0; j < NPOINTS; j++) { c.r = -2.0 + 2.5 * (double)(i) / (double)(NPOINTS) + eps; c.i = 1.125 * (double)(j) / (double)(NPOINTS) + eps; testpoint(c); } }<LOOP-END> <OMP-START>#pragma omp parallel for default(shared) firstprivate(eps) private(c, i, j)<OMP-END>
rohinarora/OpenMP/Code/src/2_parallel_pi_v4_2.c
#pragma omp parallel for reduction(+ \
100
step = 1.0 / (double)num_steps; omp_set_num_threads(NUM_THREADS); start_time = omp_get_wtime(); <LOOP-START>: sum) private(x, i) { for (i = 1; i <= num_steps; i++) { x = (i - 0.5) * step; // or (i+0.5)*step; if i starts from 0 sum += 4.0 / (1.0 + x * x); // 4.0 and 1.0 ensure this is double } }<LOOP-END> <OMP-START>#pragma omp parallel for reduction(+ \<OMP-END>
rohinarora/OpenMP/Code/src/3_mandel_bug.c
#pragma omp parallel for default(shared) private(c,eps)
100
ntains the Mandelbrot set, // testing each point to see whether it is inside or outside the set. <LOOP-START>for (i=0; i<NPOINTS; i++) { for (j=0; j<NPOINTS; j++) { c.r = -2.0+2.5*(double)(i)/(double)(NPOINTS)+eps; c.i = 1.125*(double)(j)/(double)(NPOINTS)+eps; testpoint(); } }<LOOP-END> <OMP-START>#pragma omp parallel for default(shared) private(c,eps)<OMP-END>
XiangRongLin/grayscale-conversion/cpu/algorithms/memory_simd_sse.c
#pragma omp parallel for
100
_thread_aligned = ((int)pixel_per_thread_unaligned / floats_per_operation) * floats_per_operation; <LOOP-START>for (int thread = 0; thread < threads; thread++) { int end; if (thread + 1 == threads) { end = ((int)size / floats_per_operation) * floats_per_operation; } else { end = pixel_per_thread_aligned * (thread + 1); } __m128i r7_r6_r5_r4_r3_r2_r1_r0; __m128i g7_g6_g5_g4_g3_g2_g1_g0; __m128i b7_b6_b5_b4_b3_b2_b1_b0; for (int i = pixel_per_thread_aligned * thread; i < end; i += floats_per_operation) { __m128i r5_b4_g4_r4_b3_g3_r3_b2_g2_r2_b1_g1_r1_b0_g0_r0 = _mm_loadu_si128((__m128i *)&img[i * channels]); //Unaligned load of 16 uint8 elements __m128i b7_g7_r7_b6_g6_r6_b5_g5 = _mm_loadu_si128((__m128i *)&img[i * channels + 16]); //Unaligned load of (only) 8 uint8 elements (lower half of XMM register). //Separate RGB, and put together R elements, G elements and B elements (together in same XMM register). //Result is also unpacked from uint8 to uint16 elements. GatherRGBx8(r5_b4_g4_r4_b3_g3_r3_b2_g2_r2_b1_g1_r1_b0_g0_r0, b7_g7_r7_b6_g6_r6_b5_g5, &r7_r6_r5_r4_r3_r2_r1_r0, &g7_g6_g5_g4_g3_g2_g1_g0, &b7_b6_b5_b4_b3_b2_b1_b0); //Calculate 8 Y elements. __m128i y7_y6_y5_y4_y3_y2_y1_y0 = Rgb2Yx8(r7_r6_r5_r4_r3_r2_r1_r0, g7_g6_g5_g4_g3_g2_g1_g0, b7_b6_b5_b4_b3_b2_b1_b0); //Pack uint16 elements to 16 uint8 elements (put result in single XMM register). Only lower 8 uint8 elements are relevant. __m128i j7_j6_j5_j4_j3_j2_j1_j0 = _mm_packus_epi16(y7_y6_y5_y4_y3_y2_y1_y0, y7_y6_y5_y4_y3_y2_y1_y0); //Store 8 elements of Y in row Y0, and 8 elements of Y in row Y1. _mm_storel_epi64((__m128i *)&result[i], j7_j6_j5_j4_j3_j2_j1_j0); } }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
XiangRongLin/grayscale-conversion/cpu/algorithms/openmp_baseline.c
#pragma omp parallel for collapse(2)
100
line(unsigned char *img, int width, int height, int channels, int threads, unsigned char *result) { <LOOP-START>for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { result[y * width + x] = 0.2126 * img[(y * width + x) * channels] // red + 0.7152 * img[(y * width + x) * channels + 1] // green + 0.0722 * img[(y * width + x) * channels + 2]; // blue } }<LOOP-END> <OMP-START>#pragma omp parallel for collapse(2)<OMP-END>
XiangRongLin/grayscale-conversion/cpu/algorithms/memory.c
#pragma omp parallel for
100
nnels, int threads, unsigned char *result) { int pixel_per_thread = (width * height) / threads; <LOOP-START>for (int thread = 0; thread < threads; thread++) { int end; if (thread + 1 == threads) { end = width * height; } else { end = pixel_per_thread * (thread + 1); } for (int i = pixel_per_thread * thread; i < end; i++) { result[i] = 0.2126 * img[(i * channels)] // red + 0.7152 * img[(i * channels) + 1] // green + 0.0722 * img[(i * channels) + 2]; // blue } }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
XiangRongLin/grayscale-conversion/cpu/algorithms/memory_simd_fma.c
#pragma omp parallel for
100
0.7152, 0.7152, 0.7152, 0.7152); __m128 b_factor = _mm_set_ps(0.0722, 0.0722, 0.0722, 0.0722); <LOOP-START>for (int thread = 0; thread < threads; thread++) { int end; if (thread + 1 == threads) { end = ((int)size / floats_per_operation) * floats_per_operation; } else { end = pixel_per_thread_aligned * (thread + 1); } __m128 r_vector, g_vector, b_vector, gray_vector; __m128i gray_vector_int; for (int i = pixel_per_thread_aligned * thread; i < end; i += floats_per_operation) { r_vector = _mm_set_ps(img[(i * channels)], img[(i + 1) * channels], img[(i + 2) * channels], img[(i + 3) * channels]); g_vector = _mm_set_ps(img[(i * channels) + 1], img[(i + 1) * channels + 1], img[(i + 2) * channels + 1], img[(i + 3) * channels + 1]); b_vector = _mm_set_ps(img[(i * channels) + 2], img[(i + 1) * channels + 2], img[(i + 2) * channels + 2], img[(i + 3) * channels + 2]); // calculate gray value with FMA gray_vector = _mm_setzero_ps(); gray_vector = _mm_fmadd_ps(r_vector, r_factor, gray_vector); gray_vector = _mm_fmadd_ps(g_vector, g_factor, gray_vector); gray_vector = _mm_fmadd_ps(b_vector, b_factor, gray_vector); // convert float to int and store it // https://stackoverflow.com/q/29856006 gray_vector_int = _mm_cvtps_epi32(gray_vector); gray_vector_int = _mm_packus_epi32(gray_vector_int, gray_vector_int); gray_vector_int = _mm_packus_epi16(gray_vector_int, gray_vector_int); *(int *)(&result[i]) = _mm_cvtsi128_si32(gray_vector_int); } }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
XiangRongLin/grayscale-conversion/cpu/algorithms/memory_simd_avx.c
#pragma omp parallel for
100
er_thread_aligned = ((int)pixel_per_thread_unaligned / pixel_per_iteration) * pixel_per_iteration; <LOOP-START>for (int thread = 0; thread < threads; thread++) { int end; if (thread + 1 == threads) { end = ((int)size / pixel_per_iteration) * pixel_per_iteration; } else { end = pixel_per_thread_aligned * (thread + 1); } __m256i rF_rE_rD_rC_rB_rA_r9_r8_r7_r6_r5_r4_r3_r2_r1_r0; __m256i gF_gE_gD_gC_gB_gA_g9_g8_g7_g6_g5_g4_g3_g2_g1_g0; __m256i bF_bE_bD_bC_bB_bA_b9_b8_b7_b6_b5_b4_b3_b2_b1_b0; for (int i = pixel_per_thread_aligned * thread; i < end; i += pixel_per_iteration) { const int pixel_index = i * channels; __m256i gA_rA_b9_g9_r9_b8_g8_r8_b7_g7_r7_b6_g6_r6_b5_g5_r5_b4_g4_r4_b3_g3_r3_b2_g2_r2_b1_g1_r1_b0_g0_r0 = _mm256_load_si256((__m256i *)&img[pixel_index]); // Load the next 32 bytes, of which on the first 16 are used __m256i bF_gF_rF_bE_gE_rE_bD_gD_rD_bC_gC_rC_bB_gB_rB_bA = _mm256_load_si256((__m256i *)&img[pixel_index + 32]); //Separate RGB, and put together R elements, G elements and B elements (together in same XMM register). //Result is also unpacked from uint8 to uint16 elements. GatherRGBx8_avx(gA_rA_b9_g9_r9_b8_g8_r8_b7_g7_r7_b6_g6_r6_b5_g5_r5_b4_g4_r4_b3_g3_r3_b2_g2_r2_b1_g1_r1_b0_g0_r0, bF_gF_rF_bE_gE_rE_bD_gD_rD_bC_gC_rC_bB_gB_rB_bA, &rF_rE_rD_rC_rB_rA_r9_r8_r7_r6_r5_r4_r3_r2_r1_r0, &gF_gE_gD_gC_gB_gA_g9_g8_g7_g6_g5_g4_g3_g2_g1_g0, &bF_bE_bD_bC_bB_bA_b9_b8_b7_b6_b5_b4_b3_b2_b1_b0); //Calculate 16 Y elements. __m256i y7_y6_y5_y4_y3_y2_y1_y0 = Rgb2Yx8_avx(rF_rE_rD_rC_rB_rA_r9_r8_r7_r6_r5_r4_r3_r2_r1_r0, gF_gE_gD_gC_gB_gA_g9_g8_g7_g6_g5_g4_g3_g2_g1_g0, bF_bE_bD_bC_bB_bA_b9_b8_b7_b6_b5_b4_b3_b2_b1_b0); //Calculate another 16 elements, because the store operation _mm256_storeu_si256 can store 32*8=256 bits at once // skip 16*3=48 bytes // Because of this, can't use _mm256_load_si256 where address needs to be 32-byte aligned gA_rA_b9_g9_r9_b8_g8_r8_b7_g7_r7_b6_g6_r6_b5_g5_r5_b4_g4_r4_b3_g3_r3_b2_g2_r2_b1_g1_r1_b0_g0_r0 = _mm256_loadu_si256((__m256i *)&img[pixel_index + 48]); // skip 16*3+32=80 bytes bF_gF_rF_bE_gE_rE_bD_gD_rD_bC_gC_rC_bB_gB_rB_bA = _mm256_loadu_si256((__m256i *)&img[pixel_index + 80]); GatherRGBx8_avx(gA_rA_b9_g9_r9_b8_g8_r8_b7_g7_r7_b6_g6_r6_b5_g5_r5_b4_g4_r4_b3_g3_r3_b2_g2_r2_b1_g1_r1_b0_g0_r0, bF_gF_rF_bE_gE_rE_bD_gD_rD_bC_gC_rC_bB_gB_rB_bA, &rF_rE_rD_rC_rB_rA_r9_r8_r7_r6_r5_r4_r3_r2_r1_r0, &gF_gE_gD_gC_gB_gA_g9_g8_g7_g6_g5_g4_g3_g2_g1_g0, &bF_bE_bD_bC_bB_bA_b9_b8_b7_b6_b5_b4_b3_b2_b1_b0); __m256i yF_yE_yD_yC_yB_yA_y9_y8 = Rgb2Yx8_avx(rF_rE_rD_rC_rB_rA_r9_r8_r7_r6_r5_r4_r3_r2_r1_r0, gF_gE_gD_gC_gB_gA_g9_g8_g7_g6_g5_g4_g3_g2_g1_g0, bF_bE_bD_bC_bB_bA_b9_b8_b7_b6_b5_b4_b3_b2_b1_b0); __m256i yF_yE_yD_yC_y7_y6_y5_y4_yB_yA_y9_y8_y3_y2_y1_y0 = _mm256_packus_epi16(y7_y6_y5_y4_y3_y2_y1_y0, yF_yE_yD_yC_yB_yA_y9_y8); __m256i yF_yE_yD_yC_yB_yA_y9_y8_y7_y6_y5_y4_y3_y2_y1_y0 = _mm256_permute4x64_epi64( yF_yE_yD_yC_y7_y6_y5_y4_yB_yA_y9_y8_y3_y2_y1_y0, _MM_SHUFFLE(3, 1, 2, 0)); _mm256_store_si256((__m256i *)&result[i], yF_yE_yD_yC_yB_yA_y9_y8_y7_y6_y5_y4_y3_y2_y1_y0); } }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
carlotacb/PAR-Laboratoris/LAB 4/session_codes/lab4/multisort-omp-op1-2.c
#pragma omp parallel for
100
ase basicsort(n, data); } } static void initialize(long length, T data[length]) { long i; <LOOP-START>for (i = 0; i < length; i++) { if (i==0) { data[i] = rand(); } else { data[i] = ((data[i-1]+1) * i * 104723L) % N; } }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
carlotacb/PAR-Laboratoris/LAB 4/session_codes/lab4/multisort-omp-op1-2.c
#pragma omp parallel for
100
* i * 104723L) % N; } } } static void clear(long length, T data[length]) { long i; <LOOP-START>for (i = 0; i < length; i++) { data[i] = 0; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
carlotacb/PAR-Laboratoris/LAB 3/codis/for/mandel-omp-for-row.c
#pragma omp parallel for schedule(runtime) private(col)
100
or) #else int ** output) #endif { /* Calculate points and save/display */ <LOOP-START>for (row = 0; row < height; ++row) { for (col = 0; col < width; ++col) { complex z, c; z.real = z.imag = 0; /* Scale display coordinates to actual region */ c.real = real_min + ((double) col * scale_real); c.imag = imag_min + ((double) (height-1-row) * scale_imag); /* height-1-row so y axis displays * with larger values at top */ /* Calculate z0, z1, .... until divergence or maximum iterations */ int k = 0; double lengthsq, temp; do { temp = z.real*z.real - z.imag*z.imag + c.real; z.imag = 2*z.real*z.imag + c.imag; z.real = temp; lengthsq = z.real*z.real + z.imag*z.imag; ++k; } while (lengthsq < (N*N) && k < maxiter); #if _DISPLAY_ /* Scale color and display point */ long color = (long) ((k-1) * scale_color) + min_color; if (setup_return == EXIT_SUCCESS) { XSetForeground (display, gc, color); XDrawPoint (display, win, gc, col, row); } #else output[row][col]=k; } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(runtime) private(col)<OMP-END>
carlotacb/PAR-Laboratoris/LAB 3/codis/for/mandel-omp-for-point.c
#pragma omp parallel for schedule(runtime) firstprivate(row)
100
dif { /* Calculate points and save/display */ for (row = 0; row < height; ++row) { <LOOP-START>for (col = 0; col < width; ++col) { complex z, c; z.real = z.imag = 0; /* Scale display coordinates to actual region */ c.real = real_min + ((double) col * scale_real); c.imag = imag_min + ((double) (height-1-row) * scale_imag); /* height-1-row so y axis displays * with larger values at top */ /* Calculate z0, z1, .... until divergence or maximum iterations */ int k = 0; double lengthsq, temp; do { temp = z.real*z.real - z.imag*z.imag + c.real; z.imag = 2*z.real*z.imag + c.imag; z.real = temp; lengthsq = z.real*z.real + z.imag*z.imag; ++k; } while (lengthsq < (N*N) && k < maxiter); #if _DISPLAY_ /* Scale color and display point */ long color = (long) ((k-1) * scale_color) + min_color; if (setup_return == EXIT_SUCCESS) { XSetForeground (display, gc, color); XDrawPoint (display, win, gc, col, row); } #else output[row][col]=k; }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(runtime) firstprivate(row)<OMP-END>
gurbaaz27/CS433A-Design-Exercises/assignment3/Q2_openmp.cpp
#pragma omp parallel for num_threads (t) private(i, j)
100
= (float)(i)/(n*n); } gettimeofday(&tv0, &tz0); // row version int i, j; <LOOP-START>for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { y[i] += A[i][j] * x[j]; } }<LOOP-END> <OMP-START>#pragma omp parallel for num_threads (t) private(i, j)<OMP-END>
arslansadiq/Parallel-Programming-TUM/Assignment8_Loop_Fusion/student/loop_fusion_par.c
#pragma omp parallel for num_threads(num_threads)
100
gned long **a, unsigned long **b, unsigned long **c, unsigned long **d, int N, int num_threads) { <LOOP-START>for (int i = 1; i < N; i++) { int j = 1; a[i][j] = 2 * b[i][j]; d[i][j] = a[i][j] * c[i][j]; c[i][j - 1] = a[i][j - 1] - 2 * b[i][j + 1]; for (j = 2; j < N - 1; j++) { a[i][j] = 2 * b[i][j]; d[i][j] = a[i][j] * c[i][j]; c[i][j - 1] = 2 * b[i][j - 1] - 2 * b[i][j + 1]; } j = N - 1; a[i][j] = 2 * b[i][j]; d[i][j] = a[i][j] * c[i][j]; c[i][j - 1] = 2 * b[i][j - 1] - a[i][j + 1]; }<LOOP-END> <OMP-START>#pragma omp parallel for num_threads(num_threads)<OMP-END>
arslansadiq/Parallel-Programming-TUM/Assignment4_Openmp_1/student/x_gradient_par.h
#pragma omp parallel for schedule (dynamic,5)
100
typename channel_type<DstView>::type dst_channel_t; omp_set_num_threads(num_threads); <LOOP-START>for (int y=0; y<src.height(); ++y) { typename SrcView::x_iterator src_it = src.row_begin(y); typename DstView::x_iterator dst_it = dst.row_begin(y); for (int x=1; x<src.width()-1; ++x) { static_transform(src_it[x-1], src_it[x+1], dst_it[x], halfdiff_cast_channels<dst_channel_t>()); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule (dynamic,5)<OMP-END>
arslansadiq/Parallel-Programming-TUM/Assignment12_Hybrid/helper.c
#pragma omp parallel for num_threads(num_threads) reduction(+:heat)
100
t_omp(double *h_new, int n, int num_threads) { double heat = 0.0; // total heat in system //<LOOP-START>for (int i = 1; i < n + 1; ++i) { for (int j = 1; j < n + 1; ++j) { heat += h_new[map(i, j, n+2)]; } }<LOOP-END> <OMP-START>#pragma omp parallel for num_threads(num_threads) reduction(+:heat)<OMP-END>
arslansadiq/Parallel-Programming-TUM/Assignment6_OpenMP_First touch/student/laplace_par.h
#pragma omp parallel for schedule(static) proc_bind(spread)
100
<int SIZE> inline void initialize(double a[SIZE + 2][SIZE + 2], double b[SIZE + 2][SIZE + 2]) { <LOOP-START>for (int i = 0; i < SIZE + 2; i++) for (int j = 0; j < SIZE + 2; j++) { a[i][j] = 0.0; b[i][j] = 0.0; }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(static) proc_bind(spread)<OMP-END>
arslansadiq/Parallel-Programming-TUM/Assignment6_OpenMP_First touch/student/laplace_par.h
#pragma omp parallel for schedule(static) proc_bind(spread)
100
double a[SIZE + 2][SIZE + 2], double b[SIZE + 2][SIZE + 2], int n) { if (n % 2 == 0) { <LOOP-START>for (int i = 1; i < SIZE + 1; i++) for (int j = 1; j < SIZE + 1; j++) b[i][j] = (a[i + 1][j] + a[i - 1][j] + a[i][j - 1] + a[i][j + 1]) / 4.0; } else { #pragma omp parallel for schedule(static) proc_bind(spread) for (int i = 1; i < SIZE + 1; i++) for (int j = 1; j < SIZE + 1; j++) a[i][j] = (b[i + 1][j] + b[i - 1][j] + b[i][j - 1] + b[i][j + 1]) / 4.0; }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(static) proc_bind(spread)<OMP-END>
tudasc/MPI-Corrbench/micro-benches/0-level/openmp/threading/missing_init_thread.c
#pragma omp parallel for num_threads(NUM_THREADS)
100
uffer_out[10], buffer_in[10]; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &myRank); <LOOP-START>for (int i = 0; i < 10; i++) { buffer_out[i] = i * 10; }<LOOP-END> <OMP-START>#pragma omp parallel for num_threads(NUM_THREADS)<OMP-END>
felixarpa/PAR-Lab/deliverables/par2312-lab5/code/solver-omp.c
#pragma omp parallel for
100
matrix into another */ void copy_mat (double *u, double *v, unsigned sizex, unsigned sizey) { <LOOP-START>for (int i = 1; i <= sizex - 2; i++) { for (int j = 1; j <= sizey-2; j++) { v[i * sizey + j] = u[i * sizey + j]; } }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
felixarpa/PAR-Lab/deliverables/par2312-lab5/code/solver-omp.c
#pragma omp parallel for private(diff) reduction(+:sum)
100
ed sizex, unsigned sizey) { double diff, sum=0.0; int howmany = omp_get_max_threads(); <LOOP-START>for (int blockid = 0; blockid < howmany; ++blockid) { int i_start = lowerb(blockid, howmany, sizex); int i_end = upperb(blockid, howmany, sizex); for (int i = max(1, i_start); i <= min(sizex - 2, i_end); i++) { for (int j = 1; j <= sizey - 2; j++) { utmp[i * sizey + j]= 0.25 * ( u[i * sizey + (j - 1)] + // left u[i * sizey + (j + 1)] + // right u[(i - 1) * sizey + j] + // top u[(i + 1) * sizey + j]); // bottom diff = utmp[i * sizey + j] - u[i * sizey + j]; sum += diff * diff; } } }<LOOP-END> <OMP-START>#pragma omp parallel for private(diff) reduction(+:sum)<OMP-END>
felixarpa/PAR-Lab/deliverables/par2312-lab5/code/solver-omp.c
#pragma omp parallel for schedule(static) private(diff, unew) reduction(+:sum)
100
for(int i = 0; i < howmany; ++i) { processedBlocks[i] = 0; } int nBlocs = 32; <LOOP-START>for (int i = 0; i < howmany; ++i) { int ii_start = lowerb(i, howmany, sizex); int ii_end = upperb(i, howmany, sizex); for (int j = 0; j < nBlocs; j++){ int jj_start = lowerb(j, nBlocs, sizey); int jj_end = upperb(j, nBlocs, sizey); if(i > 0) { while(processedBlocks[i - 1] <= j) { #pragma omp flush } } for (int ii = max(1, ii_start); ii <= min(sizex - 2, ii_end); ii++) { for(int jj = max(1, jj_start); jj <= min(sizey - 2, jj_end); jj++) { unew = 0.25* (u[ii * sizey + (jj - 1)] + // left u[ii * sizey + (jj + 1)] + // right u[(ii - 1) * sizey + jj] + // top u[(ii + 1) * sizey + jj]); // bottom diff = unew - u[ii * sizey + jj]; sum += diff * diff; u[ii * sizey + jj] = unew; } } ++processedBlocks[i]; #pragma omp flush } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(static) private(diff, unew) reduction(+:sum)<OMP-END>
felixarpa/PAR-Lab/deliverables/par2312-lab4/code/multisort-omp-tree-optional.c
#pragma omp parallel for
100
ase basicsort(n, data); } } static void initialize(long length, T data[length]) { long i; <LOOP-START>for (i = 0; i < length; i++) { if (i==0) { data[i] = rand(); } else { data[i] = ((data[i-1]+1) * i * 104723L) % N; } }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
felixarpa/PAR-Lab/deliverables/par2312-lab4/code/multisort-omp-tree-optional.c
#pragma omp parallel for
100
* i * 104723L) % N; } } } static void clear(long length, T data[length]) { long i; <LOOP-START>for (i = 0; i < length; i++) { data[i] = 0; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
felixarpa/PAR-Lab/deliverables/par2312-lab4/code/multisort-omp-tree.c
#pragma omp parallel for schedule(static, 8)
100
ase basicsort(n, data); } } static void initialize(long length, T data[length]) { long i; <LOOP-START>for (i = 0; i < length; i++) { if (i==0) { data[i] = rand(); } else { data[i] = ((data[i-1]+1) * i * 104723L) % N; } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(static, 8)<OMP-END>
felixarpa/PAR-Lab/deliverables/par2312-lab4/code/multisort-omp-tree.c
#pragma omp parallel for schedule(static, 8)
100
* i * 104723L) % N; } } } static void clear(long length, T data[length]) { long i; <LOOP-START>for (i = 0; i < length; i++) { data[i] = 0; }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(static, 8)<OMP-END>
felixarpa/PAR-Lab/boada/lab5/solver-omp.c
#pragma omp parallel for
100
matrix into another */ void copy_mat (double *u, double *v, unsigned sizex, unsigned sizey) { <LOOP-START>for (int i=1; i<=sizex-2; i++) for (int j=1; j<=sizey-2; j++) v[ i*sizey+j ] = u[ i*sizey+j ]; } /* * Blocked Jacobi solver: one iteration step */ double relax_jacobi (double *u, double *utmp, unsigned sizex, unsigned sizey) { double diff, sum=0.0; int howmany = omp_get_max_threads(); #pragma omp parallel for private(diff) reduction(+:sum) for (int blockid = 0; blockid < howmany; ++blockid) { int i_start = lowerb(blockid, howmany, sizex); int i_end = upperb(blockid, howmany, sizex); for (int i=max(1, i_start); i<= min(sizex-2, i_end); i++) { for (int j=1; j<= sizey-2; j++) { utmp[i*sizey+j]= 0.25 * ( u[i * sizey + (j - 1)]+ // left u[i * sizey + (j + 1)]+ // right u[(i - 1) * sizey + j]+ // top u[(i + 1) * sizey + j]); // bottom diff = utmp[i*sizey+j] - u[i*sizey + j]; sum += diff * diff; } } } return sum; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
felixarpa/PAR-Lab/boada/lab5/solver-omp.c
#pragma omp parallel for private(diff) reduction(+:sum)
100
sizex, unsigned sizey) { double diff, sum=0.0; int howmany = omp_get_max_threads(); <LOOP-START>for (int blockid = 0; blockid < howmany; ++blockid) { int i_start = lowerb(blockid, howmany, sizex); int i_end = upperb(blockid, howmany, sizex); for (int i=max(1, i_start); i<= min(sizex-2, i_end); i++) { for (int j=1; j<= sizey-2; j++) { utmp[i*sizey+j]= 0.25 * ( u[i * sizey + (j - 1)]+ // left u[i * sizey + (j + 1)]+ // right u[(i - 1) * sizey + j]+ // top u[(i + 1) * sizey + j]); // bottom diff = utmp[i*sizey+j] - u[i*sizey + j]; sum += diff * diff; } } }<LOOP-END> <OMP-START>#pragma omp parallel for private(diff) reduction(+:sum)<OMP-END>
felixarpa/PAR-Lab/boada/lab5/solver-omp.c
#pragma omp parallel for schedule(static) private(diff,unew) reduction(+:sum)
100
ny]; for(int i = 0; i < howmany; ++i) processedBlocks[i] = 0; int nBlocs = 8; <LOOP-START>for (int i = 0; i < howmany; ++i) { int ii_start = lowerb(i, howmany, sizex); int ii_end = upperb(i, howmany, sizex); for (int j = 0; j < nBlocs; j++){ int jj_start = lowerb(j,nBlocs,sizey); int jj_end = upperb(j,nBlocs,sizey); if(i > 0){ while(processedBlocks[i-1]<=j){ #pragma omp flush } } for (int ii=max(1, ii_start); ii<= min(sizex-2, ii_end); ii++) { for(int jj= max(1,jj_start); jj<= min(sizey-2, jj_end); jj++){ unew = 0.25* (u[ii * sizey + (jj-1)] + // left u[ii * sizey + (jj+1)] + // right u[(ii-1) * sizey + jj] + // top u[(ii+1) * sizey + jj]); // bottom diff = unew - u[ii * sizey + jj]; sum += diff*diff; u[ii*sizey+jj] = unew; } } ++processedBlocks[i]; #pragma omp flush } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(static) private(diff,unew) reduction(+:sum)<OMP-END>
felixarpa/PAR-Lab/boada/lab2/openmp/worksharing/4.collapse.c
#pragma omp parallel for private(j)
100
to make it correct. */ int main() { int i,j; omp_set_num_threads(8); <LOOP-START>for (i=0; i < N; i++) { for (j=0; j < N; j++) { int id=omp_get_thread_num(); printf("(%d) Iter (%d %d)\n",id,i,j); } }<LOOP-END> <OMP-START>#pragma omp parallel for private(j) <OMP-END>
felixarpa/PAR-Lab/boada/lab2/openmp/worksharing/6.doacross.c
#pragma omp parallel for ordered(1) schedule(dynamic)
100
float a[N], b[N], c[N]; float a1[M][M], b1[M][M], c1[M][M]; omp_set_num_threads(8); <LOOP-START>for (int i=1; i<N; i++) { a[i] = 1.3; printf("Outside from %d executing %d\n", omp_get_thread_num(), i); #pragma omp ordered depend(sink: i-2) { printf("Inside from %d executing %d\n", omp_get_thread_num(), i); b[i] = a[i] * b[i-1]; } #pragma omp ordered depend(source) c[i] = b[i] * 0.1234; }<LOOP-END> <OMP-START>#pragma omp parallel for ordered(1) schedule(dynamic)<OMP-END>
felixarpa/PAR-Lab/boada/lab2/openmp/worksharing/6.doacross.c
#pragma omp parallel for ordered(2) schedule(dynamic)
100
b[i] = a[i] * b[i-1]; } #pragma omp ordered depend(source) c[i] = b[i] * 0.1234; } <LOOP-START>for (int i=1; i<M; i++) { for (int j=1; j<M; j++) { a1[i][j] = 3.45; #pragma omp ordered depend(sink: i-1,j) depend(sink: i,j-1) { printf("Computing iteration %d %d\n", i, j); b1[i][j] = a1[i][j] * (b1[i-1][j] + b1[i][j-1]); // sleep(1); } #pragma omp ordered depend(source) c1[i][j] = b1[i][j] / 2.19; } }<LOOP-END> <OMP-START>#pragma omp parallel for ordered(2) schedule(dynamic)<OMP-END>
felixarpa/PAR-Lab/boada/lab2/openmp/worksharing/1.for.c
#pragma omp parallel for
100
",id,i); } } printf("\nGoing to distribute iterations in second loop ...\n"); <LOOP-START>for (i=0; i < N+3; i++) { int id=omp_get_thread_num(); printf("(%d) gets iteration %d\n",id,i); }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/graphCSR.c
#pragma omp parallel for
100
es_array->inverse_label_array; label_array_el = graphCSR->sorted_edges_array->label_array; <LOOP-START>for (v = 0; v < num_vertices; ++v) { uint32_t u = label_array_el[v]; uint32_t t = label_array_iel[v]; inverse_label_array_el[u] = t; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/graphCSR.c
#pragma omp parallel for
100
uint32_t t = label_array_iel[v]; inverse_label_array_el[u] = t; } #if DIRECTED <LOOP-START>for (v = 0; v < num_vertices; ++v) { uint32_t u = label_array_el[v]; uint32_t t = label_array_iel[v]; inverse_label_array_iel[t] = u; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/graphAdjArrayList.c
#pragma omp parallel for
100
geList *edgeList) { uint32_t i; uint32_t src; #if DIRECTED uint32_t dest; #endif <LOOP-START>for(i = 0; i < edgeList->num_edges; i++) { src = edgeList->edges_array_src[i]; #pragma omp atomic update graphAdjArrayList->vertices[src].out_degree++; #if DIRECTED dest = edgeList->edges_array_dest[i]; #pragma omp atomic update graphAdjArrayList->vertices[dest].in_degree++; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/graphAdjArrayList.c
#pragma omp parallel for
100
djArrayList *graphAdjArrayList, struct EdgeList *edgeList) { uint32_t i; uint32_t src; <LOOP-START>for(i = 0; i < edgeList->num_edges; i++) { src = edgeList->edges_array_src[i]; #pragma omp atomic update graphAdjArrayList->vertices[src].out_degree++; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/graphAdjArrayList.c
#pragma omp parallel for
100
st *graphAdjArrayList, struct EdgeList *inverseEdgeList) { uint32_t i; uint32_t dest; <LOOP-START>for(i = 0; i < inverseEdgeList->num_edges; i++) { dest = inverseEdgeList->edges_array_src[i]; #pragma omp atomic update graphAdjArrayList->vertices[dest].in_degree++; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/graphAdjArrayList.c
#pragma omp parallel for
100
*graphAdjArrayListEdgeAllocate(struct GraphAdjArrayList *graphAdjArrayList) { uint32_t v; <LOOP-START>for(v = 0; v < graphAdjArrayList->num_vertices; v++) { adjArrayListCreateNeighbourList(&(graphAdjArrayList->vertices[v])); #if DIRECTED graphAdjArrayList->vertices[v].in_degree = 0; graphAdjArrayList->vertices[v].out_degree = 0; // will be used as an index to edge array outnode }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/graphAdjArrayList.c
#pragma omp parallel for
100
geAllocateInodes(struct GraphAdjArrayList *graphAdjArrayList) { #if DIRECTED uint32_t v; // <LOOP-START>for(v = 0; v < graphAdjArrayList->num_vertices; v++) { adjArrayListCreateNeighbourListInNodes(&(graphAdjArrayList->vertices[v])); graphAdjArrayList->vertices[v].in_degree = 0; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/graphAdjArrayList.c
#pragma omp parallel for
100
rrayListEdgeAllocateOutNodes(struct GraphAdjArrayList *graphAdjArrayList) { uint32_t v; // <LOOP-START>for(v = 0; v < graphAdjArrayList->num_vertices; v++) { adjArrayListCreateNeighbourListOutNodes(&(graphAdjArrayList->vertices[v])); graphAdjArrayList->vertices[v].out_degree = 0; // will be used as an index to edge array outnode }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/graphAdjArrayList.c
#pragma omp parallel for
100
; #if DIRECTED uint32_t dest; uint32_t in_degree; #endif uint32_t out_degree; // <LOOP-START>for(i = 0; i < edgeList->num_edges; i++) { src = edgeList->edges_array_src[i]; // out_degree = __sync_fetch_and_add(&(graphAdjArrayList->vertices[src].out_degree), 1);y out_degree = graphAdjArrayList->vertices[src].out_degree; graphAdjArrayList->vertices[src].outNodes->edges_array_src[out_degree] = edgeList->edges_array_src[i]; graphAdjArrayList->vertices[src].outNodes->edges_array_dest[out_degree] = edgeList->edges_array_dest[i]; #if WEIGHTED graphAdjArrayList->vertices[src].outNodes->edges_array_weight[out_degree] = edgeList->edges_array_weight[i]; graphAdjArrayList->vertices[src].out_degree++; #if DIRECTED dest = edgeList->edges_array_dest[i]; in_degree = __sync_fetch_and_add(&(graphAdjArrayList->vertices[src].in_degree), 1); graphAdjArrayList->vertices[dest].inNodes->edges_array_src[in_degree] = edgeList->edges_array_src[i]; graphAdjArrayList->vertices[dest].inNodes->edges_array_dest[in_degree] = edgeList->edges_array_dest[i]; #if WEIGHTED graphAdjArrayList->vertices[dest].inNodes->edges_array_weight[in_degree] = edgeList->edges_array_weight[i]; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/vertex.c
#pragma omp parallel for default(none) private(vertex_id) shared(vertices,graph)
100
= i; } } } } #if DIRECTED if(!inverse) { <LOOP-START>for(vertex_id = 0; vertex_id < graph->num_vertices ; vertex_id++) { graph->inverse_vertices->in_degree[vertex_id] = vertices->out_degree[vertex_id]; }<LOOP-END> <OMP-START>#pragma omp parallel for default(none) private(vertex_id) shared(vertices,graph)<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/vertex.c
#pragma omp parallel for default(none) private(vertex_id) shared(vertices,graph)
100
es->in_degree[vertex_id] = vertices->out_degree[vertex_id]; } } else { <LOOP-START>for(vertex_id = 0; vertex_id < graph->num_vertices ; vertex_id++) { graph->vertices->in_degree[vertex_id] = vertices->out_degree[vertex_id]; }<LOOP-END> <OMP-START>#pragma omp parallel for default(none) private(vertex_id) shared(vertices,graph)<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/bitmap.c
#pragma omp parallel for
100
ord - 1) / kBitsPerWord))); // uint32_t *word = bitmap->bitarray; // uint32_t i; // <LOOP-START>// for(i= 0 ; i <((bitmap->size+kBitsPerWord - 1)/kBitsPerWord); i++){ // word[i] = 0; // }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/bitmap.c
#pragma omp parallel for reduction(+:numSetBits) schedule(dynamic,256)
100
nt32_t getNumOfSetBits (struct Bitmap *bitmap) { uint32_t i; uint32_t numSetBits = 0; <LOOP-START>for(i = 0 ; i < (bitmap->size); i++) { if(getBit(bitmap, i)) numSetBits++; }<LOOP-END> <OMP-START>#pragma omp parallel for reduction(+:numSetBits) schedule(dynamic,256)<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/worklist.c
#pragma omp parallel for
100
2 = workList_temp; } void resetWorkList(uint8_t *workList, uint32_t size) { uint32_t i; <LOOP-START>for(i = 0; i < size ; i++) { workList[i] = 0; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/worklist.c
#pragma omp parallel for
100
ist[i] = 0; } } void setWorkList(uint8_t *workList, uint32_t size) { uint32_t i; <LOOP-START>for(i = 0; i < size ; i++) { workList[i] = 1; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/grid.c
#pragma omp parallel for default(none) shared(grid,totalPartitions) private(i)
100
itions = 0; totalPartitions = grid->num_partitions * grid->num_partitions; uint32_t i; <LOOP-START>for (i = 0; i < totalPartitions; ++i) { grid->activePartitions[i] = 0; }<LOOP-END> <OMP-START>#pragma omp parallel for default(none) shared(grid,totalPartitions) private(i)<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/grid.c
#pragma omp parallel for default(none) shared(grid,totalPartitions,row) private(i,Partition_idx)
100
uint32_t i; uint32_t totalPartitions = 0; totalPartitions = grid->num_partitions; // <LOOP-START>for ( i = 0; i < totalPartitions; ++i) { Partition_idx = (row * totalPartitions) + i; if(grid->partitions[Partition_idx].edgeList->num_edges) { if(!getBit(grid->activePartitionsMap, Partition_idx)) { setBitAtomic(grid->activePartitionsMap, Partition_idx); } } }<LOOP-END> <OMP-START>#pragma omp parallel for default(none) shared(grid,totalPartitions,row) private(i,Partition_idx)<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/grid.c
#pragma omp parallel for default(none) shared(grid,totalPartitions,row) private(i,Partition_idx)
100
uint32_t i; uint32_t totalPartitions = 0; totalPartitions = grid->num_partitions; // <LOOP-START>for ( i = 0; i < totalPartitions; ++i) { Partition_idx = (row * totalPartitions) + i; if(grid->partitions[Partition_idx].edgeList->num_edges) { grid->activePartitions[Partition_idx] = 1; } }<LOOP-END> <OMP-START>#pragma omp parallel for default(none) shared(grid,totalPartitions,row) private(i,Partition_idx)<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/grid.c
#pragma omp parallel for default(none) private(i) shared(totalPartitions,grid)
100
id->num_vertices); grid->activePartitionsMap = newBitmap(totalPartitions); uint32_t i; <LOOP-START>for (i = 0; i < totalPartitions; ++i) { grid->partitions[i].num_edges = 0; grid->partitions[i].num_vertices = 0; /* code */ grid->activePartitions[i] = 0; }<LOOP-END> <OMP-START>#pragma omp parallel for default(none) private(i) shared(totalPartitions,grid)<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/grid.c
#pragma omp parallel for default(none) private(i) shared(grid)
100
->partitions[i].num_vertices = 0; /* code */ grid->activePartitions[i] = 0; } <LOOP-START>for (i = 0; i < grid->num_vertices ; ++i) { grid->out_degree[i] = 0; grid->in_degree[i] = 0; }<LOOP-END> <OMP-START>#pragma omp parallel for default(none) private(i) shared(grid)<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/grid.c
#pragma omp parallel for default(none) private(i,src,dest) shared(edgeList,grid)
100
Grid *grid, struct EdgeList *edgeList) { uint32_t i; uint32_t src; uint32_t dest; <LOOP-START>for(i = 0; i < edgeList->num_edges; i++) { src = edgeList->edges_array_src[i]; dest = edgeList->edges_array_dest[i]; #pragma omp atomic update grid->out_degree[src]++; #pragma omp atomic update grid->in_degree[dest]++; }<LOOP-END> <OMP-START>#pragma omp parallel for default(none) private(i,src,dest) shared(edgeList,grid)<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/grid.c
#pragma omp parallel for default(none) private(i) shared(totalPartitions,grid)
100
m_vertices = 0; uint32_t totalPartitions = grid->num_partitions * grid->num_partitions; // <LOOP-START>#pragma omp parallel for default(none) private(i,src,dest,num_vertices) shared(totalPartitions,grid) schedule(dynamic,1024) for ( j = 0; j < totalPartitions; ++j) { num_vertices = 0; // #pragma omp parallel for default(none) private(i,src,dest) shared(j,grid) schedule(dynamic,1024) reduction(max:num_vertices) for(i = 0; i < grid->partitions[j].edgeList->num_edges; i++) { src = grid->partitions[j].edgeList->edges_array_src[i]; dest = grid->partitions[j].edgeList->edges_array_dest[i]; num_vertices = maxTwoIntegers(num_vertices, maxTwoIntegers(src, dest)); } grid->partitions[j].num_vertices = num_vertices; grid->partitions[j].edgeList->num_vertices = num_vertices; }<LOOP-END> <OMP-START>#pragma omp parallel for default(none) private(i) shared(totalPartitions,grid)<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/grid.c
#pragma omp parallel for default(none) private(i,src,dest,num_vertices) shared(totalPartitions,grid) schedule(dynamic,1024)
100
titions; // #pragma omp parallel for default(none) private(i) shared(totalPartitions,grid) <LOOP-START>for ( j = 0; j < totalPartitions; ++j) { num_vertices = 0; // #pragma omp parallel for default(none) private(i,src,dest) shared(j,grid) schedule(dynamic,1024) reduction(max:num_vertices) for(i = 0; i < grid->partitions[j].edgeList->num_edges; i++) { src = grid->partitions[j].edgeList->edges_array_src[i]; dest = grid->partitions[j].edgeList->edges_array_dest[i]; num_vertices = maxTwoIntegers(num_vertices, maxTwoIntegers(src, dest)); } grid->partitions[j].num_vertices = num_vertices; grid->partitions[j].edgeList->num_vertices = num_vertices; }<LOOP-END> <OMP-START>#pragma omp parallel for default(none) private(i,src,dest,num_vertices) shared(totalPartitions,grid) schedule(dynamic,1024)<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/grid.c
#pragma omp parallel for default(none) private(i,src,dest) shared(j,grid) schedule(dynamic,1024) reduction(max:num_vertices)
100
dynamic,1024) for ( j = 0; j < totalPartitions; ++j) { num_vertices = 0; // <LOOP-START>for(i = 0; i < grid->partitions[j].edgeList->num_edges; i++) { src = grid->partitions[j].edgeList->edges_array_src[i]; dest = grid->partitions[j].edgeList->edges_array_dest[i]; num_vertices = maxTwoIntegers(num_vertices, maxTwoIntegers(src, dest)); }<LOOP-END> <OMP-START>#pragma omp parallel for default(none) private(i,src,dest) shared(j,grid) schedule(dynamic,1024) reduction(max:num_vertices)<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/grid.c
#pragma omp parallel for default(none) private(i,row,col,src,dest,Partition_idx) shared(num_vertices, num_partitions,edgeList,grid)
100
titions; uint32_t num_vertices = grid->num_vertices; uint32_t row; uint32_t col; <LOOP-START>for(i = 0; i < edgeList->num_edges; i++) { src = edgeList->edges_array_src[i]; dest = edgeList->edges_array_dest[i]; // __sync_fetch_and_add(&grid->out_degree[src],1); // __sync_fetch_and_add(&grid->in_degree[dest],1); row = getPartitionID(num_vertices, num_partitions, src); col = getPartitionID(num_vertices, num_partitions, dest); Partition_idx = (row * num_partitions) + col; // __sync_fetch_and_add(&grid->partitions[Partition_idx].num_edges,1); #pragma omp atomic update grid->partitions[Partition_idx].num_edges++; }<LOOP-END> <OMP-START>#pragma omp parallel for default(none) private(i,row,col,src,dest,Partition_idx) shared(num_vertices, num_partitions,edgeList,grid)<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/grid.c
#pragma omp parallel for default(none) private(Edge_idx,i,row,col,src,dest,Partition_idx) shared(num_vertices, num_partitions,edgeList,grid)
100
tions; uint32_t num_vertices = grid->num_vertices; uint32_t row; uint32_t col; <LOOP-START>for(i = 0; i < edgeList->num_edges; i++) { src = edgeList->edges_array_src[i]; dest = edgeList->edges_array_dest[i]; row = getPartitionID(num_vertices, num_partitions, src); col = getPartitionID(num_vertices, num_partitions, dest); Partition_idx = (row * num_partitions) + col; Edge_idx = __sync_fetch_and_add(&grid->partitions[Partition_idx].num_edges, 1); grid->partitions[Partition_idx].edgeList->edges_array_src[Edge_idx] = edgeList->edges_array_src[i]; grid->partitions[Partition_idx].edgeList->edges_array_dest[Edge_idx] = edgeList->edges_array_dest[i]; #if WEIGHTED grid->partitions[Partition_idx].edgeList->edges_array_weight[Edge_idx] = edgeList->edges_array_weight[i]; }<LOOP-END> <OMP-START>#pragma omp parallel for default(none) private(Edge_idx,i,row,col,src,dest,Partition_idx) shared(num_vertices, num_partitions,edgeList,grid)<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/grid.c
#pragma omp parallel for default(none) private(i) shared(totalPartitions,grid)
100
{ uint32_t i; uint32_t totalPartitions = grid->num_partitions * grid->num_partitions; <LOOP-START>for ( i = 0; i < totalPartitions; ++i) { grid->partitions[i].edgeList = newEdgeList(grid->partitions[i].num_edges); grid->partitions[i].edgeList->num_vertices = grid->partitions[i].num_vertices; grid->partitions[i].num_edges = 0; }<LOOP-END> <OMP-START>#pragma omp parallel for default(none) private(i) shared(totalPartitions,grid)<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/graphAdjLinkedList.c
#pragma omp parallel for
100
ices = (struct AdjLinkedList *) my_malloc( V * sizeof(struct AdjLinkedList)); uint32_t i; <LOOP-START>for(i = 0; i < V; i++) { graphAdjLinkedList->vertices[i].outNodes = NULL; graphAdjLinkedList->vertices[i].out_degree = 0; #if DIRECTED graphAdjLinkedList->vertices[i].inNodes = NULL; graphAdjLinkedList->vertices[i].in_degree = 0; graphAdjLinkedList->vertices[i].visited = 0; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/graphAdjLinkedList.c
#pragma omp parallel for
100
WEIGHTED graphAdjLinkedList->max_weight = edgeList->max_weight; #endif uint32_t i; <LOOP-START>for(i = 0; i < graphAdjLinkedList->num_vertices; i++) { graphAdjLinkedList->vertices[i].outNodes = NULL; graphAdjLinkedList->vertices[i].out_degree = 0; #if DIRECTED graphAdjLinkedList->vertices[i].inNodes = NULL; graphAdjLinkedList->vertices[i].in_degree = 0; graphAdjLinkedList->vertices[i].visited = 0; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/graphAdjLinkedList.c
#pragma omp parallel for
100
ex_lock = (omp_lock_t *) my_malloc( graphAdjLinkedList->num_vertices * sizeof(omp_lock_t)); <LOOP-START>for (i = 0; i < graphAdjLinkedList->num_vertices; i++) { omp_init_lock(&(vertex_lock[i])); }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/graphAdjLinkedList.c
#pragma omp parallel for
100
raphAdjLinkedList->num_vertices; i++) { omp_init_lock(&(vertex_lock[i])); } // <LOOP-START>for(i = 0; i < edgeList->num_edges; i++) { adjLinkedListAddEdge(graphAdjLinkedList, edgeList, i, vertex_lock); }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/graphAdjLinkedList.c
#pragma omp parallel for
100
i++) { adjLinkedListAddEdge(graphAdjLinkedList, edgeList, i, vertex_lock); } <LOOP-START>for (i = 0; i < graphAdjLinkedList->num_vertices; i++) { omp_destroy_lock(&(vertex_lock[i])); }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/arrayQueue.c
#pragma omp parallel for
100
; } void arrayQueueGenerateBitmap(struct ArrayQueue *q) { uint32_t v; uint32_t i; <LOOP-START>for(i = q->head ; i < q->tail; i++) { v = q->queue[i]; setBitAtomic(q->q_bitmap, v); }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/arrayQueue.c
#pragma omp parallel for default(none) shared(q,b) private(v,i)
100
arrayQueueToBitmap(struct ArrayQueue *q, struct Bitmap *b) { uint32_t v; uint32_t i; <LOOP-START>for(i = q->head ; i < q->tail; i++) { v = q->queue[i]; setBitAtomic(b, v); }<LOOP-END> <OMP-START>#pragma omp parallel for default(none) shared(q,b) private(v,i)<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/arrayQueue.c
#pragma omp parallel for default(none) shared(q,b,labels) private(v,i,inv_u) num_threads(num_threads_max)
100
t v; uint32_t i; uint32_t inv_u; uint32_t num_threads_max = omp_get_max_threads(); <LOOP-START>for(i = q->head ; i < q->tail; i++) { v = q->queue[i]; inv_u = labels[v]; setBitAtomic(b, inv_u); }<LOOP-END> <OMP-START>#pragma omp parallel for default(none) shared(q,b,labels) private(v,i,inv_u) num_threads(num_threads_max)<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/edgeList.c
#pragma omp parallel for
100
t->edges_array_weight = (float *) my_malloc(num_edges * sizeof(float)); #endif uint32_t i; <LOOP-START>for(i = 0; i < num_edges; i++) { newEdgeList->edges_array_dest[i] = 0; newEdgeList->edges_array_src[i] = 0; #if WEIGHTED newEdgeList->edges_array_weight[i] = 0; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/edgeList.c
#pragma omp parallel for
100
->inverse_label_array = (uint32_t *) my_malloc(tempEdgeList->num_vertices * sizeof(uint32_t)); <LOOP-START>for (i = 0; i < edgeList->num_vertices; ++i) { tempEdgeList->mask_array[i] = edgeList->mask_array[i] ; tempEdgeList->label_array[i] = edgeList->label_array[i]; tempEdgeList->inverse_label_array[i] = edgeList->inverse_label_array[i]; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/edgeList.c
#pragma omp parallel for reduction(max:num_vertices)
100
uint32_t i; uint32_t num_vertices = 0; #if WEIGHTED float max_weight = 0; #endif // <LOOP-START>for(i = 0; i < num_edges; i++) { src = buf_pointer[((offset) * i) + 0]; dest = buf_pointer[((offset) * i) + 1]; // printf(" %u %lu -> %lu \n",i,src,dest); #if DIRECTED if(!inverse) { if(symmetric) { edgeList->edges_array_src[i] = src; edgeList->edges_array_dest[i] = dest; edgeList->edges_array_src[i + (num_edges)] = dest; edgeList->edges_array_dest[i + (num_edges)] = src; #if WEIGHTED if(weighted) { edgeList->edges_array_weight[i] = buf_pointer_float[((offset) * i) + 2]; edgeList->edges_array_weight[i + (num_edges)] = edgeList->edges_array_weight[i]; } else { edgeList->edges_array_weight[i] = generateRandFloat(mt19937var); edgeList->edges_array_weight[i + (num_edges)] = edgeList->edges_array_weight[i]; } } else { edgeList->edges_array_src[i] = src; edgeList->edges_array_dest[i] = dest; #if WEIGHTED if(weighted) { edgeList->edges_array_weight[i] = buf_pointer_float[((offset) * i) + 2]; } else { edgeList->edges_array_weight[i] = generateRandFloat(mt19937var); } } // symmetric } // inverse else { if(symmetric) { edgeList->edges_array_src[i] = dest; edgeList->edges_array_dest[i] = src; edgeList->edges_array_src[i + (num_edges)] = src; edgeList->edges_array_dest[i + (num_edges)] = dest; #if WEIGHTED if(weighted) { edgeList->edges_array_weight[i] = buf_pointer_float[((offset) * i) + 2]; edgeList->edges_array_weight[i + (num_edges)] = edgeList->edges_array_weight[i]; } else { edgeList->edges_array_weight[i] = generateRandFloat(mt19937var); edgeList->edges_array_weight[i + (num_edges)] = edgeList->edges_array_weight[i]; } } else { edgeList->edges_array_src[i] = dest; edgeList->edges_array_dest[i] = src; #if WEIGHTED if(weighted) { edgeList->edges_array_weight[i] = buf_pointer_float[((offset) * i) + 2]; } else { edgeList->edges_array_weight[i] = generateRandFloat(mt19937var); } }// symmetric }// inverse #else if(symmetric) { edgeList->edges_array_src[i] = src; edgeList->edges_array_dest[i] = dest; edgeList->edges_array_src[i + (num_edges)] = dest; edgeList->edges_array_dest[i + (num_edges)] = src; #if WEIGHTED if(weighted) { edgeList->edges_array_weight[i] = 1; edgeList->edges_array_weight[i + (num_edges)] = edgeList->edges_array_weight[i]; } else { edgeList->edges_array_weight[i] = buf_pointer_float[((offset) * i) + 2]; edgeList->edges_array_weight[i + (num_edges)] = edgeList->edges_array_weight[i]; } } else { edgeList->edges_array_src[i] = src; edgeList->edges_array_dest[i] = dest; #if WEIGHTED if(weighted) { edgeList->edges_array_weight[i] = buf_pointer_float[((offset) * i) + 2]; } else { edgeList->edges_array_weight[i] = generateRandFloat(mt19937var); } } num_vertices = maxTwoIntegers(num_vertices, maxTwoIntegers(edgeList->edges_array_src[i], edgeList->edges_array_dest[i])); #if WEIGHTED max_weight = maxTwoFloats(max_weight, edgeList->edges_array_weight[i]); }<LOOP-END> <OMP-START>#pragma omp parallel for reduction(max:num_vertices)<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/edgeList.c
#pragma omp parallel for
100
List->inverse_label_array = (uint32_t *) my_malloc(edgeList->num_vertices * sizeof(uint32_t)); <LOOP-START>for (i = 0; i < edgeList->num_vertices; ++i) { edgeList->mask_array[i] = 0; edgeList->label_array[i] = i; edgeList->inverse_label_array[i] = i; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/edgeList.c
#pragma omp parallel for
100
{ edgeList->mask_array = (uint32_t *) my_malloc(num_vertices * sizeof(uint32_t)); <LOOP-START>for ( i = 0; i < num_vertices; ++i) { edgeList->mask_array[i] = edgeListmem->mask_array[i]; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/edgeList.c
#pragma omp parallel for
100
{ edgeList->label_array = (uint32_t *) my_malloc(num_vertices * sizeof(uint32_t)); <LOOP-START>for ( i = 0; i < num_vertices; ++i) { edgeList->label_array[i] = edgeListmem->label_array[i]; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/edgeList.c
#pragma omp parallel for
100
edgeList->inverse_label_array = (uint32_t *) my_malloc(num_vertices * sizeof(uint32_t)); <LOOP-START>for ( i = 0; i < num_vertices; ++i) { edgeList->inverse_label_array[i] = edgeListmem->inverse_label_array[i]; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/edgeList.c
#pragma omp parallel for private(src,dest)
100
edgeList->inverse_label_array[i] = edgeListmem->inverse_label_array[i]; } } <LOOP-START>for(i = 0; i < num_edges; i++) { src = edgeListmem->edges_array_src[i]; dest = edgeListmem->edges_array_dest[i]; #if WEIGHTED float weight = edgeListmem->edges_array_weight[i]; // printf(" %u %lu -> %lu \n",src,dest); #if DIRECTED if(!inverse) { if(symmetric) { edgeList->edges_array_src[i] = src; edgeList->edges_array_dest[i] = dest; #if WEIGHTED edgeList->edges_array_weight[i] = weight; } else { edgeList->edges_array_src[i] = src; edgeList->edges_array_dest[i] = dest; #if WEIGHTED if(weighted) { edgeList->edges_array_weight[i] = weight; } else { edgeList->edges_array_weight[i] = weight; } } // symmetric } // inverse else { if(symmetric) { edgeList->edges_array_src[i] = dest; edgeList->edges_array_dest[i] = src; #if WEIGHTED edgeList->edges_array_weight[i] = weight; } else { edgeList->edges_array_src[i] = dest; edgeList->edges_array_dest[i] = src; #if WEIGHTED edgeList->edges_array_weight[i] = weight; }// symmetric }// inverse #else if(symmetric) { edgeList->edges_array_src[i] = src; edgeList->edges_array_dest[i] = dest; #if WEIGHTED edgeList->edges_array_weight[i] = weight; } else { edgeList->edges_array_src[i] = src; edgeList->edges_array_dest[i] = dest; #if WEIGHTED edgeList->edges_array_weight[i] = weight; } }<LOOP-END> <OMP-START>#pragma omp parallel for private(src,dest)<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/arrayStack.c
#pragma omp parallel for
100
; } void arrayStackGenerateBitmap(struct ArrayStack *q) { uint32_t v; uint32_t i; <LOOP-START>for(i = q->head ; i < q->tail; i++) { v = q->Stack[i]; setBitAtomic(q->q_bitmap, v); }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/structures/arrayStack.c
#pragma omp parallel for default(none) shared(q,b) private(v,i)
100
arrayStackToBitmap(struct ArrayStack *q, struct Bitmap *b) { uint32_t v; uint32_t i; <LOOP-START>for(i = q->head ; i < q->tail; i++) { v = q->Stack[i]; setBitAtomic(b, v); }<LOOP-END> <OMP-START>#pragma omp parallel for default(none) shared(q,b) private(v,i)<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/preprocess/reorder.c
#pragma omp parallel for
100
eof(uint32_t)); labelsTemp = (uint32_t *) my_malloc(num_vertices * sizeof(uint32_t)); <LOOP-START>for(v = 0; v < num_vertices; v++) { pageRanksFP[v] = FloatToFixed32SORT(pageRanks[v]); pageRanksFPTemp[v] = 0; labelsTemp[v] = 0; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/preprocess/reorder.c
#pragma omp parallel for
100
} printf(" -----------------------------------------------------\n"); Start(timer); <LOOP-START>for(v = 0; v < edgeList->num_vertices; v++) { labelsInverse[v] = v; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/preprocess/reorder.c
#pragma omp parallel for
100
} labelsInverse = radixSortEdgesByDegree(degrees, labelsInverse, edgeList->num_vertices); <LOOP-START>for(v = 0; v < edgeList->num_vertices; v++) { labels[labelsInverse[v]] = edgeList->num_vertices - 1 - v; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
atmughrabi/OpenGraph/00_graph_bench/src/preprocess/reorder.c
#pragma omp parallel for
100
\n", Seconds(timer)); printf(" -----------------------------------------------------\n"); <LOOP-START>for (v = 0; v < edgeList->num_vertices; ++v) { edgeList->label_array[v] = labels[edgeList->label_array[v]]; edgeList->inverse_label_array[edgeList->label_array[v]] = v; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>