ppft scripts documentation
ppserver script
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)
Bases:
Server
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.
- broadcast()
Initiaates auto-discovery mechanism
- check_timeout()
Checks if timeout happened and shutdowns server if it did
- crun(csocket)
Authenticates client and handles its jobs
- listen()
Initiates listenting to incoming connections
- ncon_add(val)
Keeps track of the number of connections and time of the last one
- create_network_server(argv)
- parse_config(file_loc)
Parses a config file in a very forgiving way.
- print_usage()
Prints help
- sha_new(string=b'', *, usedforsecurity=True)
Returns a sha1 hash object; optionally initialized with a string
- signal_handler(signum, stack)