def make_job(self) -> psij.Job: job = psij.Job() spec = psij.JobSpec() spec.executable = '/bin/sleep' spec.arguments = ['1'] job.spec = spec return job
def make_job(): job = psij.Job() spec = psij.JobSpec() spec.executable = 'echo Hello World' spec.arguments = ['10'] job.spec = spec return job
def make_job(i): job = psij.Job() spec = psij.JobSpec() spec.executable = 'echo' spec.arguments = ['I am number ', i, ">>", "hello.txt"] spec.stdout_path = 'hello.' + str(i) + '.stdout' job.spec = spec return job
jex = None try: jex = psij.JobExecutor.get_instance(args.executor) except ValueError as err: sys.exit(f"Panic, {err}") except BaseException as err: sys.exit(f"Unexpected: {err}, {type(err)}") # Submit jobs number_of_jobs = args.jobs if args.verbose: print("Submitting " + str(number_of_jobs) + " job(s)") jobs = [] # list of created jobs for i in range(number_of_jobs): job = psij.Job() job.spec = job_spec jobs.append(job) jex.submit(job) if args.verbose: print("Waiting for jobs to finish") for i in range(number_of_jobs): jobs[i].wait() else: # Should never be here sys.stderr.write("Missig command. Use --help for more information.\n") parser.print_help(sys.stderr)
def make_job(spec, attributes): job = psij.Job() job.spec = spec return job