def set_mp_process_title(progname, info=None, hostname=None):
 if hostname:
  progname = ('%s@%s' % (progname, hostname.split('.')[0]))
 try:
  from multiprocessing.process import current_process
 except ImportError:
  return set_process_title(progname, info=info)
 else:
  return set_process_title(('%s:%s' % (progname, current_process().name)), info=info)

def set_mp_process_title ( progname , info = None , hostname = None ) : if hostname : progname = ( '%s@%s' % ( progname , hostname . split ( '.' ) [ 0 ] ) ) try : from multiprocessing . process import current_process except ImportError : return set_process_title ( progname , info = info ) else : return set_process_title ( ( '%s:%s' % ( progname , current_process ( ) . name ) ) , info = info )
set the ps name using the multiprocessing process name .