include multiprocessing
use getuid, more reliable. If it runs as subprocess in lsf, it doesn't have a login name and it crashes