Skip to content
This repository was archived by the owner on Oct 9, 2023. It is now read-only.

Commit 8eaae66

Browse files
author
Alex Walker
authored
Set default parallelism of CoreClient to 2 (#211)
## What is the goal of this PR? Given that Python doesn't provide an easy way of getting the number of CPUs available to the process, we decided to reduce the default parallelism of CoreClient from 3 to 2. This should ensure it continues to run smoothly on systems with fewer cores. ## What are the changes implemented in this PR? Set default parallelism of CoreClient to 2
1 parent 747db00 commit 8eaae66

File tree

3 files changed

+4
-76
lines changed

3 files changed

+4
-76
lines changed

grakn/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ class Grakn:
3232
DEFAULT_ADDRESS = "localhost:1729"
3333

3434
@staticmethod
35-
def core_client(address: str, parallelisation: int = None) -> GraknClient:
35+
def core_client(address: str, parallelisation: int = 2) -> GraknClient:
3636
return _CoreClient(address, parallelisation)
3737

3838
@staticmethod
39-
def cluster_client(addresses: Union[Iterable[str], str], parallelisation: int = None) -> GraknClusterClient:
39+
def cluster_client(addresses: Union[Iterable[str], str], parallelisation: int = 2) -> GraknClusterClient:
4040
if isinstance(addresses, str):
4141
return _ClusterClient([addresses], parallelisation)
4242
else:

grakn/core/client.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,10 @@
2929
from grakn.stream.request_transmitter import RequestTransmitter
3030

3131

32-
def calculate_parallelisation():
33-
# TODO: cores = Runtime.getRuntime().availableProcessors()
34-
return 3
35-
36-
3732
class _CoreClient(GraknClient):
3833

39-
def __init__(self, address: str, parallelisation: int = None):
40-
if parallelisation is None:
41-
parallelisation = calculate_parallelisation()
34+
# TODO: Detect number of available CPUs
35+
def __init__(self, address: str, parallelisation: int = 2):
4236
self._address = address
4337
self._channel = insecure_channel(self._address)
4438
self._stub = GraknCoreStub(self._channel)

grakn/core/stream.py

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)