Oracle Logbook

October 26, 2020

Oracle Cloud after 10 trillions operations with Python

Filed under: Uncategorized — Helio Dias @ 5:05 am

A month ago I decided to test how reliable Oracle were.
Oracle OCI would really give me my virtual CPU without interruptions or degradation?

So I wrote this Python prime search code, to make intensive use of CPU.
The results are a nice surprise, Oracle execute the calculation for 10.540.924.558.061 (Ten Trillions and a half), with a very consistent CPU speed, seems like a local machine.
The program took 37 days and 17 hours. finding 50,847,533 prime numbers and the biggest one 999.999.937
On the very beginning I started coding a optimized version, then I realized that did not matter, the most important was the interactions.

WordPress cut the tabs, I will post the GitHub link with a formatted version

#Prime generator, 2020.09.12
#Helio Dias
#heliogh@heliodias.com
import math
prime_probe=3
vprime=[2]
interacoes=0
while prime_probe<1000000000:
prime_status=’Y’
for x in range(min([len(vprime),int(round(math.sqrt(prime_probe)))])):
interacoes=interacoes+1
if prime_probe%vprime[x]==0 and prime_status==’Y’:
prime_status=’N’;
if prime_status==’Y’:
vprime.append(prime_probe)
print prime_probe
print interacoes
prime_probe=prime_probe+2
print (“final”)

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.