However we have solve the problem using directly the cryosparc variable
"qsub_cmd_tpl" : "qsub {{ script_path_abs }}",
After overcome this issue, we have found a new problem. The job is properly launched but the program is picking wrongly the qsub job id. We received this error:
[JSONRPC ERROR 2020-06-11 17:19:02.318096 at enqueue_job ]
-----------------------------------------------------
Traceback (most recent call last):
File "cryosparc2_command/command_core/__init__.py", line 115, in wrapper
res = func(*args, **kwargs)
File "cryosparc2_command/command_core/__init__.py", line 4585, in enqueue_job
scheduler_run()
File "cryosparc2_command/command_core/__init__.py", line 124, in wrapper
raise e
CalledProcessError: Command '['qstat', '-j', 'submitted']' returned non-zero exit status 1
We think that this “submited” instead of the job id comes from the message that our system return us when a qsub is launched. i.e:
Your job 387340 (“sleep”) has been submitted
We think (not sure) that the program pick “submited” instead of “387340”
Hi @dluque, apologies for the delay. You’re absolutely right, cryoSPARC does expect the cluster job ID to be at the very end of the command output. We may make this more flexible in future releases of cryoSPARC. For now, can you try adjusting your cluster submission script to filter for only the numeric job ID? I believe you can do so by changing the last line of cluster_script.sh to this:
I have tried it and it does not work. I think that the problem it is that we are trying to capture with a regular expression a block of numbers from the output that generates the execution of the cryosparc command that is embedded in the script that is passed to qsub.
However, I believe that the variable “cluster_job_id” stores the value that occurs in the output of the execution of the qsub command.
I ran into this on a slurm cluster. We include a --cluster parameter. Unfortunately this means that the submission command does not end with the job id. Example:
I’m not aware of any sbatch flags equivalent to qsub’s -terse.
I tried an approach similar to @nfrasser’s. However the jobid is parsed from the last word of the qsub_cmd_tpl standard out. Thus the grep command needs to go inside that, rather than inside the cluster_script.sh
Pipes don’t seem to work directly in qsub_cmd_tpl, so I had to use this somewhat ugly submission command:
"qsub_cmd_tpl": "bash -c 'sbatch --cluster=gpu-cluster \"{{ script_path_abs }}\" | sed -r \"s/ on cluster.*$//\"'",
In the end it works, but it would be very nice if cryosparc implemented a cleaner way of parsing the jobid. Maybe a new variable in cluster_info.json which accepts the qsub output and should return the jobid. E.g. the default behavior would be something like
"jobid_cmd_tmp": "awk '{print $NF}'",
This would have the advantage of documenting the jobid parsing behavior, which I had to figure out via trial and error.
Another solution might be to support pipes in the templates.