Commit 176f30d1 authored by khalid's avatar khalid
Browse files

solve testit syntax

parent 3655cc7a
......@@ -7,11 +7,9 @@ First, you'll need to enable GPUs for the notebook:
Navigate to Edit→Notebook Settings
select GPU from the Hardware Accelerator drop-down
"""
# Install requirments
!pip install matplotlib
!pip install numpy scipy
!pip install pycuda scikit-cuda
#!pip install dadi
......@@ -21,23 +19,22 @@ First, you'll need to enable GPUs for the notebook:
# local_dual_anneal.py : modif du fichier dual_anneal de scipy change to LocalSearchWrapper to allow the use of bounded minimizers other than L-BFGS-B
# or L-BFGS-B with a maxiter < than the default LS_MAXITER_MIN
!git clone https://gitlab.mbb.univ-montp2.fr/khalid/dadi.git
import os
os.chdir(dadi)
os.chdir('dadi')
!python3 setup.py install
import warnings
warnings.filterwarnings('ignore')
from google.colab import files
files.upload()
# Use YRI_CEU example
os.chdir('examples/YRI_CEU')
from numpy import array
import timeit
import dadi
# In demographic_models.py, we've defined a custom model for this problem
import demographic_models
......@@ -103,10 +100,10 @@ def optimize_log_gpu(pts_l):
print('CPU (s): pts_l =' + str(pts_l))
cpu_time = timeit.timeit('optimize_log_cpu(pts_l)', number=5, setup="from __main__ import optimize_log_cpu pts_l")
cpu_time = timeit.timeit('optimize_log_cpu(pts_l)', number=5, setup="from __main__ import optimize_log_cpu, pts_l")
print(cpu_time)
print('GPU (s): pts_l =' + str(pts_l))
gpu_time = timeit.timeit('optimize_log_gpu(pts_l)', number=5, setup="from __main__ import optimize_log_gpu pts_l")
gpu_time = timeit.timeit('optimize_log_gpu(pts_l)', number=5, setup="from __main__ import optimize_log_gpu, pts_l")
print(gpu_time)
print('GPU speedup over CPU: {:.2f}x'.format(cpu_time/gpu_time)+ ' pts_l =' + str(pts_l))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment