Skip to content
Snippets Groups Projects
Commit f1064260 authored by Xin Li's avatar Xin Li
Browse files

added error checking in fortran

parent 0049bb86
Branches
Tags
No related merge requests found
......@@ -48,7 +48,8 @@ do num_threads = 1, MAX_THREADS
pi = step * raw_sum
run_time = OMP_GET_WTIME() - start_time
print '(" pi is ", f12.6, " in ", f12.6, " seconds and ", i0, " threads")', pi, run_time, num_threads
print '(" pi is ", f12.6, " in ", f12.6, " seconds and ", i0, " threads. Error = ", e15.6)', &
pi, run_time, num_threads, abs(3.14159265358979323846D0 - pi)
enddo
......
......@@ -58,7 +58,8 @@ do num_threads = 1, MAX_THREADS
pi = step * full_sum
run_time = OMP_GET_WTIME() - start_time
print '(" pi is ", f12.6, " in ", f12.6, " seconds and ", i0, " threads")', pi, run_time, num_threads
print '(" pi is ", f12.6, " in ", f12.6, " seconds and ", i0, " threads. Error = ", e15.6)', &
pi, run_time, num_threads, abs(3.14159265358979323846D0 - pi)
enddo
......
......@@ -59,7 +59,8 @@ do num_threads = 1, MAX_THREADS
pi = step * full_sum
run_time = OMP_GET_WTIME() - start_time
print '(" pi is ", f12.6, " in ", f12.6, " seconds and ", i0, " threads")', pi, run_time, num_threads
print '(" pi is ", f12.6, " in ", f12.6, " seconds and ", i0, " threads. Error = ", e15.6)', &
pi, run_time, num_threads, abs(3.14159265358979323846D0 - pi)
enddo
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment