def init_jobspec(self, args): if not args.nslots: raise ValueError("Number of slots to allocate must be specified") jobspec = JobspecV1.from_nest_command( command=args.COMMAND, num_slots=args.nslots, cores_per_slot=args.cores_per_slot, gpus_per_slot=args.gpus_per_slot, num_nodes=args.nodes, broker_opts=list_split(args.broker_opts), ) if sys.stdin.isatty(): jobspec.setattr_shell_option("pty", True) return jobspec
def test_23_from_nest_command(self): """Test that `from_batch_command` produces a valid jobspec""" jobid = job.submit(self.fh, JobspecV1.from_nest_command(["sleep", "0"])) self.assertGreater(jobid, 0)