我正在尝试将java代码作为作业提交给qsub。 该命令
qsub -N job_$var -S /usr/bin/java -cp "classpath" file.java
qsub假设-cp是它的参数并抛出错误。
答案 0 :(得分:2)
这不是Java问题,因为它与qsub如何期望命令行参数有关。
但是qsub期望脚本运行,所以请尝试运行以下代码:
qsub -N job_$var /path/to/script.sh
使用script.sh具有以下内容:
java -cp "classpath" mainjavaclass
答案 1 :(得分:0)
如果这是Torque,您可以使用-F将参数发送到作业脚本而不是qsub:
function getWeekNumber(d) {
// Copy date so don't modify original
d = new Date(+d);
d.setHours(0,0,0,0);
// Set to nearest Thursday: current date + 4 - current day number
// Make Sunday's day number 7
d.setDate(d.getDate() + 4 - (d.getDay()||7));
// Get first day of year
var yearStart = new Date(d.getFullYear(),0,1);
// Calculate full weeks to nearest Thursday
var weekNo = Math.ceil((( (d - yearStart) / 86400000) + 1)/7);
// Return array of year and week number
//modify week number to display 1-12 semester 2
if (weekNo >= 5 && weekNo <= 18 ) {
var schoolWeekNo = weekNo - 4;
var semester = 2;
}
//modify week number to display 1-12 semester 1
else if (weekNo >= 39 && weekNo<= 50) {
var schoolWeekNo = weekNo - 38;
var semester = 1;
}
//do not display week number for none semester dates
else {
schoolWeekNo = null;
semester = null;
};
return [semester,schoolWeekNo];
};
alert(getWeekNumber(Date.now()));