Skip to content

Instantly share code, notes, and snippets.


Thomas Moreau tomMoral

View GitHub Profile
tomMoral /
Created Jan 19, 2021
Simulate Marcenko-Pastur Law
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rc
# activate latex text rendering
rc('text', usetex=True)
if __name__ == "__main__":
View child_barriers.cpp
#include <mpi.h>
#include <iostream>
using namespace MPI;
using namespace std;
int main(int argc, char**argv) {
//Initiate the MPI API
tomMoral /
Last active Oct 5, 2017
Deadlocks with concurrent.futuress.ProcessPoolExecutor and unpicklable objects
This example highlights the fact that the ProcessPoolExecutor implementation
from concurrent.futures is not robust to unpickling error for the result
(at least in versions 3.6 and lower).
from pickle import UnpicklingError
from concurrent.futures import ProcessPoolExecutor
def return_instance(cls):
View output.txt
$ python -c "if 1:
import numpy as np
from sklearn.manifold.t_sne import TSNE, trustworthiness
from sklearn.utils import check_random_state
random_state = check_random_state(0)
X = random_state.randn(50, 2).astype(np.float32)
n_iter = 250
tsne = TSNE(n_components=2, init='pca', random_state=0,
method='barnes_hut', verbose=20, n_iter=n_iter)
tomMoral /
Last active Sep 21, 2020
Add a coverage logger thread to get access to coverage in real time
from time import sleep
def func0():
print("run func0")
print("ran func0")
def func1():
tomMoral /
Created Oct 17, 2016
Test file for multiprocessing Manager list
import multiprocessing as mp
from multiprocessing import Manager
def test(idx, list_out):
if __name__ == '__main__':
mgr = Manager()