File: engines_test.py

package info (click to toggle)
ipyparallel 9.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,388 kB
  • sloc: python: 22,769; javascript: 267; makefile: 29; sh: 28
file content (22 lines) | stat: -rw-r--r-- 457 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import time
from subprocess import check_call

import ipyparallel as ipp

n = 20


check_call(f'ipcluster start -n {n} --daemon --profile=asv --debug', shell=True)
c = ipp.Client(profile='asv')
seen = -1

running_engines = len(c)

while running_engines < n:
    if seen != running_engines:
        print(running_engines)
        seen = running_engines
    running_engines = len(c)
    time.sleep(0.1)

check_call('ipcluster stop --profile=asv', shell=True)