def parse_arguments(): from optparse import OptionParser parser = OptionParser(usage="usage: %prog [options]") # example of a custom simplerun.py variable parser.add_option( "--executable_location", default="", help="GFAL path to executable tarball, relative to gfaldir.") return gf.parse_arguments(parser)
def parse_arguments(): from optparse import OptionParser parser = OptionParser(usage="usage: %prog [options]") # example of a custom simplerun.py variable parser.add_option( "--executable_location", default="", help="GFAL path to executable tarball, relative to gfaldir.") parser.add_option("--world", default="", help="which world to run on") parser.add_option("--latin_hypercube", default="lhs", help="name of latin hypercube array") # parser.add_option( # "--base_idx", default="", # help="initial idx (seed) of submission") return gf.parse_arguments(parser)
def setup(): start_time = datetime.datetime.now() gf.print_flush("Start time: {0}".format( start_time.strftime("%d-%m-%Y %H:%M:%S"))) args = gf.parse_arguments() setup_environment(args, args.lhapdf_local) socket_config = None if gf.DEBUG_LEVEL > 1: # Architecture info gf.print_flush("Python version: {0}".format(sys.version)) gf.print_node_info("node_info.log") os.system("lsb_release -a") gf.do_shell("env") gf.do_shell("voms-proxy-info --all") if args.copy_log: # initialise with node name gf.do_shell("hostname >> {0}".format(gf.COPY_LOG)) return args, socket_config
if __name__ == "__main__": if sys.argv[0] and "ENVSET" not in os.environ: gf.print_flush("Setting environment") os.environ["ENVSET"] = "ENVSET" env = "/cvmfs/pheno.egi.eu/HEJ/HEJ_env.sh" os.execvp("bash", ["bash", "-c", "source " + env + " && exec python " + sys.argv[0] + ' "${@}"', "--"] + sys.argv[1:]) start_time = datetime.datetime.now() gf.print_flush("Start time: {0}".format( start_time.strftime("%d-%m-%Y %H:%M:%S"))) args = gf.parse_arguments() lhapdf_local = "" if args.use_cvmfs_lhapdf: lhapdf_local = args.cvmfs_lhapdf_location set_environment(args, lhapdf_local) if gf.DEBUG_LEVEL > -1: # Architecture info gf.print_flush("Python version: {0}".format(sys.version)) gf.print_node_info("node_info.log") if args.copy_log: # initialise with node name gf.do_shell("hostname >> {0}".format(gf.COPY_LOG))