Skip to content

Commit

Permalink
Update readme.md
Browse files Browse the repository at this point in the history
Signed-off-by: ҉αkα x⠠⠵ <[email protected]>
  • Loading branch information
4k4xs4pH1r3 authored Feb 23, 2024
1 parent 10a4ccf commit cf667c6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions SuperCluster/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ Steps to create a small cluster using multiple devices:
nano pi_value.py
```
```
from mpi4py import MPI
def pi_leibniz(n):
"""
Approximates pi using the Leibniz series with n terms.
Expand All @@ -79,14 +77,17 @@ def pi_leibniz(n):
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
# Debugging output to see the rank of each process
print(f"Process {rank}: MPI Initialized")
# Calculate pi with 10000 terms
pi_approx = pi_leibniz(10000)
# Print the result to the screen from each process
# Debugging output to see the rank and the result from each process
print(f"Process {rank}: Pi approximation (Leibniz, 10000 terms): {pi_approx:.10f}")
# Finalize MPI
comm.Barrier()
MPI.Finalize()
```

Expand Down

0 comments on commit cf667c6

Please sign in to comment.