in submitit/core/core.py [0:0]
def _submit_command(self, command: str) -> Job[tp.Any]:
"""Submits a command to the cluster
It is recommended not to use this function since the Job instance assumes pickle
files will be created at the end of the job, and hence it will not work correctly.
You may use a CommandFunction as argument to the submit function instead. The only
problem with this latter solution is that stdout is buffered, and you will therefore
not be able to monitor the logs in real time.
Parameters
----------
command: str
a command string
Returns
-------
Job
A Job instance, providing access to the crun job information.
Since it has no output, some methods will not be efficient
"""
tmp_uuid = uuid.uuid4().hex
submission_file_path = (
utils.JobPaths.get_first_id_independent_folder(self.folder) / f"submission_file_{tmp_uuid}.sh"
)
with submission_file_path.open("w") as f:
f.write(self._make_submission_file_text(command, tmp_uuid))
command_list = self._make_submission_command(submission_file_path)
# run
output = utils.CommandFunction(command_list, verbose=False)() # explicit errors
job_id = self._get_job_id_from_submission_command(output)
tasks_ids = list(range(self._num_tasks()))
job: Job[tp.Any] = self.job_class(folder=self.folder, job_id=job_id, tasks=tasks_ids)
job.paths.move_temporary_file(submission_file_path, "submission_file")
self._write_job_id(job.job_id, tmp_uuid)
self._set_job_permissions(job.paths.folder)
return job