Skip to content

Instantly share code, notes, and snippets.

View dgerosa's full-sized avatar
🚀

Davide Gerosa dgerosa

🚀
View GitHub Profile
@dgerosa
dgerosa / parallel_toy.py
Created June 27, 2021 19:58
Simple parallel jobs in python
import numpy as np
import multiprocessing, pathos.multiprocessing
from tqdm import tqdm
import os
#print(os.getpid())
# I want to execute a function...
def fun(a,b):
#print(os.getpid())
@dgerosa
dgerosa / nsphere.py
Created December 14, 2018 06:32
nsphere
'''
Calculate the volume of the n-dimensional spehere a function of the dimension using a simple hit-or-miss Monte Carlo.
'''
from __future__ import print_function, division
import numpy as np
import scipy.special
import pylab as plt
import time