|
Lines 484-486
report_user_rec_to_hv(slurmdb_report_user_rec_t* rec, HV* hv)
Link Here
|
| 484 |
|
484 |
|
| 485 |
return 0; |
485 |
return 0; |
| 486 |
} |
486 |
} |
|
|
487 |
|
| 488 |
int |
| 489 |
stats_to_hv(slurmdb_stats_t *stats, HV* hv) |
| 490 |
{ |
| 491 |
STORE_FIELD(hv, stats, act_cpufreq, double); |
| 492 |
STORE_FIELD(hv, stats, cpu_ave, double); |
| 493 |
STORE_FIELD(hv, stats, consumed_energy, double); |
| 494 |
STORE_FIELD(hv, stats, cpu_min, uint32_t); |
| 495 |
STORE_FIELD(hv, stats, cpu_min_nodeid, uint32_t); |
| 496 |
STORE_FIELD(hv, stats, cpu_min_taskid, uint32_t); |
| 497 |
STORE_FIELD(hv, stats, disk_read_ave, double); |
| 498 |
STORE_FIELD(hv, stats, disk_read_max, double); |
| 499 |
STORE_FIELD(hv, stats, disk_read_max_nodeid, uint32_t); |
| 500 |
STORE_FIELD(hv, stats, disk_read_max_taskid, uint32_t); |
| 501 |
STORE_FIELD(hv, stats, disk_write_ave, double); |
| 502 |
STORE_FIELD(hv, stats, disk_write_max, double); |
| 503 |
STORE_FIELD(hv, stats, disk_write_max_nodeid, uint32_t); |
| 504 |
STORE_FIELD(hv, stats, disk_write_max_taskid, uint32_t); |
| 505 |
STORE_FIELD(hv, stats, pages_ave, double); |
| 506 |
STORE_FIELD(hv, stats, pages_max, uint64_t); |
| 507 |
STORE_FIELD(hv, stats, pages_max_nodeid, uint32_t); |
| 508 |
STORE_FIELD(hv, stats, pages_max_taskid, uint32_t); |
| 509 |
STORE_FIELD(hv, stats, rss_ave, double); |
| 510 |
STORE_FIELD(hv, stats, rss_max, uint64_t); |
| 511 |
STORE_FIELD(hv, stats, rss_max_nodeid, uint32_t); |
| 512 |
STORE_FIELD(hv, stats, rss_max_taskid, uint32_t); |
| 513 |
STORE_FIELD(hv, stats, vsize_ave, double); |
| 514 |
STORE_FIELD(hv, stats, vsize_max, uint64_t); |
| 515 |
STORE_FIELD(hv, stats, vsize_max_nodeid, uint32_t); |
| 516 |
STORE_FIELD(hv, stats, vsize_max_taskid, uint32_t); |
| 517 |
|
| 518 |
return 0; |
| 519 |
} |
| 520 |
|
| 521 |
int |
| 522 |
step_rec_to_hv(slurmdb_step_rec_t *rec, HV* hv) |
| 523 |
{ |
| 524 |
HV* stats_hv = (HV*)sv_2mortal((SV*)newHV()); |
| 525 |
stats_to_hv(&rec->stats, stats_hv); |
| 526 |
hv_store_sv(hv, "stats", newRV((SV*)stats_hv)); |
| 527 |
|
| 528 |
STORE_FIELD(hv, rec, elapsed, uint32_t); |
| 529 |
STORE_FIELD(hv, rec, end, time_t); |
| 530 |
STORE_FIELD(hv, rec, exitcode, int32_t); |
| 531 |
STORE_FIELD(hv, rec, ncpus, uint32_t); |
| 532 |
STORE_FIELD(hv, rec, nnodes, uint32_t); |
| 533 |
STORE_FIELD(hv, rec, nodes, charp); |
| 534 |
STORE_FIELD(hv, rec, ntasks, uint32_t); |
| 535 |
STORE_FIELD(hv, rec, pid_str, charp); |
| 536 |
STORE_FIELD(hv, rec, req_cpufreq, uint32_t); |
| 537 |
STORE_FIELD(hv, rec, requid, uint32_t); |
| 538 |
STORE_FIELD(hv, rec, start, time_t); |
| 539 |
STORE_FIELD(hv, rec, state, uint32_t); |
| 540 |
STORE_FIELD(hv, rec, stepid, uint32_t); |
| 541 |
STORE_FIELD(hv, rec, stepname, charp); |
| 542 |
STORE_FIELD(hv, rec, suspended, uint32_t); |
| 543 |
STORE_FIELD(hv, rec, sys_cpu_sec, uint32_t); |
| 544 |
STORE_FIELD(hv, rec, sys_cpu_usec, uint32_t); |
| 545 |
STORE_FIELD(hv, rec, task_dist, uint16_t); |
| 546 |
STORE_FIELD(hv, rec, tot_cpu_sec, uint32_t); |
| 547 |
STORE_FIELD(hv, rec, tot_cpu_usec, uint32_t); |
| 548 |
STORE_FIELD(hv, rec, user_cpu_sec, uint32_t); |
| 549 |
STORE_FIELD(hv, rec, user_cpu_usec, uint32_t); |
| 550 |
|
| 551 |
return 0; |
| 552 |
} |
| 553 |
|
| 554 |
int |
| 555 |
job_rec_to_hv(slurmdb_job_rec_t* rec, HV* hv) |
| 556 |
{ |
| 557 |
slurmdb_step_rec_t *step; |
| 558 |
ListIterator itr = NULL; |
| 559 |
AV* steps_av = (AV*)sv_2mortal((SV*)newAV()); |
| 560 |
HV* stats_hv = (HV*)sv_2mortal((SV*)newHV()); |
| 561 |
HV* step_hv; |
| 562 |
|
| 563 |
stats_to_hv(&rec->stats, stats_hv); |
| 564 |
hv_store_sv(hv, "stats", newRV((SV*)stats_hv)); |
| 565 |
|
| 566 |
if (rec->steps) { |
| 567 |
itr = slurm_list_iterator_create(rec->steps); |
| 568 |
while ((step = slurm_list_next(itr))) { |
| 569 |
step_hv = (HV*)sv_2mortal((SV*)newHV()); |
| 570 |
step_rec_to_hv(step, step_hv); |
| 571 |
av_push(steps_av, newRV((SV*)step_hv)); |
| 572 |
} |
| 573 |
} |
| 574 |
hv_store_sv(hv, "steps", newRV((SV*)steps_av)); |
| 575 |
|
| 576 |
STORE_FIELD(hv, rec, account, charp); |
| 577 |
STORE_FIELD(hv, rec, alloc_cpus, uint32_t); |
| 578 |
STORE_FIELD(hv, rec, alloc_gres, charp); |
| 579 |
STORE_FIELD(hv, rec, alloc_nodes, uint32_t); |
| 580 |
STORE_FIELD(hv, rec, array_job_id, uint32_t); |
| 581 |
STORE_FIELD(hv, rec, array_max_tasks, uint32_t); |
| 582 |
STORE_FIELD(hv, rec, array_task_id, uint32_t); |
| 583 |
STORE_FIELD(hv, rec, array_task_str, charp); |
| 584 |
STORE_FIELD(hv, rec, associd, uint32_t); |
| 585 |
STORE_FIELD(hv, rec, blockid, charp); |
| 586 |
STORE_FIELD(hv, rec, cluster, charp); |
| 587 |
STORE_FIELD(hv, rec, derived_ec, uint32_t); |
| 588 |
STORE_FIELD(hv, rec, derived_es, charp); |
| 589 |
STORE_FIELD(hv, rec, elapsed, uint32_t); |
| 590 |
STORE_FIELD(hv, rec, eligible, time_t); |
| 591 |
STORE_FIELD(hv, rec, end, time_t); |
| 592 |
STORE_FIELD(hv, rec, exitcode, uint32_t); |
| 593 |
/*STORE_FIELD(hv, rec, first_step_ptr, void*);*/ |
| 594 |
STORE_FIELD(hv, rec, gid, uint32_t); |
| 595 |
STORE_FIELD(hv, rec, jobid, uint32_t); |
| 596 |
STORE_FIELD(hv, rec, jobname, charp); |
| 597 |
STORE_FIELD(hv, rec, lft, uint32_t); |
| 598 |
STORE_FIELD(hv, rec, partition, charp); |
| 599 |
STORE_FIELD(hv, rec, nodes, charp); |
| 600 |
STORE_FIELD(hv, rec, priority, uint32_t); |
| 601 |
STORE_FIELD(hv, rec, qosid, uint32_t); |
| 602 |
STORE_FIELD(hv, rec, req_cpus, uint32_t); |
| 603 |
STORE_FIELD(hv, rec, req_gres, charp); |
| 604 |
STORE_FIELD(hv, rec, req_mem, uint32_t); |
| 605 |
STORE_FIELD(hv, rec, requid, uint32_t); |
| 606 |
STORE_FIELD(hv, rec, resvid, uint32_t); |
| 607 |
STORE_FIELD(hv, rec, resv_name, charp); |
| 608 |
STORE_FIELD(hv, rec, show_full, uint32_t); |
| 609 |
STORE_FIELD(hv, rec, start, time_t); |
| 610 |
STORE_FIELD(hv, rec, state, uint16_t); |
| 611 |
STORE_FIELD(hv, rec, submit, time_t); |
| 612 |
STORE_FIELD(hv, rec, suspended, uint32_t); |
| 613 |
STORE_FIELD(hv, rec, sys_cpu_sec, uint32_t); |
| 614 |
STORE_FIELD(hv, rec, sys_cpu_usec, uint32_t); |
| 615 |
STORE_FIELD(hv, rec, timelimit, uint32_t); |
| 616 |
STORE_FIELD(hv, rec, tot_cpu_sec, uint32_t); |
| 617 |
STORE_FIELD(hv, rec, tot_cpu_usec, uint32_t); |
| 618 |
STORE_FIELD(hv, rec, track_steps, uint16_t); |
| 619 |
STORE_FIELD(hv, rec, uid, uint32_t); |
| 620 |
STORE_FIELD(hv, rec, used_gres, charp); |
| 621 |
STORE_FIELD(hv, rec, user, charp); |
| 622 |
STORE_FIELD(hv, rec, user_cpu_sec, uint32_t); |
| 623 |
STORE_FIELD(hv, rec, user_cpu_usec, uint32_t); |
| 624 |
STORE_FIELD(hv, rec, wckey, charp); |
| 625 |
STORE_FIELD(hv, rec, wckeyid, uint32_t); |
| 626 |
|
| 627 |
return 0; |
| 628 |
} |
| 629 |
|
| 630 |
|