filename
stringlengths
19
182
omp_pragma_line
stringlengths
24
416
context_chars
int64
100
100
text
stringlengths
152
177k
cea-hpc/pcvs-benchmarks/OpenMP/CLOMP/clomp.c
#pragma omp parallel for private (pidx) schedule(dynamic)
100
posit = calc_deposit (); /* Scan through zones and add appropriate deposit to each zone */ <LOOP-START>for (pidx = 0; pidx < CLOMP_numParts; pidx++) update_part (partArray[pidx], deposit); /* ---------------- SUBCYCLE 3 OF 4 ----------------- */ /* Calculate deposit for this subcycle based on last s...
cea-hpc/pcvs-benchmarks/OpenMP/CLOMP/clomp.c
#pragma omp parallel for private (pidx) schedule(dynamic)
100
posit = calc_deposit (); /* Scan through zones and add appropriate deposit to each zone */ <LOOP-START>for (pidx = 0; pidx < CLOMP_numParts; pidx++) update_part (partArray[pidx], deposit); /* ---------------- SUBCYCLE 4 OF 4 ----------------- */ /* Calculate deposit for this subcycle based on last s...
cea-hpc/pcvs-benchmarks/OpenMP/CLOMP/clomp.c
#pragma omp parallel for private (pidx) schedule(dynamic)
100
posit = calc_deposit (); /* Scan through zones and add appropriate deposit to each zone */ <LOOP-START>for (pidx = 0; pidx < CLOMP_numParts; pidx++) update_part (partArray[pidx], deposit); } /* Do one cycle (10 subcycles) using "omp parallel for schedule(dynamic)" */ void dynamic_omp_cycle() { /* Emulat...
cea-hpc/pcvs-benchmarks/OpenMP/CLOMP/clomp.c
#pragma omp parallel for private(partId) schedule(static)
100
may be set to 1 for allocate) * to allow potentially better memory layout for threads */ <LOOP-START>for (partId = 0; partId < CLOMP_numParts; partId++) { Part *part; if ((part= (Part *) malloc (sizeof (Part))) == NULL) { fprintf (stderr, "Out of memory allocating part\n"); exit (1); } /*...
cea-hpc/pcvs-benchmarks/OpenMP/CLOMP/clomp.c
#pragma omp parallel for private(partId) schedule(static)
100
rt just allocated. * Allows parts to be allocated as desired. */ addPart(part, partId); } <LOOP-START>/* Create and add zones to parts. * Do allocations in thread (allocThreads may be set to 1 for allocate) * to allow potentially better memory layout for threads */ for (partId = 0; partId <...
cea-hpc/pcvs-benchmarks/OpenMP/CLOMP/clomp.c
#pragma omp parallel for private (pidx) schedule(static)");
100
print_pseudocode ("Static OMP", "deposit = calc_deposit ();"); print_pseudocode ("Static OMP", "<LOOP-START>print_pseudocode ("Static OMP", "for (pidx = 0; pidx lt numParts; pidx++)"); print_pseudocode ("Static OMP", " update_part (partArray[pidx], deposit);"); print_pseudocode ("Static OMP", "------- End ...
cea-hpc/pcvs-benchmarks/OpenMP/CLOMP/clomp.c
#pragma omp parallel for private (pidx) schedule(dynamic)");
100
int_pseudocode ("Dynamic OMP", "deposit = calc_deposit ();"); print_pseudocode ("Dynamic OMP", "<LOOP-START>print_pseudocode ("Dynamic OMP", "for (pidx = 0; pidx lt numParts; pidx++)"); print_pseudocode ("Dynamic OMP", " update_part (partArray[pidx], deposit);"); print_pseudocode ("Dynamic OMP", "------- E...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_8u.c
#pragma omp parallel for schedule(static) ordered
100
Schedule static\n#################################################\n"); cnt_static = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_static (j, "static"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(static) ordered<OMP-END...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_8u.c
#pragma omp parallel for schedule(static, cs) ordered
100
(%d)\n#################################################\n", cs); cnt_static_chunked = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_static_chunked (j, "static chunked"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(static,...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_8u.c
#pragma omp parallel for schedule(dynamic) ordered
100
chedule dynamic\n#################################################\n"); cnt_dynamic = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_dynamic (j, "dynamic"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(dynamic) ordered<OMP-...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_8u.c
#pragma omp parallel for schedule(dynamic, cs) ordered
100
%d)\n#################################################\n", cs); cnt_dynamic_chunked = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_dynamic_chunked (j, "dynamic chunked"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(dynam...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_8u.c
#pragma omp parallel for schedule(guided) ordered
100
Schedule guided\n#################################################\n"); cnt_guided = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_guided (j, "guided"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(guided) ordered<OMP-END...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_8u.c
#pragma omp parallel for schedule(guided, cs) ordered
100
(%d)\n#################################################\n", cs); cnt_guided_chunked = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_guided_chunked (j, "guided chunked"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(guided,...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_8u.c
#pragma omp parallel for schedule(auto) ordered
100
ered Schedule auto\n#################################################\n"); cnt_auto = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_auto (j, "auto"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(auto) ordered<OMP-END>
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_8u.c
#pragma omp parallel for schedule(runtime) ordered
100
chedule runtime\n#################################################\n"); cnt_runtime = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_runtime (j, "runtime"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(runtime) ordered<OMP-...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_4.c
#pragma omp parallel for schedule(static) ordered
100
Schedule static\n#################################################\n"); cnt_static = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_static (j, "static"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(static) ordered<OMP-END...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_4.c
#pragma omp parallel for schedule(static, cs) ordered
100
(%d)\n#################################################\n", cs); cnt_static_chunked = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_static_chunked (j, "static chunked"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(static,...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_4.c
#pragma omp parallel for schedule(dynamic) ordered
100
chedule dynamic\n#################################################\n"); cnt_dynamic = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_dynamic (j, "dynamic"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(dynamic) ordered<OMP-...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_4.c
#pragma omp parallel for schedule(dynamic, cs) ordered
100
%d)\n#################################################\n", cs); cnt_dynamic_chunked = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_dynamic_chunked (j, "dynamic chunked"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(dynam...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_4.c
#pragma omp parallel for schedule(guided) ordered
100
Schedule guided\n#################################################\n"); cnt_guided = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_guided (j, "guided"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(guided) ordered<OMP-END...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_4.c
#pragma omp parallel for schedule(guided, cs) ordered
100
(%d)\n#################################################\n", cs); cnt_guided_chunked = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_guided_chunked (j, "guided chunked"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(guided,...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_4.c
#pragma omp parallel for schedule(auto) ordered
100
ered Schedule auto\n#################################################\n"); cnt_auto = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_auto (j, "auto"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(auto) ordered<OMP-END>
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_4.c
#pragma omp parallel for schedule(runtime) ordered
100
chedule runtime\n#################################################\n"); cnt_runtime = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_runtime (j, "runtime"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(runtime) ordered<OMP-...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_4u.c
#pragma omp parallel for schedule(static) ordered
100
Schedule static\n#################################################\n"); cnt_static = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_static (j, "static"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(static) ordered<OMP-END...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_4u.c
#pragma omp parallel for schedule(static, cs) ordered
100
(%d)\n#################################################\n", cs); cnt_static_chunked = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_static_chunked (j, "static chunked"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(static,...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_4u.c
#pragma omp parallel for schedule(dynamic) ordered
100
chedule dynamic\n#################################################\n"); cnt_dynamic = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_dynamic (j, "dynamic"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(dynamic) ordered<OMP-...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_4u.c
#pragma omp parallel for schedule(dynamic, cs) ordered
100
%d)\n#################################################\n", cs); cnt_dynamic_chunked = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_dynamic_chunked (j, "dynamic chunked"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(dynam...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_4u.c
#pragma omp parallel for schedule(guided) ordered
100
Schedule guided\n#################################################\n"); cnt_guided = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_guided (j, "guided"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(guided) ordered<OMP-END...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_4u.c
#pragma omp parallel for schedule(guided, cs) ordered
100
(%d)\n#################################################\n", cs); cnt_guided_chunked = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_guided_chunked (j, "guided chunked"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(guided,...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_4u.c
#pragma omp parallel for schedule(auto) ordered
100
ered Schedule auto\n#################################################\n"); cnt_auto = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_auto (j, "auto"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(auto) ordered<OMP-END>
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_4u.c
#pragma omp parallel for schedule(runtime) ordered
100
chedule runtime\n#################################################\n"); cnt_runtime = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_runtime (j, "runtime"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(runtime) ordered<OMP-...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_8.c
#pragma omp parallel for schedule(static) ordered
100
Schedule static\n#################################################\n"); cnt_static = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_static (j, "static"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(static) ordered<OMP-END...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_8.c
#pragma omp parallel for schedule(static, cs) ordered
100
(%d)\n#################################################\n", cs); cnt_static_chunked = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_static_chunked (j, "static chunked"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(static,...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_8.c
#pragma omp parallel for schedule(dynamic) ordered
100
chedule dynamic\n#################################################\n"); cnt_dynamic = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_dynamic (j, "dynamic"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(dynamic) ordered<OMP-...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_8.c
#pragma omp parallel for schedule(dynamic, cs) ordered
100
%d)\n#################################################\n", cs); cnt_dynamic_chunked = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_dynamic_chunked (j, "dynamic chunked"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(dynam...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_8.c
#pragma omp parallel for schedule(guided) ordered
100
Schedule guided\n#################################################\n"); cnt_guided = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_guided (j, "guided"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(guided) ordered<OMP-END...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_8.c
#pragma omp parallel for schedule(guided, cs) ordered
100
(%d)\n#################################################\n", cs); cnt_guided_chunked = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_guided_chunked (j, "guided chunked"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(guided,...
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_8.c
#pragma omp parallel for schedule(auto) ordered
100
ered Schedule auto\n#################################################\n"); cnt_auto = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_auto (j, "auto"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(auto) ordered<OMP-END>
cea-hpc/pcvs-benchmarks/OpenMP/simple/ordered_8.c
#pragma omp parallel for schedule(runtime) ordered
100
chedule runtime\n#################################################\n"); cnt_runtime = init; <LOOP-START>for (j = init; j < size; j++) { #pragma omp ordered { check_runtime (j, "runtime"); } }<LOOP-END> <OMP-START>#pragma omp parallel for schedule(runtime) ordered<OMP-...
cea-hpc/pcvs-benchmarks/OpenMP/NAS/IS/is.c
#pragma omp parallel for
100
; i++) { bucket_size[i] = (INT_TYPE *)alloc_mem(sizeof(INT_TYPE) * NUM_BUCKETS); } <LOOP-START>for( i=0; i<NUM_KEYS; i++ ) key_buff2[i] = 0; #else /*USE_BUCKETS*/ key_buff1_aptr = (INT_TYPE **)alloc_mem(sizeof(INT_TYPE *) * num_procs); key_buff1_aptr[0] = key_buff1; for (i = 1; i...
cea-hpc/pcvs-benchmarks/OpenMP/NAS/IS/is.c
#pragma omp parallel for private(i,j,k,k1) schedule(static,1)
100
ETS /* Buckets are already sorted. Sorting keys within each bucket */ #ifdef SCHED_CYCLIC <LOOP-START>#else #pragma omp parallel for private(i,j,k,k1) schedule(dynamic) for( j=0; j< NUM_BUCKETS; j++ ) { k1 = (j > 0)? bucket_ptrs[j-1] : 0; for ( i = k1; i < bucket_ptrs[j]; i++ ) { ...
cea-hpc/pcvs-benchmarks/OpenMP/NAS/IS/is.c
#pragma omp parallel for private(i,j,k,k1) schedule(dynamic)
100
*/ #ifdef SCHED_CYCLIC #pragma omp parallel for private(i,j,k,k1) schedule(static,1) #else <LOOP-START>for( j=0; j< NUM_BUCKETS; j++ ) { k1 = (j > 0)? bucket_ptrs[j-1] : 0; for ( i = k1; i < bucket_ptrs[j]; i++ ) { k = --key_buff_ptr_global[key_buff2[i]]; key_array[k] =...
cea-hpc/pcvs-benchmarks/OpenMP/NAS/IS/is.c
#pragma omp parallel for reduction(+:j)
100
endif /* Confirm keys correctly sorted: count incorrectly sorted keys, if any */ j = 0; <LOOP-START>for( i=1; i<NUM_KEYS; i++ ) if( key_array[i-1] > key_array[i] ) j++; if( j != 0 ) printf( "Full_verify: number of keys out of sort: %ld\n", (long)j ); else passed_...
cea-hpc/pcvs-benchmarks/Threads/tbb/src/test/test_openmp.cpp
#pragma omp parallel for reduction(+:sum)
100
int start = i<n ? 0 : i-n+1; int finish = i<m ? i+1 : m; T sum = 0; <LOOP-START>for( int j=start; j<finish; ++j ) sum += my_a[j]*my_b[i-j]; my_c[i] = sum; } } }; //! Test TBB loop around OpenMP loop void TBB_OpenMP_Convolve( T c[], const T a[], i...
soumyasen1809/Programming-for-Numerical-Computation/6/Gauss_Elimination/main.c
#pragma omp parallel for shared (A, b, mat_size, A_aug)
100
ouble A_aug[3][4] = {0,0,0,0,0,0,0,0,0,0,0,0}; double x[3]; // Define Augmented matrix <LOOP-START>for (int i = 0; i <mat_size;i++) { for(int j = 0; j <mat_size;j++) { A_aug[i][j] = A[i][j]; } A_aug[i][mat_size] = b[i]; }<LOOP-END> <OMP-START>#pragma omp ...
soumyasen1809/Programming-for-Numerical-Computation/6/Gauss_Elimination/main.c
#pragma omp parallel for shared (A_aug, mat_size)
100
// Developing the augmented matrix for (int col = 0; col < mat_size; col++) { <LOOP-START>for (int row = col+1; row < mat_size; row++) { double alp = A_aug[row][col] / A_aug[col][col]; for (int k = 0; k < mat_size+1; k++) { A_aug[row][k]...
soumyasen1809/Programming-for-Numerical-Computation/6/Gauss_Elimination/main.c
#pragma omp parallel for shared(A_aug, x, mat_size) reduction(+:sum)
100
olution vector for (int row = mat_size-2; row>= 0; row--) { double sum = 0; <LOOP-START>for (int col = row; col < mat_size; col++) { sum = sum + A_aug[row][col]*x[col]; }<LOOP-END> <OMP-START>#pragma omp parallel for shared(A_aug, x, mat_size) reduction(+:sum)<OMP-END...
soumyasen1809/Programming-for-Numerical-Computation/8/TDMA/main.c
#pragma omp parallel for firstprivate(A,b,mat_size) shared (x)
100
b[i] = b[i] - m*b[i-1]; } x[mat_size-1] = b[mat_size-1]/A[mat_size-1][mat_size-1]; <LOOP-START>for (int i = mat_size-2; i >= 0; i--) { x[i] = (b[i] - A[i][i+1]*x[i+1]) / A[i][i]; }<LOOP-END> <OMP-START>#pragma omp parallel for firstprivate(A,b,mat_size) shared (x)<OMP-END>
soumyasen1809/Programming-for-Numerical-Computation/9/Bisection_Method/main.c
#pragma omp parallel for reduction(+:count) lastprivate(c) firstprivate (a,b, n_iters, tol)
100
; double tol = 0.01; // Tolerance limit of the approximate solution to the exact solution <LOOP-START>for (int i = 0; i < n_iters; i++) { if (func_x(a) * func_x(b) < 0) // Condition for a and b to be on the opposite side of the root { c = (a+b)/2.0; // Midpoint if...
soumyasen1809/Programming-for-Numerical-Computation/1/MacLaurin/main.c
#pragma omp parallel for reduction (+:sum)
100
num_threads; // Parallel implementation double start_parallel_time = omp_get_wtime(); <LOOP-START>for (int i = 0; i < n_iters; i++) { num_threads = omp_get_num_threads(); sum = sum + pow(a,i)/factorial(i); }<LOOP-END> <OMP-START>#pragma omp parallel for reduction (+:sum)<OMP-END>
soumyasen1809/Programming-for-Numerical-Computation/4/Differentiation_Single_Variable/main.c
#pragma omp parallel for firstprivate(h) shared(fwd_x, bwd_x, cd_x)
100
erence, Backward difference and Central difference double par_start_time = omp_get_wtime(); <LOOP-START>for (int i = 0; i < num_points; i++) { num_threads = omp_get_num_threads(); double a = i + 2; fwd_x[i] = (func_x(a+h) - func_x(a))/h; bwd_x[i] = (func_x(a) - func_x(a-h))/...
soumyasen1809/Programming-for-Numerical-Computation/7/Gauss_Siedel/main.c
#pragma omp parallel for reduction (+:sum) firstprivate (row, A)
100
for (int row = 0; row < mat_size; row++) { double sum = 0; <LOOP-START>for (int col = 0; col < row-1; col++) { num_threads = omp_get_num_threads(); if (col != row) { sum = sum + A[row][col]*x[col]; ...
soumyasen1809/Programming-for-Numerical-Computation/10/Newton_Raphson_single_variable/main.c
#pragma omp parallel for reduction(+:counter) lastprivate(x_new) firstprivate(x, n_iters, tol)
100
100; // Number of iterations int counter = 0; double tol = 0.001; // Tolerance limit <LOOP-START>for (int i = 0; i < n_iters; i++) { x_new = x - (func_x(x) / diff_x(x)); if (fabs(x_new - x) < tol) { #pragma omp cancel for // Stop iteration when tolerance reached ...
soumyasen1809/Programming-for-Numerical-Computation/2/Taylor_Series/main.c
#pragma omp parallel for reduction(+:sum)
100
hread_count; // Parallel implementation double start_parallel_time = omp_get_wtime(); <LOOP-START>for (int i = 0; i < 3; i++) { thread_count = omp_get_num_threads(); sum = sum + ((pow(h,i))/factorial(i))*exp(a); }<LOOP-END> <OMP-START>#pragma omp parallel for reduction(+:sum)<OMP-E...
soumyasen1809/Programming-for-Numerical-Computation/5/Numerical_Integration/main.c
#pragma omp parallel for reduction(+:integral_mult) firstprivate(num_points, h)
100
double integral_mult = 0; int thread_num; double par_start_time = omp_get_wtime(); <LOOP-START>for (int i = 0; i < num_points-1; i++) { thread_num = omp_get_num_threads(); integral_mult = integral_mult + ( (h/2.0) * (func_x(a + i*h) + func_x(a+(i+1)*h)) ); }<LOOP-END> <OMP-START...
soumyasen1809/Programming-for-Numerical-Computation/13/Linear_Regression/main.c
#pragma omp parallel for reduction(+:x_sum, y_sum) firstprivate(x,y)
100
len_arr = sizeof(x)/sizeof(x[0]); double x_sum = 0; double y_sum = 0; double a, b; <LOOP-START>for (int i = 0; i < len_arr; i++) { x_sum = x_sum + x[i]; y_sum = y_sum + y[i]; }<LOOP-END> <OMP-START>#pragma omp parallel for reduction(+:x_sum, y_sum) firstprivate(x,y)<OMP-END>
soumyasen1809/Programming-for-Numerical-Computation/13/Linear_Regression/main.c
#pragma omp parallel for reduction(+:temp1, temp2) firstprivate(x_avg, y_avg, x, y)
100
= x_sum/len_arr; double y_avg = y_sum/len_arr; double temp1 = 0; double temp2 = 0; <LOOP-START>for (int i = 0; i < len_arr; i++) { temp1 = temp1 + (x[i] - x_avg)*(y[i] - y_avg); temp2 = temp2 + (x[i] - x_avg)*(x[i] - x_avg); }<LOOP-END> <OMP-START>#pragma omp parallel for reduct...
soumyasen1809/OpenMP_C_12_steps_to_Navier_Stokes/2-D NonLinear Convection/2D_NonLinear_Convection/main.c
#pragma omp parallel for
100
oints], u_new[y_points][x_points]; double v[y_points][x_points], v_new[y_points][x_points]; <LOOP-START>for(int i = 0; i < y_points; i++){ for(int j = 0; j < x_points; j++){ u[i][j] = 1.0; v[i][j] = 1.0; u_new[i][j] = 1.0; v_new[i][j] = 1.0; i...
soumyasen1809/OpenMP_C_12_steps_to_Navier_Stokes/2-D Burgers Equation/2-D_Burgers_Equation/main.c
#pragma omp parallel for
100
oints], u_new[y_points][x_points]; double v[y_points][x_points], v_new[y_points][x_points]; <LOOP-START>for(int i = 0; i < y_points; i++){ for(int j = 0; j < x_points; j++){ u[i][j] = 1.0; v[i][j] = 1.0; u_new[i][j] = 1.0; v_new[i][j] = 1.0; i...
soumyasen1809/OpenMP_C_12_steps_to_Navier_Stokes/2-D Channel Flow/2-D_Channel_Flow/main.c
#pragma omp parallel for
100
s]; double u_new[y_points][x_points], v_new[y_points][x_points], p_new[y_points][x_points]; <LOOP-START>for(int i = 0; i < y_points; i++){ for(int j = 0; j < x_points; j++){ u[i][j] = 0.0; v[i][j] = 0.0; p[i][j] = 0.0; u_new[i][j] = 0.0; v_new[...
soumyasen1809/OpenMP_C_12_steps_to_Navier_Stokes/1-D NonLinear Convection/main.c
#pragma omp parallel for firstprivate(del_x)
100
consider double del_x = x_len/(x_points-1); // Length of an element double x[x_points]; <LOOP-START>for (int i = 0; i < x_points; i++){ x[i] = i * del_x; // x co-ordinates }<LOOP-END> <OMP-START>#pragma omp parallel for firstprivate(del_x)<OMP-END>
soumyasen1809/OpenMP_C_12_steps_to_Navier_Stokes/1-D NonLinear Convection/main.c
#pragma omp parallel for shared(x)
100
// Velocity at current time double u_new[x_points]; // Velocity at next time interval <LOOP-START>for (int i = 0; i < x_points; i++){ if (x[i] > 0.5 && x[i] < 1.0){ u[i] = 2.0; u_new[i] = 2.0; } else{ u[i] = 1.0; u_new[i] = 1.0; } }<LOOP-END> <OMP-START>#pragma om...
soumyasen1809/OpenMP_C_12_steps_to_Navier_Stokes/2-D Diffusion/2-D_Diffusion/main.c
#pragma omp parallel for
100
oints], u_new[y_points][x_points]; double v[y_points][x_points], v_new[y_points][x_points]; <LOOP-START>for(int i = 0; i < y_points; i++){ for(int j = 0; j < x_points; j++){ u[i][j] = 1.0; v[i][j] = 1.0; u_new[i][j] = 1.0; v_new[i][j] = 1.0; i...
soumyasen1809/OpenMP_C_12_steps_to_Navier_Stokes/1-D Linear Convection/main.c
#pragma omp parallel for
100
to consider float del_x = x_len/(x_points-1); // Length of an element float x[x_points]; <LOOP-START>for (int i = 0; i < x_points; i++){ x[i] = i * del_x; // x co-ordinates }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
soumyasen1809/OpenMP_C_12_steps_to_Navier_Stokes/2-D Poissons Equation/2-D_Poissons_Equation/main.c
#pragma omp parallel for
100
points], p_new[y_points][x_points]; double b[y_points][x_points]; // source term <LOOP-START>for(int i = 0; i < y_points; i++){ for(int j = 0; j < x_points; j++){ p[i][j] = 0.0; p_new[i][j] = 0.0; } }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
soumyasen1809/OpenMP_C_12_steps_to_Navier_Stokes/2-D Poissons Equation/2-D_Poissons_Equation/main.c
#pragma omp parallel for
100
j] = 0.0; } } // Initialize source term - add spikes at 1/4th and 3/4th length <LOOP-START>for(int i = 0; i < y_points; i++){ for(int j = 0; j < x_points; j++){ b[i][j] = 0.0; if(i == abs(0.25*x_points) && j == abs(0.25*y_points)){ b[i][j] = 100; ...
soumyasen1809/OpenMP_C_12_steps_to_Navier_Stokes/1-D Diffusion/1-D_Diffusion/main.c
#pragma omp parallel for
100
// CFL criteria double x[x_points]; double u[x_points]; double u_new[x_points]; <LOOP-START>for (int i = 0; i < x_points; i++){ x[i] = i * del_x; // Co-ordinates of the grid points if (x[i] > 0.5 && x[i] < 1.0){ // Applying I.C....
soumyasen1809/OpenMP_C_12_steps_to_Navier_Stokes/2-D Laplace Equation/2-D_Laplace_Equation/main.c
#pragma omp parallel for
100
ints]; double l1norm = 1.0; double l1norm_limit = 0.0001; double sum_num, sum_den; <LOOP-START>for(int i = 0; i < y_points; i++){ for(int j = 0; j < x_points; j++){ p[i][j] = 0.0; p_new[i][j] = 0.0; } }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
soumyasen1809/OpenMP_C_12_steps_to_Navier_Stokes/2-D Linear Convection/2-D_Linear_Convection/main.c
#pragma omp parallel for
100
} // } double u[y_points][x_points]; double u_new[y_points][x_points]; <LOOP-START>for(int i = 0; i < y_points; i++){ for(int j = 0; j < x_points; j++){ u[i][j] = 1.0; u_new[i][j] = 1.0; if(x[i] > 0.5 && x[i] < 1.0 && y[i] > 0.5 && y[i] < 1.0){ ...
soumyasen1809/OpenMP_C_12_steps_to_Navier_Stokes/2-D Cavity Flow/2-D_Cavity_Flow/main.c
#pragma omp parallel for
100
s]; double u_new[y_points][x_points], v_new[y_points][x_points], p_new[y_points][x_points]; <LOOP-START>for(int i = 0; i < y_points; i++){ for(int j = 0; j < x_points; j++){ u[i][j] = 0.0; v[i][j] = 0.0; p[i][j] = 0.0; u_new[i][j] = 0.0; v_new[...
soumyasen1809/OpenMP_C_12_steps_to_Navier_Stokes/Dynamic_Memory_Allocation/2-D_NonLinear_Convection/2-D_Nonlinear_Convection_Dynamic/main.c
#pragma omp parallel for
100
oints*x_points*sizeof(double)); v_new = (double *)malloc(y_points*x_points*sizeof(double)); <LOOP-START>for(int i = 0; i < y_points; i++){ for(int j = 0; j < x_points; j++){ *(u+i*x_points+j) = 1.0; *(v+i*x_points+j) = 1.0; *(u_new+i*x_points+j) = 1.0; *(v...
soumyasen1809/OpenMP_C_12_steps_to_Navier_Stokes/Dynamic_Memory_Allocation/1-D_Linear_Convection/1-D_Linear_Convection_Dynamic/main.c
#pragma omp parallel for
100
end_time - ser_start_time); // Parallel execution // Defining the initial conditions <LOOP-START>for(int i = 0; i < x_points; i++){ *(u+i) = 1.0; *(u_new+i) = 1.0; if(*(x+i) > 0.5 && *(x+i) < 1.0){ *(u+i) = 2.0; *(u_new+i) = 2.0; } }<LOOP-END> <...
soumyasen1809/OpenMP_C_12_steps_to_Navier_Stokes/1-D Burgers Equation/1D_Burgers_Equation/main.c
#pragma omp parallel for
100
* pi; int x_points = 1001; double del_x = x_len/(x_points-1); double x[x_points]; <LOOP-START>for (int i = 0; i < x_points; i++){ x[i] = i * del_x; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
soumyasen1809/OpenMP_C_12_steps_to_Navier_Stokes/1-D Burgers Equation/1D_Burgers_Equation/main.c
#pragma omp parallel for
100
double del_t = nu * del_x; double u[x_points], u_new[x_points]; // Initial value of u <LOOP-START>for (int i = 0; i < x_points; i++){ u[i] = - 2.0 * nu * ( - (2.0 * x[i]) * exp( - (x[i] * x[i]) / (4.0 * nu)) / (4.0 * nu) - (2.0 * x[i] - 4.0 * pi) * exp( - (x[i] - 2.0 * pi) * (x[i] - 2.0 *...
soumyasen1809/Introduction_To_OpenMP/6/Fibonacci/main.c
#pragma omp parallel for private(val)
100
val = fibonnaci(n-1) + fibonnaci(n-2); return val; } } int main() { int val; <LOOP-START>for (int i = 0; i <= 10; i++) { val = fibonnaci(i); printf("Fibonacci of %d th term is: %d\n", i, val); }<LOOP-END> <OMP-START>#pragma omp parallel for private(val)<OMP-END>
soumyasen1809/Introduction_To_OpenMP/4/Loop/main.c
#pragma omp parallel for reduction(+:sum)
100
ble len_ele = 1.0/(num_ele-1); double sum = 0.0; double start_time = omp_get_wtick(); <LOOP-START>for (int i = 0; i < num_ele; i++) { double x = i*len_ele; sum = sum + 4.0/(1+(x*x)); }<LOOP-END> <OMP-START>#pragma omp parallel for reduction(+:sum)<OMP-END>
soumyasen1809/Introduction_To_OpenMP/5/Debug_Mandelbrot/main.c
#pragma omp parallel for default(shared) shared(c) firstprivate(eps)
100
ntains the Mandelbrot set, // testing each point to see whether it is inside or outside the set. <LOOP-START>for (int i=0; i<NPOINTS; i++) { for (int 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); } ...
benchmark-subsetting/cere/tests/test_11/lbm.c
#pragma omp parallel for
100
tializeGrid( LBM_Grid grid ) { SWEEP_VAR /*voption indep*/ #if !defined(SPEC_CPU) #ifdef _OPENMP <LOOP-START>SWEEP_START( 0, 0, -2, 0, 0, SIZE_Z+2 ) LOCAL( grid, C ) = DFL1; LOCAL( grid, N ) = DFL2; LOCAL( grid, S ) = DFL2; LOCAL( grid, E ) = DFL2; LOCAL( grid, W ) = DFL2; LOCAL( grid, T ) = DFL2; ...
benchmark-subsetting/cere/tests/test_11/lbm.c
#pragma omp parallel for private( x, y )
100
ForLDC( LBM_Grid grid ) { int x, y, z; /*voption indep*/ #if !defined(SPEC_CPU) #ifdef _OPENMP <LOOP-START>for( z = -2; z < SIZE_Z+2; z++ ) { for( y = 0; y < SIZE_Y; y++ ) { for( x = 0; x < SIZE_X; x++ ) { if( x == 0 || x == SIZE_X-1 || y == 0 || y == SIZE_Y-1 || z == 0 || z == SIZE_Z-1 ) ...
benchmark-subsetting/cere/tests/test_11/lbm.c
#pragma omp parallel for private( x, y )
100
hannel( LBM_Grid grid ) { int x, y, z; /*voption indep*/ #if !defined(SPEC_CPU) #ifdef _OPENMP <LOOP-START>for( z = -2; z < SIZE_Z+2; z++ ) { for( y = 0; y < SIZE_Y; y++ ) { for( x = 0; x < SIZE_X; x++ ) { if( x == 0 || x == SIZE_X-1 || y == 0 || y == SIZE_Y-1 ) { SET_FLAG( grid, x, y, z, OBS...
benchmark-subsetting/cere/tests/test_11/lbm.c
#pragma omp parallel for private( ux, uy, uz, u2, rho )
100
SWEEP_VAR double ux, uy, uz, u2, rho; /*voption indep*/ #if !defined(SPEC_CPU) #ifdef _OPENMP <LOOP-START>SWEEP_START( 0, 0, 0, 0, 0, SIZE_Z ) if( TEST_FLAG_SWEEP( srcGrid, OBSTACLE )) { DST_C ( dstGrid ) = SRC_C ( srcGrid ); DST_S ( dstGrid ) = SRC_N ( srcGrid ); DST_N ( dstGrid ) = SRC_S ( srcGrid );...
benchmark-subsetting/cere/tests/test_11/lbm.c
#pragma omp parallel for private( ux, uy, uz, rho, ux1, uy1, uz1, rho1, \
100
u2, px, py; SWEEP_VAR /* inflow */ /*voption indep*/ #if !defined(SPEC_CPU) #ifdef _OPENMP <LOOP-START>ux2, uy2, uz2, rho2, u2, px, py ) SWEEP_START( 0, 0, 0, 0, 0, 1 ) rho1 = + GRID_ENTRY_SWEEP( srcGrid, 0, 0, 1, C ) + GRID_ENTRY_SWEEP( srcGrid, 0, 0, 1, N ) + GRID_ENTRY_SWEEP( srcGrid, 0, 0, ...
benchmark-subsetting/cere/tests/test_11/lbm.c
#pragma omp parallel for private( ux, uy, uz, rho, ux1, uy1, uz1, rho1, \
100
) + 3.0) - u2); SWEEP_END /* outflow */ /*voption indep*/ #if !defined(SPEC_CPU) #ifdef _OPENMP <LOOP-START>ux2, uy2, uz2, rho2, u2, px, py ) SWEEP_START( 0, 0, SIZE_Z-1, 0, 0, SIZE_Z ) rho1 = + GRID_ENTRY_SWEEP( srcGrid, 0, 0, -1, C ) + GRID_ENTRY_SWEEP( srcGrid, 0, 0, -1, N ) + GRID_ENTRY_SWEEP( ...
benchmark-subsetting/cere/tests/test_Omp_Instrument/test.c
#pragma omp parallel for
100
de <omp.h> #include <stdio.h> void fct1(int k,int l[]) { int i; int p; printf("Start\n"); <LOOP-START>for(i=0;i<4;i++) { printf("LOOPA%d\n",i); p+=i; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
benchmark-subsetting/cere/tests/test_Omp_Instrument/test.c
#pragma omp parallel for
100
("LOOPA%d\n",i); p+=i; } for(i=0;i<4;i++) { printf("LOOPB%d\n",i); p+=i; } <LOOP-START>for(i=0;i<4;i++) { p+=i;printf("LOOPC%d thread__%d\n",i,omp_get_thread_num()); }<LOOP-END> <OMP-START>#pragma omp parallel for <OMP-END>
benchmark-subsetting/cere/tests/test_Omp_Capture_Replay/test.c
#pragma omp parallel for
100
de <omp.h> #include <stdio.h> void fct1(int k,int l[]) { int i; int p; printf("Start\n"); <LOOP-START>for(i=0;i<4;i++) { printf("LOOPA%d\n",i); p+=i; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
benchmark-subsetting/cere/tests/test_Omp_Capture_Replay/test.c
#pragma omp parallel for
100
("LOOPA%d\n",i); p+=i; } for(i=0;i<4;i++) { printf("LOOPB%d\n",i); p+=i; } <LOOP-START>for(i=0;i<4;i++) { p+=i;printf("LOOPC%d thread__%d\n",i,omp_get_thread_num()); }<LOOP-END> <OMP-START>#pragma omp parallel for <OMP-END>
benchmark-subsetting/cere/tests/test_Omp_Blackscholes/blackscholes.m4.cpp
#pragma omp parallel for private(i, price, priceDelta)
100
int end = start + (numOptions / nThreads); for (j=0; j<NUM_RUNS; j++) { #ifdef ENABLE_OPENMP <LOOP-START>for (i=0; i<numOptions; i++) { #else //ENABLE_OPENMP for (i=start; i<end; i++) { //ENABLE_OPENMP /* Calling main function to calculate option value based on * Black & Schol...
amannougrahiya/imop-compiler/src/imop/lib/testcases/allKnown.c
#pragma omp parallel for
100
gma omp section { testThisNonLeaf: #pragma omp critical { x = x + 6; } } } im51: <LOOP-START>for (iter = 0; iter < 8; iter++) { int x1; int y1; x1 += my(8); foo(x1, y1, 1); }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
amannougrahiya/imop-compiler/src/imop/lib/testcases/cfgTests/parallelForConstruct.c
#pragma omp parallel for private(a)
100
int main() { int x = 10; int a; <LOOP-START>for(x = 0; x < 10; x++) { a -= 10; }<LOOP-END> <OMP-START>#pragma omp parallel for private(a)<OMP-END>
amannougrahiya/imop-compiler/src/imop/lib/testcases/cfgTests/allCFG.c
#pragma omp parallel for
100
a omp section { testThisNonLeaf:; #pragma omp critical { x = x + 6; } } } im51:; <LOOP-START>for (iter = 0; iter < 8; iter++) { int x1; int y1; x1 += my(8); foo(x1, y1, 1); }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
amannougrahiya/imop-compiler/src/imop/lib/testcases/simplification/test5.c
#pragma omp parallel for ordered default(shared) private(i)
100
int main () { int i; int j = 10; <LOOP-START>for(i = 0; i < j; i++) { #pragma omp atomic update i = i + 1; }<LOOP-END> <OMP-START>#pragma omp parallel for ordered default(shared) private(i)<OMP-END>
amannougrahiya/imop-compiler/tests/enforcer.c
#pragma omp parallel for
100
ns { #pragma omp section x++; #pragma omp section x+=2; } #pragma omp single #pragma omp task <LOOP-START>for (x = 0; x < 12; x++) x = x + 0; #pragma omp parallel sections { #pragma omp section x++; #pragma omp section x+=2; }<LOOP-END> <OMP-START>#pragma omp parallel for<OMP-END>
amannougrahiya/imop-compiler/tests/final-preproc/sp-b.c
#pragma omp parallel for default(shared) private(i,j,k,r1,r2,r3,r4,r5,t1,t2)
100
} } } static void ninvr(void) { int i, j, k; double r1, r2, r3, r4, r5, t1, t2; <LOOP-START>for (i = 1; i <= grid_points[0]-2; i++) { for (j = 1; j <= grid_points[1]-2; j++) { for (k = 1; k <= grid_points[2]-2; k++) { r1 = rhs[0][i][j][k]; r2 = rhs[1][i][j][k]; r3 = rhs[2][i][j][k]; r4...
amannougrahiya/imop-compiler/tests/final-preproc/sp-b.c
#pragma omp parallel for default(shared) private(i,j,k,r1,r2,r3,r4,r5,t1,t2)
100
} } } static void pinvr(void) { int i, j, k; double r1, r2, r3, r4, r5, t1, t2; <LOOP-START>for (i = 1; i <= grid_points[0]-2; i++) { for (j = 1; j <= grid_points[1]-2; j++) { for (k = 1; k <= grid_points[2]-2; k++) { r1 = rhs[0][i][j][k]; r2 = rhs[1][i][j][k]; r3 = rhs[2][i][j][k]; r4...
amannougrahiya/imop-compiler/tests/imsuite/src/mst.c
#pragma omp parallel for schedule(SCHEDULING_METHOD)
100
* * @g: the graph */ void initialize_graph(graph* g) { DEBUG("initializing the graph\n"); <LOOP-START>for (int i = 0; i < g->N; i++) { node* u = elem_at(&g->vertices, i); payload* u_data = malloc(sizeof(payload)); u->data = u_data; u_data->fragment_id = u->label; u_dat...
amannougrahiya/imop-compiler/tests/imsuite/src/mst.c
#pragma omp parallel for schedule(SCHEDULING_METHOD)
100
ueuelist* msgs, queuelist* tmp_msgs, queuelist* blues) { DEBUG("planting root messages\n"); <LOOP-START>for (int i = 0; i < g->N; i++) { node* u = elem_at(&g->vertices, i); payload* u_data = u->data; u_data->received_first_message = 0; /* Only roots find the blue edge */ ...
amannougrahiya/imop-compiler/tests/imsuite/src/mst.c
#pragma omp parallel for schedule(SCHEDULING_METHOD)
100
while (nodes_yet_to_recv) { DEBUG("propagating the messages across the graph\n"); <LOOP-START>for (int i = 0; i < g->N; i++) { node* u = elem_at(&g->vertices, i); payload* u_data = u->data; if (u_data->received_first_message) continue; ...
amannougrahiya/imop-compiler/tests/imsuite/src/mst.c
#pragma omp parallel for schedule(SCHEDULING_METHOD)
100
} } } DEBUG("moving messages from tmp_msgs to msgs\n"); <LOOP-START>for (int i = 0; i < g->N; i++) { node* u = elem_at(&g->vertices, i); payload* u_data = u->data; while (!is_ql_queue_empty(tmp_msgs, u->label)) { message* m...
amannougrahiya/imop-compiler/tests/imsuite/src/mst.c
#pragma omp parallel for schedule(SCHEDULING_METHOD)
100
_yet_to_recv = 0; DEBUG("checking if there are any more nodes left to process\n"); <LOOP-START>for (int i = 0; i < g->N; i++) { node* u = elem_at(&g->vertices, i); payload* u_data = u->data; if (!u_data->received_first_message) nodes_yet_to_recv = 1;...