ppft scripts documentation¶
ppft server: the parallel python network server
- class _NetworkServer(ncpus='autodetect', interface='0.0.0.0', broadcast='255.255.255.255', port=None, secret=None, timeout=None, restart=False, proto=2, socket_timeout=3600, pid_file=None)¶
Network Server Class
Creates Server instance
ncpus - the number of worker processes to start on the local computer, if parameter is omitted it will be set to the number of processors in the system ppservers - list of active parallel python execution servers to connect with secret - passphrase for network connections, if omitted a default passphrase will be used. It’s highly recommended to use a custom passphrase for all network connections. restart - restart the worker process after each task completion proto - protocol number for pickle module socket_timeout - socket timeout in seconds, which is the maximum time a remote job could be executed. Increase this value if you have long running jobs or decrease if connectivity to remote ppservers is often lost.
With ncpus = 1 all tasks are executed consequently. For the best performance either use the default “autodetect” value or set ncpus to the total number of processors in the system.
Initiaates auto-discovery mechanism
Checks if timeout happened and shutdowns server if it did
Authenticates client and handles its jobs
Initiates listenting to incoming connections
Keeps track of the number of connections and time of the last one
Parses a config file in a very forgiving way.
Returns a sha1 hash object; optionally initialized with a string
- signal_handler(signum, stack)¶