a little framework to simule multiprocessing over a lot of computers
Project description
import random
import org.py4grid.GP as gp
def testando(lista):
for x in range(2 * 1):
lista.append(random.random())
return lista
if __name__ == '__main__':
from multiprocessing.dummy import Pool as pool
remote = gp.RemoteProcess(pool, discover_hosts=True)
ret = remote.processwork( testando, [[], [], [], []],
relative_path={'Windows': 'C:/Dropbox/BIBLIOTECA_PYTHON', 'Darwin': '/Dropbox/BIBLIOTECA_PYTHON', 'Linux': '/Dropbox/BIBLIOTECA_PYTHON'},
Hosts=[('localhost', 4680)])
for item in ret:
for sub in item:
print(len(sub), sub)
before use this framework,
starts PY4GRIDSERVER generated in PythonXX\Script directory for begin a server
and then start DISCOVER if you want to use the option discover_hosts, this option works discovering the address of the servers started
and only works if the Hosts argument is empty, if you do not wish to use this option must explicitly pass the argument Hosts
example:
C:\Python33\Script\PY4GRIDSERVER <- starts the server on port 4680
C:\Python33\Script\DISCOVER <- start the discoverer of servers
import org.py4grid.GP as gp
def testando(lista):
for x in range(2 * 1):
lista.append(random.random())
return lista
if __name__ == '__main__':
from multiprocessing.dummy import Pool as pool
remote = gp.RemoteProcess(pool, discover_hosts=True)
ret = remote.processwork( testando, [[], [], [], []],
relative_path={'Windows': 'C:/Dropbox/BIBLIOTECA_PYTHON', 'Darwin': '/Dropbox/BIBLIOTECA_PYTHON', 'Linux': '/Dropbox/BIBLIOTECA_PYTHON'},
Hosts=[('localhost', 4680)])
for item in ret:
for sub in item:
print(len(sub), sub)
before use this framework,
starts PY4GRIDSERVER generated in PythonXX\Script directory for begin a server
and then start DISCOVER if you want to use the option discover_hosts, this option works discovering the address of the servers started
and only works if the Hosts argument is empty, if you do not wish to use this option must explicitly pass the argument Hosts
example:
C:\Python33\Script\PY4GRIDSERVER <- starts the server on port 4680
C:\Python33\Script\DISCOVER <- start the discoverer of servers
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
PY4GRID-1.0.5.tar.gz
(7.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file PY4GRID-1.0.5.tar.gz.
File metadata
- Download URL: PY4GRID-1.0.5.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
411a12dbdb2c58b627ade4f12138a9e7e11d64a7a4181031800db0eb9828cca1
|
|
| MD5 |
3ce63cd993b1af6ec14fe384a3f67907
|
|
| BLAKE2b-256 |
87a17fbba35fa7ff402a9ac51320a8295430e23bbe143327ebf15d7804967a35
|
File details
Details for the file PY4GRID-1.0.5.macosx-10.6-intel.tar.gz.
File metadata
- Download URL: PY4GRID-1.0.5.macosx-10.6-intel.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7538754568dcf8867abea2410f0230b29be6fbe46ac818e3a2b9899cc76b47c8
|
|
| MD5 |
fbca343d93272384ebc7285dd771abbb
|
|
| BLAKE2b-256 |
b6c1c428ab83b82480a70f56c1f469155665d934ac1b2b28d5bac860fd9b2324
|