getJob(row.jobId).then(response => { this.job = response.data; console.log("任务详情:"+response) this.openView = true; });打印的是任务详情:[object Object] 并没真实的值
时间: 2024-03-10 21:49:46 浏览: 111
这是因为你在打印时使用了对象的默认toString()方法,它会返回一个类似"[object Object]"的字符串,而不是对象的实际值。如果你想打印对象的值,可以使用JSON.stringify()方法将对象转换为字符串,例如:
```
getJob(row.jobId).then(response => {
this.job = response.data;
console.log("任务详情:"+JSON.stringify(response.data));
this.openView = true;
});
```
这样就可以正确地打印出任务详情的实际值了。
相关问题
在slurm中,查询job 在哪些CPU上执行任务.
要查询一个job在哪些CPU上执行任务,可以使用 `scontrol` 命令。具体操作步骤如下:
1. 首先通过 `squeue` 命令查看你的job ID,比如你的job ID是 1234:
```
$ squeue -u <username>
```
2. 然后通过 `scontrol` 命令查询job的详细信息,包括任务运行的节点和CPU信息,命令如下:
```
$ scontrol show jobid -dd 1234
```
这个命令会输出job的详细信息,包括任务运行的节点、CPU信息、任务的状态等。其中,CPU信息在 `JobNodes` 字段中。
例如,输出信息中可能包含以下内容:
```
JobId=1234 JobName=myjob
UserId=myusername(1234) GroupId=mygroup(5678)
Priority=100 Nice=0 Account=(null) QOS=normal
JobState=RUNNING Reason=None Dependency=(null)
Requeue=0 Restarts=0 BatchFlag=1 Reboot=0 ExitCode=0:0
RunTime=00:01:23 TimeLimit=00:30:00 TimeMin=N/A
SubmitTime=2021-06-01T10:00:00 EligibleTime=2021-06-01T10:00:00
StartTime=2021-06-01T10:00:00 EndTime=2021-06-01T10:30:00
PreemptTime=None SuspendTime=None SecsPreSuspend=0
LastSchedEval=2021-06-01T10:00:00
Partition=my_partition AllocNode:Sid=compute-0-0:1234
ReqNodeList=(null) ExcNodeList=(null)
NodeList=compute-0-0
BatchHost=compute-0-0
NumNodes=1 NumCPUs=16 NumTasks=1 CPUs/Task=16 ReqB:S:C:T=0:0:*:*
TRES=cpu=16,mem=64000M,node=1,billing=16
Socks/Node=* NtasksPerN:B:S:C=0:0:*:* CoreSpec=*
MinCPUsNode=1 MinMemoryNode=64000M MinTmpDiskNode=0
Features=(null) DelayBoot=00:00:00
OverSubscribe=OK Contiguous=0 Licenses=(null) Network=(null)
Command=(null)
WorkDir=/home/myusername/myjob
StdErr=/home/myusername/myjob/slurm-%j.err
StdIn=/dev/null
StdOut=/home/myusername/myjob/slurm-%j.out
Power= (null)
CleanUp=1
JobCheckpoint=(null)
OutOfMemory=0
Proctrack=proctrack/cgroup
TRESBillingWeights=CPU=1.000000,Mem=1.000000,Node=1.000000,GRES/Billing=1.000000
Reservation=(null)
Licenses=(null)
Flags= ArrayJobId=1234 ArrayTaskId=1
JobNodeMatchPolicy=EXACTNODE
SelectTypeParameters=(null)
JobAcctGatherType=jobacct_gather/linux
JobAcctGatherFrequency=30 (seconds)
JobAcctGatherDetail=standard
AccountingStorageTRES=cpu=00:01:23,mem=00:00:00,nvidia-smi=00:00:00
JobSubmitCapabilities=(null)
```
其中,`NodeList` 字段表示任务运行的节点,`NumCPUs` 字段表示任务使用的CPU数目。
所以,这个job在 `compute-0-0` 节点上运行,并且使用了16个CPU。
另外,如果你的job正在运行,你也可以使用 `top` 命令查看任务的CPU使用情况。
java.lang.IllegalArgumentException: class com.gec.bean.Job declares multiple JSON fields named id
This error occurs when a class is annotated with @JsonAutoDetect and declares multiple fields with the same property name. For example, the class com.gec.bean.Job might look like this:
public class Job {
private int id;
private String name;
private int jobId;
// getters and setters
}
In this case, the id field is already being serialized by default because it follows the JavaBean naming convention for a property called "id". However, the jobId field is also being serialized with the property name "id", which causes a conflict.
To resolve this issue, you can either change the property name of one of the fields or use annotations such as @JsonProperty to specify a different name for one of the fields. For example:
public class Job {
private int id;
private String name;
@JsonProperty("jobId")
private int jobId;
// getters and setters
}
With this change, the jobId field will be serialized with the property name "jobId" instead of "id", avoiding the conflict.
阅读全文