~ubuntu-branches/ubuntu/vivid/slurm-llnl/vivid

« back to all changes in this revision

Viewing changes to src/common/slurm_accounting_storage.c

  • Committer: Bazaar Package Importer
  • Author(s): Gennaro Oliva
  • Date: 2009-09-24 23:28:15 UTC
  • mfrom: (1.1.11 upstream) (3.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090924232815-enh65jn32q1ebg07
Tags: 2.0.5-1
* New upstream release 
* Changed dependecy from lib-mysqlclient15 to lib-mysqlclient 
* Added Default-Start for runlevel 2 and 4 and $remote_fs requirement in
  init.d scripts (Closes: #541252)
* Postinst checks for wrong runlevels 2 and 4 links
* Upgraded to standard version 3.8.3
* Add lintian overrides for missing slurm-llnl-configurator.html in doc
  base registration
* modified postrm scripts to ignore pkill return value in order to avoid
  postrm failure when no slurm process is running
* Checking for slurmctld.pid before cancelling running and pending
  jobs during package removal 

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 *  $Id: slurm_accounting_storage.c 10744 2007-01-11 20:09:18Z da $
5
5
 *****************************************************************************
6
6
 *  Copyright (C) 2002-2007 The Regents of the University of California.
7
 
 *  Copyright (C) 2008 Lawrence Livermore National Security.
 
7
 *  Copyright (C) 2008-2009 Lawrence Livermore National Security.
8
8
 *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
9
9
 *  Written by Danny Aubke <da@llnl.gov>.
10
 
 *  LLNL-CODE-402394.
 
10
 *  CODE-OCEC-09-009. All rights reserved.
11
11
 *  
12
12
 *  This file is part of SLURM, a resource management program.
13
 
 *  For details, see <http://www.llnl.gov/linux/slurm/>.
 
13
 *  For details, see <https://computing.llnl.gov/linux/slurm/>.
 
14
 *  Please also read the included file: DISCLAIMER.
14
15
 *  
15
16
 *  SLURM is free software; you can redistribute it and/or modify it under
16
17
 *  the terms of the GNU General Public License as published by the Free
42
43
#  include "config.h"
43
44
#endif
44
45
 
 
46
#ifndef   _GNU_SOURCE
 
47
#  define _GNU_SOURCE
 
48
#endif
 
49
 
45
50
#include <pthread.h>
 
51
#include <string.h>
46
52
 
47
53
#include "src/common/list.h"
48
54
#include "src/common/slurm_accounting_storage.h"
52
58
#include "src/common/xstring.h"
53
59
#include "src/slurmctld/slurmctld.h"
54
60
#include "src/sacctmgr/sacctmgr.h"
 
61
#include "src/common/slurm_strcasestr.h"
55
62
 
56
63
/*
57
64
 * Local data
77
84
                                    List qos_list);
78
85
        int  (*add_wckeys)         (void *db_conn, uint32_t uid,
79
86
                                    List wckey_list);
 
87
        int  (*add_reservation)    (void *db_conn,
 
88
                                    acct_reservation_rec_t *resv);
80
89
        List (*modify_users)       (void *db_conn, uint32_t uid,
81
90
                                    acct_user_cond_t *user_cond,
82
91
                                    acct_user_rec_t *user);
95
104
        List (*modify_wckeys)      (void *db_conn, uint32_t uid,
96
105
                                    acct_wckey_cond_t *wckey_cond,
97
106
                                    acct_wckey_rec_t *wckey);
 
107
        int  (*modify_reservation) (void *db_conn,
 
108
                                    acct_reservation_rec_t *resv);
98
109
        List (*remove_users)       (void *db_conn, uint32_t uid,
99
110
                                    acct_user_cond_t *user_cond);
100
111
        List (*remove_coord)       (void *db_conn, uint32_t uid,
110
121
                                    acct_qos_cond_t *qos_cond);
111
122
        List (*remove_wckeys)      (void *db_conn, uint32_t uid,
112
123
                                    acct_wckey_cond_t *wckey_cond);
 
124
        int  (*remove_reservation) (void *db_conn,
 
125
                                    acct_reservation_rec_t *resv);
113
126
        List (*get_users)          (void *db_conn, uint32_t uid,
114
127
                                    acct_user_cond_t *user_cond);
115
128
        List (*get_accts)          (void *db_conn, uint32_t uid,
116
129
                                    acct_account_cond_t *acct_cond);
117
130
        List (*get_clusters)       (void *db_conn, uint32_t uid,
118
131
                                    acct_cluster_cond_t *cluster_cond);
 
132
        List (*get_config)         (void *db_conn);
119
133
        List (*get_associations)   (void *db_conn, uint32_t uid,
120
134
                                    acct_association_cond_t *assoc_cond);
121
135
        List (*get_qos)            (void *db_conn, uint32_t uid,
122
136
                                    acct_qos_cond_t *qos_cond);
123
137
        List (*get_wckeys)         (void *db_conn, uint32_t uid,
124
138
                                    acct_wckey_cond_t *wckey_cond);
 
139
        List (*get_resvs)          (void *db_conn, uint32_t uid,
 
140
                                    acct_reservation_cond_t *resv_cond);
125
141
        List (*get_txn)            (void *db_conn, uint32_t uid,
126
142
                                    acct_txn_cond_t *txn_cond);
127
143
        int  (*get_usage)          (void *db_conn, uint32_t uid,
129
145
                                    time_t start, 
130
146
                                    time_t end);
131
147
        int (*roll_usage)          (void *db_conn, 
132
 
                                    time_t sent_start);
 
148
                                    time_t sent_start, time_t sent_end,
 
149
                                    uint16_t archive_data);
133
150
        int  (*node_down)          (void *db_conn,
134
151
                                    char *cluster,
135
152
                                    struct node_record *node_ptr,
140
157
                                    struct node_record *node_ptr,
141
158
                                    time_t event_time);
142
159
        int  (*cluster_procs)      (void *db_conn,
143
 
                                    char *cluster,
 
160
                                    char *cluster, char *cluster_nodes,
144
161
                                    uint32_t procs, time_t event_time);
145
162
        int  (*c_get_usage)        (void *db_conn, uint32_t uid,
146
163
                                    void *cluster_rec, int type,
212
229
                "acct_storage_p_add_associations",
213
230
                "acct_storage_p_add_qos",
214
231
                "acct_storage_p_add_wckeys",
 
232
                "acct_storage_p_add_reservation",
215
233
                "acct_storage_p_modify_users",
216
234
                "acct_storage_p_modify_accounts",
217
235
                "acct_storage_p_modify_clusters",
218
236
                "acct_storage_p_modify_associations",
219
237
                "acct_storage_p_modify_qos",
220
238
                "acct_storage_p_modify_wckeys",
 
239
                "acct_storage_p_modify_reservation",
221
240
                "acct_storage_p_remove_users",
222
241
                "acct_storage_p_remove_coord",
223
242
                "acct_storage_p_remove_accts",
225
244
                "acct_storage_p_remove_associations",
226
245
                "acct_storage_p_remove_qos",
227
246
                "acct_storage_p_remove_wckeys",
 
247
                "acct_storage_p_remove_reservation",
228
248
                "acct_storage_p_get_users",
229
249
                "acct_storage_p_get_accts",
230
250
                "acct_storage_p_get_clusters",
 
251
                "acct_storage_p_get_config",
231
252
                "acct_storage_p_get_associations",
232
253
                "acct_storage_p_get_qos",
233
254
                "acct_storage_p_get_wckeys",
 
255
                "acct_storage_p_get_reservations",
234
256
                "acct_storage_p_get_txn",
235
257
                "acct_storage_p_get_usage",
236
258
                "acct_storage_p_roll_usage",
495
517
                        list_destroy(acct_cluster->accounting_list);
496
518
                xfree(acct_cluster->control_host);
497
519
                xfree(acct_cluster->name);
498
 
                if(acct_cluster->valid_qos_list)
499
 
                        list_destroy(acct_cluster->valid_qos_list);
 
520
                xfree(acct_cluster->nodes);
500
521
                destroy_acct_association_rec(acct_cluster->root_assoc);
501
522
                xfree(acct_cluster);
502
523
        }
521
542
                if(acct_association->accounting_list)
522
543
                        list_destroy(acct_association->accounting_list);
523
544
                xfree(acct_association->acct);
 
545
                if(acct_association->childern_list)
 
546
                        list_destroy(acct_association->childern_list);
524
547
                xfree(acct_association->cluster);
525
548
                xfree(acct_association->parent_acct);
526
549
                xfree(acct_association->partition);
550
573
        }
551
574
}
552
575
 
 
576
extern void destroy_acct_reservation_rec(void *object)
 
577
{
 
578
        acct_reservation_rec_t *acct_resv = (acct_reservation_rec_t *)object;
 
579
        if(acct_resv) {
 
580
                xfree(acct_resv->assocs);
 
581
                xfree(acct_resv->cluster);
 
582
                xfree(acct_resv->name);
 
583
                xfree(acct_resv->nodes);
 
584
                xfree(acct_resv->node_inx);
 
585
                xfree(acct_resv);
 
586
        }
 
587
}
 
588
 
553
589
extern void destroy_acct_txn_rec(void *object)
554
590
{
555
591
        acct_txn_rec_t *acct_txn = (acct_txn_rec_t *)object;
703
739
                        list_destroy(job_cond->groupid_list);
704
740
                if(job_cond->partition_list)
705
741
                        list_destroy(job_cond->partition_list);
 
742
                if(job_cond->resv_list)
 
743
                        list_destroy(job_cond->resv_list);
 
744
                if(job_cond->resvid_list)
 
745
                        list_destroy(job_cond->resvid_list);
706
746
                if(job_cond->step_list)
707
747
                        list_destroy(job_cond->step_list);
708
748
                if(job_cond->state_list)
709
749
                        list_destroy(job_cond->state_list);
 
750
                xfree(job_cond->used_nodes);
710
751
                if(job_cond->userid_list)
711
752
                        list_destroy(job_cond->userid_list);
712
753
                if(job_cond->wckey_list)
727
768
        }
728
769
}
729
770
 
 
771
extern void destroy_acct_reservation_cond(void *object)
 
772
{
 
773
        acct_reservation_cond_t *acct_resv = (acct_reservation_cond_t *)object;
 
774
        if(acct_resv) {
 
775
                if(acct_resv->cluster_list) 
 
776
                        list_destroy(acct_resv->cluster_list);
 
777
                if(acct_resv->id_list)
 
778
                        list_destroy(acct_resv->id_list);
 
779
                if(acct_resv->name_list)
 
780
                        list_destroy(acct_resv->name_list);
 
781
                xfree(acct_resv->nodes);
 
782
                xfree(acct_resv);
 
783
        }
 
784
}
 
785
 
730
786
extern void destroy_acct_txn_cond(void *object)
731
787
{
732
788
        acct_txn_cond_t *acct_txn = (acct_txn_cond_t *)object;
842
898
 
843
899
        memset(assoc, 0, sizeof(acct_association_rec_t));
844
900
 
845
 
        assoc->fairshare = NO_VAL;
846
 
 
847
901
        assoc->grp_cpu_mins = NO_VAL;
848
902
        assoc->grp_cpus = NO_VAL;
849
903
        assoc->grp_jobs = NO_VAL;
851
905
        assoc->grp_submit_jobs = NO_VAL;
852
906
        assoc->grp_wall = NO_VAL;
853
907
 
 
908
        assoc->level_shares = NO_VAL;
 
909
 
854
910
        assoc->max_cpu_mins_pj = NO_VAL;
855
911
        assoc->max_cpus_pj = NO_VAL;
856
912
        assoc->max_jobs = NO_VAL;
857
913
        assoc->max_nodes_pj = NO_VAL;
858
914
        assoc->max_submit_jobs = NO_VAL;
859
915
        assoc->max_wall_pj = NO_VAL;
 
916
 
 
917
        assoc->shares_norm = (double)NO_VAL;
 
918
        assoc->shares_raw = NO_VAL;
 
919
 
 
920
        assoc->usage_efctv = 0;
 
921
        assoc->usage_norm = (long double)NO_VAL;
 
922
        assoc->usage_raw = 0;
860
923
}
861
924
 
862
925
extern void init_acct_qos_rec(acct_qos_rec_t *qos)
881
944
        qos->max_nodes_pu = NO_VAL;
882
945
        qos->max_submit_jobs_pu = NO_VAL;
883
946
        qos->max_wall_pu = NO_VAL;
 
947
 
 
948
        qos->usage_factor = NO_VAL;
884
949
}
885
950
 
886
951
/****************************************************************************\
1230
1295
        return SLURM_ERROR;
1231
1296
}
1232
1297
 
1233
 
 
1234
 
extern void pack_update_shares_used(void *in, uint16_t rpc_version, Buf buffer)
1235
 
{
1236
 
        shares_used_object_t *object = (shares_used_object_t *)in;
1237
 
 
1238
 
        if(!object) {
1239
 
                pack32(0, buffer);
1240
 
                pack32(0, buffer);
1241
 
                return;
1242
 
        }
1243
 
 
1244
 
        pack32(object->assoc_id, buffer);
1245
 
        pack32(object->shares_used, buffer);
1246
 
}
1247
 
 
1248
 
extern int unpack_update_shares_used(void **object, uint16_t rpc_version,
1249
 
                                     Buf buffer)
1250
 
{
1251
 
        shares_used_object_t *object_ptr =
1252
 
                xmalloc(sizeof(shares_used_object_t));
1253
 
 
1254
 
        *object = (void *) object_ptr;
1255
 
        safe_unpack32(&object_ptr->assoc_id, buffer);
1256
 
        safe_unpack32(&object_ptr->shares_used, buffer);
1257
 
 
1258
 
        return SLURM_SUCCESS;
1259
 
 
1260
 
unpack_error:
1261
 
        destroy_update_shares_rec(object_ptr);
1262
 
        *object = NULL;
1263
 
        return SLURM_ERROR;
1264
 
}
1265
1298
extern void pack_acct_account_rec(void *in, uint16_t rpc_version, Buf buffer)
1266
1299
{
1267
1300
        acct_coord_rec_t *coord = NULL;
1485
1518
{
1486
1519
        cluster_accounting_rec_t *object = (cluster_accounting_rec_t *)in;
1487
1520
        
1488
 
        if(!object) {
1489
 
                pack64(0, buffer);
1490
 
                pack32(0, buffer);
1491
 
                pack64(0, buffer);
1492
 
                pack64(0, buffer);
1493
 
                pack64(0, buffer);
1494
 
                pack_time(0, buffer);
1495
 
                pack64(0, buffer);
1496
 
                return;
 
1521
        if(rpc_version >= 5) {
 
1522
                if(!object) {
 
1523
                        pack64(0, buffer);
 
1524
                        pack32(0, buffer);
 
1525
                        pack64(0, buffer);
 
1526
                        pack64(0, buffer);
 
1527
                        pack64(0, buffer);
 
1528
                        pack64(0, buffer);
 
1529
                        pack_time(0, buffer);
 
1530
                        pack64(0, buffer);
 
1531
                        return;
 
1532
                }
 
1533
                
 
1534
                pack64(object->alloc_secs, buffer);
 
1535
                pack32(object->cpu_count, buffer);
 
1536
                pack64(object->down_secs, buffer);
 
1537
                pack64(object->idle_secs, buffer);
 
1538
                pack64(object->over_secs, buffer);
 
1539
                pack64(object->pdown_secs, buffer);
 
1540
                pack_time(object->period_start, buffer);
 
1541
                pack64(object->resv_secs, buffer);
 
1542
        } else {
 
1543
                if(!object) {
 
1544
                        pack64(0, buffer);
 
1545
                        pack32(0, buffer);
 
1546
                        pack64(0, buffer);
 
1547
                        pack64(0, buffer);
 
1548
                        pack64(0, buffer);
 
1549
                        pack_time(0, buffer);
 
1550
                        pack64(0, buffer);
 
1551
                        return;
 
1552
                }
 
1553
                
 
1554
                pack64(object->alloc_secs, buffer);
 
1555
                pack32(object->cpu_count, buffer);
 
1556
                pack64(object->down_secs, buffer);
 
1557
                pack64(object->idle_secs, buffer);
 
1558
                pack64(object->over_secs, buffer);
 
1559
                pack_time(object->period_start, buffer);
 
1560
                pack64(object->resv_secs, buffer);
1497
1561
        }
1498
 
 
1499
 
        pack64(object->alloc_secs, buffer);
1500
 
        pack32(object->cpu_count, buffer);
1501
 
        pack64(object->down_secs, buffer);
1502
 
        pack64(object->idle_secs, buffer);
1503
 
        pack64(object->over_secs, buffer);
1504
 
        pack_time(object->period_start, buffer);
1505
 
        pack64(object->resv_secs, buffer);
1506
1562
}
1507
1563
 
1508
1564
extern int unpack_cluster_accounting_rec(void **object, uint16_t rpc_version,
1512
1568
                xmalloc(sizeof(cluster_accounting_rec_t));
1513
1569
        
1514
1570
        *object = object_ptr;
1515
 
        safe_unpack64(&object_ptr->alloc_secs, buffer);
1516
 
        safe_unpack32(&object_ptr->cpu_count, buffer);
1517
 
        safe_unpack64(&object_ptr->down_secs, buffer);
1518
 
        safe_unpack64(&object_ptr->idle_secs, buffer);
1519
 
        safe_unpack64(&object_ptr->over_secs, buffer);
1520
 
        safe_unpack_time(&object_ptr->period_start, buffer);
1521
 
        safe_unpack64(&object_ptr->resv_secs, buffer);
 
1571
 
 
1572
        if(rpc_version >= 5) {
 
1573
                safe_unpack64(&object_ptr->alloc_secs, buffer);
 
1574
                safe_unpack32(&object_ptr->cpu_count, buffer);
 
1575
                safe_unpack64(&object_ptr->down_secs, buffer);
 
1576
                safe_unpack64(&object_ptr->idle_secs, buffer);
 
1577
                safe_unpack64(&object_ptr->over_secs, buffer);
 
1578
                safe_unpack64(&object_ptr->pdown_secs, buffer);
 
1579
                safe_unpack_time(&object_ptr->period_start, buffer);
 
1580
                safe_unpack64(&object_ptr->resv_secs, buffer);
 
1581
        } else {
 
1582
                safe_unpack64(&object_ptr->alloc_secs, buffer);
 
1583
                safe_unpack32(&object_ptr->cpu_count, buffer);
 
1584
                safe_unpack64(&object_ptr->down_secs, buffer);
 
1585
                safe_unpack64(&object_ptr->idle_secs, buffer);
 
1586
                safe_unpack64(&object_ptr->over_secs, buffer);
 
1587
                safe_unpack_time(&object_ptr->period_start, buffer);
 
1588
                safe_unpack64(&object_ptr->resv_secs, buffer);
 
1589
        }
1522
1590
        
1523
1591
        return SLURM_SUCCESS;
1524
1592
 
1532
1600
{
1533
1601
        cluster_accounting_rec_t *acct_info = NULL;
1534
1602
        ListIterator itr = NULL;
1535
 
        char *tmp_info = NULL;
1536
1603
        uint32_t count = NO_VAL;
1537
1604
        acct_cluster_rec_t *object = (acct_cluster_rec_t *)in;
1538
1605
 
1539
 
        if(rpc_version >= 3) {
1540
 
                if(!object) {
1541
 
                        pack32(NO_VAL, buffer);
1542
 
                        packnull(buffer);
1543
 
                        pack32(0, buffer);
1544
 
 
1545
 
                        packnull(buffer);
1546
 
 
1547
 
                        pack32(NO_VAL, buffer);
1548
 
                        pack_acct_association_rec(NULL, rpc_version, buffer);
1549
 
 
1550
 
                        pack16(0, buffer);
1551
 
                        return;
1552
 
                }
1553
 
 
1554
 
                if(object->accounting_list)
1555
 
                        count = list_count(object->accounting_list);
1556
 
 
1557
 
                pack32(count, buffer);
1558
 
 
1559
 
                if(count && count != NO_VAL) {
1560
 
                        itr = list_iterator_create(object->accounting_list);
1561
 
                        while((acct_info = list_next(itr))) {
1562
 
                                pack_cluster_accounting_rec(
1563
 
                                        acct_info, rpc_version, buffer);
1564
 
                        }
1565
 
                        list_iterator_destroy(itr);
1566
 
                }
1567
 
                count = NO_VAL;
1568
 
 
1569
 
                packstr(object->control_host, buffer);
1570
 
                pack32(object->control_port, buffer);
1571
 
 
1572
 
                packstr(object->name, buffer);
1573
 
 
1574
 
                if(object->valid_qos_list)
1575
 
                        count = list_count(object->valid_qos_list);
1576
 
 
1577
 
                pack32(count, buffer);
1578
 
 
1579
 
                if(count && count != NO_VAL) {
1580
 
                        itr = list_iterator_create(object->valid_qos_list);
1581
 
                        while((tmp_info = list_next(itr))) {
1582
 
                                packstr(tmp_info, buffer);
1583
 
                        }
1584
 
                        list_iterator_destroy(itr);
1585
 
                }
1586
 
                count = NO_VAL;
 
1606
        if(rpc_version >= 5) {
 
1607
                if(!object) {
 
1608
                        pack32(NO_VAL, buffer);
 
1609
                        pack16(0, buffer);
 
1610
                        packnull(buffer);
 
1611
                        pack32(0, buffer);
 
1612
                        pack32(0, buffer);
 
1613
 
 
1614
                        packnull(buffer);
 
1615
                        packnull(buffer);
 
1616
 
 
1617
                        pack_acct_association_rec(NULL, rpc_version, buffer);
 
1618
 
 
1619
                        pack16(0, buffer);
 
1620
                        return;
 
1621
                }
 
1622
 
 
1623
                if(object->accounting_list)
 
1624
                        count = list_count(object->accounting_list);
 
1625
 
 
1626
                pack32(count, buffer);
 
1627
 
 
1628
                if(count && count != NO_VAL) {
 
1629
                        itr = list_iterator_create(object->accounting_list);
 
1630
                        while((acct_info = list_next(itr))) {
 
1631
                                pack_cluster_accounting_rec(
 
1632
                                        acct_info, rpc_version, buffer);
 
1633
                        }
 
1634
                        list_iterator_destroy(itr);
 
1635
                }
 
1636
                count = NO_VAL;
 
1637
 
 
1638
                pack16(object->classification, buffer);
 
1639
                packstr(object->control_host, buffer);
 
1640
                pack32(object->control_port, buffer);
 
1641
                pack32(object->cpu_count, buffer);
 
1642
 
 
1643
                packstr(object->name, buffer);
 
1644
                packstr(object->nodes, buffer);
 
1645
 
 
1646
                pack_acct_association_rec(object->root_assoc,
 
1647
                                          rpc_version, buffer);
 
1648
 
 
1649
                pack16(object->rpc_version, buffer);
 
1650
        } else if(rpc_version >= 3) {
 
1651
                if(!object) {
 
1652
                        pack32(NO_VAL, buffer);
 
1653
                        packnull(buffer);
 
1654
                        pack32(0, buffer);
 
1655
 
 
1656
                        packnull(buffer);
 
1657
 
 
1658
                        pack32(NO_VAL, buffer);
 
1659
                        pack_acct_association_rec(NULL, rpc_version, buffer);
 
1660
 
 
1661
                        pack16(0, buffer);
 
1662
                        return;
 
1663
                }
 
1664
 
 
1665
                if(object->accounting_list)
 
1666
                        count = list_count(object->accounting_list);
 
1667
 
 
1668
                pack32(count, buffer);
 
1669
 
 
1670
                if(count && count != NO_VAL) {
 
1671
                        itr = list_iterator_create(object->accounting_list);
 
1672
                        while((acct_info = list_next(itr))) {
 
1673
                                pack_cluster_accounting_rec(
 
1674
                                        acct_info, rpc_version, buffer);
 
1675
                        }
 
1676
                        list_iterator_destroy(itr);
 
1677
                }
 
1678
                count = NO_VAL;
 
1679
 
 
1680
                packstr(object->control_host, buffer);
 
1681
                pack32(object->control_port, buffer);
 
1682
 
 
1683
                packstr(object->name, buffer);
 
1684
 
 
1685
                pack32(count, buffer); /* for defunt valid_qos_list */
1587
1686
 
1588
1687
                pack_acct_association_rec(object->root_assoc,
1589
1688
                                          rpc_version, buffer);
1630
1729
                        pack32(NO_VAL, buffer);
1631
1730
                        pack32(NO_VAL, buffer);
1632
1731
                } else {
1633
 
                        pack32(object->root_assoc->fairshare, buffer);
 
1732
                        pack32(object->root_assoc->shares_raw, buffer);
1634
1733
                        pack32(object->root_assoc->max_cpu_mins_pj, buffer);
1635
1734
                        pack32(object->root_assoc->max_jobs, buffer);
1636
1735
                        pack32(object->root_assoc->max_nodes_pj, buffer);
1646
1745
{
1647
1746
        uint32_t uint32_tmp;
1648
1747
        int i;
1649
 
        char *tmp_info = NULL;
1650
1748
        uint32_t count;
1651
1749
        acct_cluster_rec_t *object_ptr = xmalloc(sizeof(acct_cluster_rec_t));
1652
1750
        cluster_accounting_rec_t *acct_info = NULL;
1653
1751
 
1654
1752
        *object = object_ptr;
1655
1753
 
1656
 
        if(rpc_version >= 3) {
1657
 
                safe_unpack32(&count, buffer);
1658
 
                if(count != NO_VAL) {
1659
 
                        object_ptr->accounting_list =
1660
 
                                list_create(destroy_cluster_accounting_rec);
1661
 
                        for(i=0; i<count; i++) {
1662
 
                                unpack_cluster_accounting_rec(
1663
 
                                        (void *)&acct_info,
1664
 
                                        rpc_version, buffer);
1665
 
                                list_append(object_ptr->accounting_list,
1666
 
                                            acct_info);
1667
 
                        }
1668
 
                }
1669
 
 
1670
 
                safe_unpackstr_xmalloc(&object_ptr->control_host,
1671
 
                                       &uint32_tmp, buffer);
1672
 
                safe_unpack32(&object_ptr->control_port, buffer);
1673
 
 
1674
 
                safe_unpackstr_xmalloc(&object_ptr->name, &uint32_tmp, buffer);
1675
 
 
1676
 
                safe_unpack32(&count, buffer);
1677
 
                if(count != NO_VAL) {
1678
 
                        object_ptr->valid_qos_list = 
1679
 
                                list_create(slurm_destroy_char);
1680
 
                        for(i=0; i<count; i++) {
1681
 
                                safe_unpackstr_xmalloc(&tmp_info,
1682
 
                                                       &uint32_tmp, buffer);
1683
 
                                list_append(object_ptr->valid_qos_list,
1684
 
                                            tmp_info);
1685
 
                        }
1686
 
                }
 
1754
        if(rpc_version >= 5) {
 
1755
                safe_unpack32(&count, buffer);
 
1756
                if(count != NO_VAL) {
 
1757
                        object_ptr->accounting_list =
 
1758
                                list_create(destroy_cluster_accounting_rec);
 
1759
                        for(i=0; i<count; i++) {
 
1760
                                unpack_cluster_accounting_rec(
 
1761
                                        (void *)&acct_info,
 
1762
                                        rpc_version, buffer);
 
1763
                                list_append(object_ptr->accounting_list,
 
1764
                                            acct_info);
 
1765
                        }
 
1766
                }
 
1767
 
 
1768
                safe_unpack16(&object_ptr->classification, buffer);
 
1769
                safe_unpackstr_xmalloc(&object_ptr->control_host,
 
1770
                                       &uint32_tmp, buffer);
 
1771
                safe_unpack32(&object_ptr->control_port, buffer);
 
1772
                safe_unpack32(&object_ptr->cpu_count, buffer);
 
1773
 
 
1774
                safe_unpackstr_xmalloc(&object_ptr->name, &uint32_tmp, buffer);
 
1775
                safe_unpackstr_xmalloc(&object_ptr->nodes, &uint32_tmp, buffer);
 
1776
 
 
1777
                if(unpack_acct_association_rec(
 
1778
                           (void **)&object_ptr->root_assoc, 
 
1779
                           rpc_version, buffer)
 
1780
                   == SLURM_ERROR)
 
1781
                        goto unpack_error;
 
1782
 
 
1783
                safe_unpack16(&object_ptr->rpc_version, buffer);
 
1784
        } else if(rpc_version >= 3) {
 
1785
                safe_unpack32(&count, buffer);
 
1786
                if(count != NO_VAL) {
 
1787
                        object_ptr->accounting_list =
 
1788
                                list_create(destroy_cluster_accounting_rec);
 
1789
                        for(i=0; i<count; i++) {
 
1790
                                unpack_cluster_accounting_rec(
 
1791
                                        (void *)&acct_info,
 
1792
                                        rpc_version, buffer);
 
1793
                                list_append(object_ptr->accounting_list,
 
1794
                                            acct_info);
 
1795
                        }
 
1796
                }
 
1797
 
 
1798
                safe_unpackstr_xmalloc(&object_ptr->control_host,
 
1799
                                       &uint32_tmp, buffer);
 
1800
                safe_unpack32(&object_ptr->control_port, buffer);
 
1801
 
 
1802
                safe_unpackstr_xmalloc(&object_ptr->name, &uint32_tmp, buffer);
 
1803
 
 
1804
                safe_unpack32(&count, buffer); /* for defunt valid_qos_list */
1687
1805
 
1688
1806
                if(unpack_acct_association_rec(
1689
1807
                           (void **)&object_ptr->root_assoc, 
1711
1829
                object_ptr->root_assoc = 
1712
1830
                        xmalloc(sizeof(acct_association_rec_t));
1713
1831
                init_acct_association_rec(object_ptr->root_assoc);
1714
 
                safe_unpack32(&object_ptr->root_assoc->fairshare, buffer);
 
1832
                safe_unpack32(&object_ptr->root_assoc->shares_raw, buffer);
1715
1833
                safe_unpack32((uint32_t *)&object_ptr->root_assoc->
1716
1834
                              max_cpu_mins_pj, buffer);
1717
1835
                safe_unpack32(&object_ptr->root_assoc->max_jobs, buffer);
1742
1860
                pack_time(0, buffer);
1743
1861
                return;
1744
1862
        }
1745
 
 
 
1863
        
1746
1864
        pack64(object->alloc_secs, buffer);
1747
1865
        pack32(object->id, buffer);
1748
 
        pack_time(object->period_start, buffer);
 
1866
        pack_time(object->period_start, buffer);                
1749
1867
}
1750
1868
 
1751
1869
extern int unpack_acct_accounting_rec(void **object, uint16_t rpc_version,
1755
1873
                xmalloc(sizeof(acct_accounting_rec_t));
1756
1874
        
1757
1875
        *object = object_ptr;
 
1876
        
1758
1877
        safe_unpack64(&object_ptr->alloc_secs, buffer);
1759
1878
        safe_unpack32(&object_ptr->id, buffer);
1760
 
        safe_unpack_time(&object_ptr->period_start, buffer);
1761
 
 
 
1879
        safe_unpack_time(&object_ptr->period_start, buffer);    
 
1880
                
1762
1881
        return SLURM_SUCCESS;
1763
1882
 
1764
1883
unpack_error:
1832
1951
                packstr(object->acct, buffer);
1833
1952
                packstr(object->cluster, buffer);
1834
1953
 
1835
 
                pack32(object->fairshare, buffer);
 
1954
                /* this used to be named fairshare to not have to redo
 
1955
                   the order of things just to be in alpha order we
 
1956
                   just renamed it and called it good */
 
1957
                pack32(object->shares_raw, buffer);
1836
1958
 
1837
1959
                pack64(object->grp_cpu_mins, buffer);
1838
1960
                pack32(object->grp_cpus, buffer);
1873
1995
                pack32(object->uid, buffer);
1874
1996
 
1875
1997
                packstr(object->user, buffer);  
1876
 
        } else if (rpc_version >= 3) {
 
1998
        } else if (rpc_version == 3) {
1877
1999
                if(!object) {
1878
2000
                        pack32(NO_VAL, buffer);
1879
2001
                        packnull(buffer);
1931
2053
                packstr(object->acct, buffer);
1932
2054
                packstr(object->cluster, buffer);
1933
2055
 
1934
 
                pack32(object->fairshare, buffer);
 
2056
                pack32(object->shares_raw, buffer);
1935
2057
 
1936
2058
                pack64(object->grp_cpu_mins, buffer);
1937
2059
                pack32(object->grp_cpus, buffer);
1971
2093
                pack32(object->rgt, buffer);
1972
2094
                pack32(object->uid, buffer);
1973
2095
 
1974
 
                pack32(object->used_shares, buffer);
 
2096
                /* used shares which is taken out in 4 */
 
2097
                pack32(0, buffer);
1975
2098
 
1976
2099
                packstr(object->user, buffer);  
1977
2100
        } else {
2019
2142
 
2020
2143
                packstr(object->acct, buffer);
2021
2144
                packstr(object->cluster, buffer);
2022
 
                pack32(object->fairshare, buffer);
 
2145
                pack32(object->shares_raw, buffer);
2023
2146
                pack32(object->id, buffer);
2024
2147
                pack32(object->lft, buffer);
2025
2148
                pack32(object->max_cpu_mins_pj, buffer);
2031
2154
                packstr(object->partition, buffer);
2032
2155
                pack32(object->rgt, buffer);
2033
2156
                pack32(object->uid, buffer);
2034
 
                pack32(object->used_shares, buffer);
 
2157
                /* used shares which is taken out in 4 */
 
2158
                pack32(0, buffer);
 
2159
 
2035
2160
                packstr(object->user, buffer);  
2036
2161
        } 
2037
2162
}
2071
2196
                safe_unpackstr_xmalloc(&object_ptr->cluster, &uint32_tmp,
2072
2197
                                       buffer);
2073
2198
 
2074
 
                safe_unpack32(&object_ptr->fairshare, buffer);
 
2199
                safe_unpack32(&object_ptr->shares_raw, buffer);
2075
2200
 
2076
2201
                safe_unpack64(&object_ptr->grp_cpu_mins, buffer);
2077
2202
                safe_unpack32(&object_ptr->grp_cpus, buffer);
2132
2257
                safe_unpackstr_xmalloc(&object_ptr->cluster, &uint32_tmp,
2133
2258
                                       buffer);
2134
2259
 
2135
 
                safe_unpack32(&object_ptr->fairshare, buffer);
 
2260
                safe_unpack32(&object_ptr->shares_raw, buffer);
2136
2261
 
2137
2262
                safe_unpack64(&object_ptr->grp_cpu_mins, buffer);
2138
2263
                safe_unpack32(&object_ptr->grp_cpus, buffer);
2172
2297
                safe_unpack32(&object_ptr->rgt, buffer);
2173
2298
                safe_unpack32(&object_ptr->uid, buffer);
2174
2299
 
2175
 
                safe_unpack32(&object_ptr->used_shares, buffer);
 
2300
                /* used shares which is taken out in 4 */
 
2301
                safe_unpack32(&uint32_tmp, buffer);
2176
2302
 
2177
2303
                safe_unpackstr_xmalloc(&object_ptr->user, &uint32_tmp, buffer);
2178
2304
        } else {
2194
2320
                safe_unpackstr_xmalloc(&object_ptr->cluster, &uint32_tmp,
2195
2321
                                       buffer);
2196
2322
 
2197
 
                safe_unpack32(&object_ptr->fairshare, buffer);
 
2323
                safe_unpack32(&object_ptr->shares_raw, buffer);
2198
2324
                safe_unpack32(&object_ptr->id, buffer);
2199
2325
                safe_unpack32(&object_ptr->lft, buffer);
2200
2326
 
2213
2339
                safe_unpack32(&object_ptr->rgt, buffer);
2214
2340
                safe_unpack32(&object_ptr->uid, buffer);
2215
2341
 
2216
 
                safe_unpack32(&object_ptr->used_shares, buffer);
 
2342
                /* used shares which is taken out in 4 */
 
2343
                safe_unpack32(&uint32_tmp, buffer);
2217
2344
 
2218
2345
                safe_unpackstr_xmalloc(&object_ptr->user, &uint32_tmp, buffer);
2219
2346
        } 
2233
2360
        uint32_t count = NO_VAL;
2234
2361
        char *tmp_info = NULL;
2235
2362
 
2236
 
        if(rpc_version >= 3) {
 
2363
        if(rpc_version >= 5) {
 
2364
                if(!object) {
 
2365
                        packnull(buffer);
 
2366
                        pack32(0, buffer);
 
2367
                        packnull(buffer);
 
2368
 
 
2369
                        pack64(NO_VAL, buffer);
 
2370
                        pack32(NO_VAL, buffer);
 
2371
                        pack32(NO_VAL, buffer);
 
2372
                        pack32(NO_VAL, buffer);
 
2373
                        pack32(NO_VAL, buffer);
 
2374
                        pack32(NO_VAL, buffer);
 
2375
 
 
2376
                        pack64(NO_VAL, buffer);
 
2377
                        pack32(NO_VAL, buffer);
 
2378
                        pack32(NO_VAL, buffer);
 
2379
                        pack32(NO_VAL, buffer);
 
2380
                        pack32(NO_VAL, buffer);
 
2381
                        pack32(NO_VAL, buffer);
 
2382
 
 
2383
                        packnull(buffer);
 
2384
 
 
2385
                        pack32(NO_VAL, buffer);
 
2386
                        pack32(NO_VAL, buffer);
 
2387
 
 
2388
                        pack32(0, buffer);
 
2389
 
 
2390
                        packdouble(NO_VAL, buffer);
 
2391
 
 
2392
                        pack32(NO_VAL, buffer);
 
2393
                        return;
 
2394
                }
 
2395
                packstr(object->description, buffer);   
 
2396
                pack32(object->id, buffer);
 
2397
 
 
2398
                pack64(object->grp_cpu_mins, buffer);
 
2399
                pack32(object->grp_cpus, buffer);
 
2400
                pack32(object->grp_jobs, buffer);
 
2401
                pack32(object->grp_nodes, buffer);
 
2402
                pack32(object->grp_submit_jobs, buffer);
 
2403
                pack32(object->grp_wall, buffer);
 
2404
 
 
2405
                pack64(object->max_cpu_mins_pu, buffer);
 
2406
                pack32(object->max_cpus_pu, buffer);
 
2407
                pack32(object->max_jobs_pu, buffer);
 
2408
                pack32(object->max_nodes_pu, buffer);
 
2409
                pack32(object->max_submit_jobs_pu, buffer);
 
2410
                pack32(object->max_wall_pu, buffer);
 
2411
 
 
2412
                packstr(object->name, buffer);  
 
2413
 
 
2414
                if(object->preemptee_list)
 
2415
                        count = list_count(object->preemptee_list);
 
2416
 
 
2417
                pack32(count, buffer);
 
2418
 
 
2419
                if(count && count != NO_VAL) {
 
2420
                        itr = list_iterator_create(object->preemptee_list);
 
2421
                        while((tmp_info = list_next(itr))) {
 
2422
                                packstr(tmp_info, buffer);
 
2423
                        }
 
2424
                        list_iterator_destroy(itr);
 
2425
                }
 
2426
                count = NO_VAL;
 
2427
                
 
2428
                if(object->preemptor_list)
 
2429
                        count = list_count(object->preemptor_list);
 
2430
 
 
2431
                pack32(count, buffer);
 
2432
 
 
2433
                if(count && count != NO_VAL) {
 
2434
                        itr = list_iterator_create(object->preemptor_list);
 
2435
                        while((tmp_info = list_next(itr))) {
 
2436
                                packstr(tmp_info, buffer);
 
2437
                        }
 
2438
                        list_iterator_destroy(itr);
 
2439
                }
 
2440
                count = NO_VAL;
 
2441
                
 
2442
                pack32(object->priority, buffer);
 
2443
                
 
2444
                packdouble(object->usage_factor, buffer);
 
2445
 
 
2446
                if(object->user_limit_list)
 
2447
                        count = list_count(object->user_limit_list);
 
2448
 
 
2449
                pack32(count, buffer);
 
2450
 
 
2451
                if(count && count != NO_VAL) {
 
2452
                        acct_used_limits_t *used_limits = NULL;
 
2453
                        itr = list_iterator_create(object->user_limit_list);
 
2454
                        while((used_limits = list_next(itr))) {
 
2455
                                pack_acct_used_limits(used_limits,
 
2456
                                                      rpc_version, buffer);
 
2457
                        }
 
2458
                        list_iterator_destroy(itr);
 
2459
                }
 
2460
                count = NO_VAL;
 
2461
        } else if(rpc_version >= 3) {
2237
2462
                if(!object) {
2238
2463
                        packnull(buffer);
2239
2464
                        pack32(0, buffer);
2352
2577
        
2353
2578
        init_acct_qos_rec(object_ptr);
2354
2579
 
2355
 
        if(rpc_version >= 3) {
 
2580
        if(rpc_version >= 5) {
 
2581
                safe_unpackstr_xmalloc(&object_ptr->description,
 
2582
                                       &uint32_tmp, buffer);
 
2583
                safe_unpack32(&object_ptr->id, buffer);
 
2584
 
 
2585
                safe_unpack64(&object_ptr->grp_cpu_mins, buffer);
 
2586
                safe_unpack32(&object_ptr->grp_cpus, buffer);
 
2587
                safe_unpack32(&object_ptr->grp_jobs, buffer);
 
2588
                safe_unpack32(&object_ptr->grp_nodes, buffer);
 
2589
                safe_unpack32(&object_ptr->grp_submit_jobs, buffer);
 
2590
                safe_unpack32(&object_ptr->grp_wall, buffer);
 
2591
 
 
2592
                safe_unpack64(&object_ptr->max_cpu_mins_pu, buffer);
 
2593
                safe_unpack32(&object_ptr->max_cpus_pu, buffer);
 
2594
                safe_unpack32(&object_ptr->max_jobs_pu, buffer);
 
2595
                safe_unpack32(&object_ptr->max_nodes_pu, buffer);
 
2596
                safe_unpack32(&object_ptr->max_submit_jobs_pu, buffer);
 
2597
                safe_unpack32(&object_ptr->max_wall_pu, buffer);
 
2598
 
 
2599
                safe_unpackstr_xmalloc(&object_ptr->name, &uint32_tmp, buffer);
 
2600
 
 
2601
                safe_unpack32(&count, buffer);
 
2602
                if(count != NO_VAL) {
 
2603
                        object_ptr->preemptee_list = 
 
2604
                                list_create(slurm_destroy_char);
 
2605
                        for(i=0; i<count; i++) {
 
2606
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
2607
                                                       buffer);
 
2608
                                list_append(object_ptr->preemptee_list,
 
2609
                                            tmp_info);
 
2610
                        }
 
2611
                }
 
2612
 
 
2613
                safe_unpack32(&count, buffer);
 
2614
                if(count != NO_VAL) {
 
2615
                        object_ptr->preemptor_list = 
 
2616
                                list_create(slurm_destroy_char);
 
2617
                        for(i=0; i<count; i++) {
 
2618
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
2619
                                                       buffer);
 
2620
                                list_append(object_ptr->preemptor_list,
 
2621
                                            tmp_info);
 
2622
                        }
 
2623
                }
 
2624
 
 
2625
                safe_unpack32(&object_ptr->priority, buffer);
 
2626
 
 
2627
                safe_unpackdouble(&object_ptr->usage_factor, buffer);
 
2628
 
 
2629
                safe_unpack32(&count, buffer);
 
2630
                if(count != NO_VAL) {
 
2631
                        void *used_limits = NULL;
 
2632
 
 
2633
                        object_ptr->user_limit_list = 
 
2634
                                list_create(slurm_destroy_char);
 
2635
                        for(i=0; i<count; i++) {
 
2636
                                unpack_acct_used_limits(&used_limits,
 
2637
                                                        rpc_version, buffer);
 
2638
                                list_append(object_ptr->user_limit_list,
 
2639
                                            used_limits);
 
2640
                        }
 
2641
                }
 
2642
 
 
2643
        } else if(rpc_version >= 3) {
2356
2644
                safe_unpackstr_xmalloc(&object_ptr->description,
2357
2645
                                       &uint32_tmp, buffer);
2358
2646
                safe_unpack32(&object_ptr->id, buffer);
2428
2716
        return SLURM_ERROR;
2429
2717
}
2430
2718
 
 
2719
extern void pack_acct_reservation_rec(void *in, uint16_t rpc_version,
 
2720
                                      Buf buffer)
 
2721
{
 
2722
        acct_reservation_rec_t *object = (acct_reservation_rec_t *)in;
 
2723
 
 
2724
        if(!object) {
 
2725
                pack64(0, buffer);
 
2726
                packnull(buffer);
 
2727
                packnull(buffer);
 
2728
                pack32((uint32_t)NO_VAL, buffer);
 
2729
                pack64(0, buffer);
 
2730
                pack16((uint16_t)NO_VAL, buffer);
 
2731
                pack32(0, buffer);
 
2732
                packnull(buffer);
 
2733
                packnull(buffer);
 
2734
                packnull(buffer);
 
2735
                pack_time(0, buffer);
 
2736
                pack_time(0, buffer);
 
2737
                pack_time(0, buffer);
 
2738
                return;
 
2739
        }
 
2740
        
 
2741
        pack64(object->alloc_secs, buffer);
 
2742
        packstr(object->assocs, buffer);
 
2743
        packstr(object->cluster, buffer);
 
2744
        pack32(object->cpus, buffer);
 
2745
        pack64(object->down_secs, buffer);
 
2746
        pack16(object->flags, buffer);
 
2747
        pack32(object->id, buffer);
 
2748
        packstr(object->name, buffer);
 
2749
        packstr(object->nodes, buffer);
 
2750
        packstr(object->node_inx, buffer);
 
2751
        pack_time(object->time_end, buffer);
 
2752
        pack_time(object->time_start, buffer);  
 
2753
        pack_time(object->time_start_prev, buffer);     
 
2754
}
 
2755
 
 
2756
extern int unpack_acct_reservation_rec(void **object, uint16_t rpc_version,
 
2757
                                      Buf buffer)
 
2758
{
 
2759
        uint32_t uint32_tmp;
 
2760
        acct_reservation_rec_t *object_ptr = 
 
2761
                xmalloc(sizeof(acct_reservation_rec_t));
 
2762
 
 
2763
        *object = object_ptr;
 
2764
 
 
2765
        safe_unpack64(&object_ptr->alloc_secs, buffer);
 
2766
        safe_unpackstr_xmalloc(&object_ptr->assocs, &uint32_tmp, buffer);
 
2767
        safe_unpackstr_xmalloc(&object_ptr->cluster, &uint32_tmp, buffer);
 
2768
        safe_unpack32(&object_ptr->cpus, buffer);
 
2769
        safe_unpack64(&object_ptr->down_secs, buffer);
 
2770
        safe_unpack16(&object_ptr->flags, buffer);
 
2771
        safe_unpack32(&object_ptr->id, buffer);
 
2772
        safe_unpackstr_xmalloc(&object_ptr->name, &uint32_tmp, buffer);
 
2773
        safe_unpackstr_xmalloc(&object_ptr->nodes, &uint32_tmp, buffer);
 
2774
        safe_unpackstr_xmalloc(&object_ptr->node_inx, &uint32_tmp, buffer);
 
2775
        safe_unpack_time(&object_ptr->time_end, buffer);
 
2776
        safe_unpack_time(&object_ptr->time_start, buffer);      
 
2777
        safe_unpack_time(&object_ptr->time_start_prev, buffer); 
 
2778
 
 
2779
        return SLURM_SUCCESS;
 
2780
 
 
2781
unpack_error:
 
2782
        destroy_acct_reservation_rec(object_ptr);
 
2783
        *object = NULL;
 
2784
        return SLURM_ERROR;
 
2785
}
 
2786
 
2431
2787
extern void pack_acct_txn_rec(void *in, uint16_t rpc_version, Buf buffer)
2432
2788
{
2433
2789
        acct_txn_rec_t *object = (acct_txn_rec_t *)in;  
3070
3426
        acct_cluster_cond_t *object = (acct_cluster_cond_t *)in;
3071
3427
        uint32_t count = NO_VAL;
3072
3428
 
3073
 
        if(!object) {
3074
 
                pack32(NO_VAL, buffer);
3075
 
                pack32(0, buffer);
3076
 
                pack32(0, buffer);
3077
 
                pack16(0, buffer);
3078
 
                pack16(0, buffer);
3079
 
                return;
3080
 
        }
3081
 
 
3082
 
        if(object->cluster_list)
3083
 
                count = list_count(object->cluster_list);
3084
 
        
3085
 
        pack32(count, buffer);
3086
 
                        
3087
 
        if(count && count != NO_VAL) {
3088
 
                itr = list_iterator_create(object->cluster_list);
3089
 
                while((tmp_info = list_next(itr))) {
3090
 
                        packstr(tmp_info, buffer);
3091
 
                }
3092
 
                list_iterator_destroy(itr);
3093
 
        }
3094
 
        count = NO_VAL;
3095
 
 
3096
 
        pack32(object->usage_end, buffer);
3097
 
        pack32(object->usage_start, buffer);
3098
 
 
3099
 
        pack16(object->with_usage, buffer);
3100
 
        pack16(object->with_deleted, buffer);
 
3429
        if(rpc_version >= 5) {
 
3430
                if(!object) {
 
3431
                        pack16(0, buffer);
 
3432
                        pack32(NO_VAL, buffer);
 
3433
                        pack_time(0, buffer);
 
3434
                        pack_time(0, buffer);
 
3435
                        pack16(0, buffer);
 
3436
                        pack16(0, buffer);
 
3437
                        return;
 
3438
                }
 
3439
 
 
3440
                pack16(object->classification, buffer);
 
3441
                
 
3442
                if(object->cluster_list)
 
3443
                        count = list_count(object->cluster_list);
 
3444
                
 
3445
                pack32(count, buffer);
 
3446
                
 
3447
                if(count && count != NO_VAL) {
 
3448
                        itr = list_iterator_create(object->cluster_list);
 
3449
                        while((tmp_info = list_next(itr))) {
 
3450
                                packstr(tmp_info, buffer);
 
3451
                        }
 
3452
                        list_iterator_destroy(itr);
 
3453
                }
 
3454
                count = NO_VAL;
 
3455
                
 
3456
                pack_time(object->usage_end, buffer);
 
3457
                pack_time(object->usage_start, buffer);
 
3458
                
 
3459
                pack16(object->with_usage, buffer);
 
3460
                pack16(object->with_deleted, buffer);
 
3461
        } else {
 
3462
                if(!object) {
 
3463
                        pack32(NO_VAL, buffer);
 
3464
                        pack32(0, buffer);
 
3465
                        pack32(0, buffer);
 
3466
                        pack16(0, buffer);
 
3467
                        pack16(0, buffer);
 
3468
                        return;
 
3469
                }
 
3470
                
 
3471
                if(object->cluster_list)
 
3472
                        count = list_count(object->cluster_list);
 
3473
                
 
3474
                pack32(count, buffer);
 
3475
                
 
3476
                if(count && count != NO_VAL) {
 
3477
                        itr = list_iterator_create(object->cluster_list);
 
3478
                        while((tmp_info = list_next(itr))) {
 
3479
                                packstr(tmp_info, buffer);
 
3480
                        }
 
3481
                        list_iterator_destroy(itr);
 
3482
                }
 
3483
                count = NO_VAL;
 
3484
                
 
3485
                pack32(object->usage_end, buffer);
 
3486
                pack32(object->usage_start, buffer);
 
3487
                
 
3488
                pack16(object->with_usage, buffer);
 
3489
                pack16(object->with_deleted, buffer);
 
3490
        } 
3101
3491
}
3102
3492
 
3103
3493
extern int unpack_acct_cluster_cond(void **object, uint16_t rpc_version, 
3110
3500
        char *tmp_info = NULL;
3111
3501
 
3112
3502
        *object = object_ptr;
3113
 
        safe_unpack32(&count, buffer);
3114
 
        if(count && count != NO_VAL) {
3115
 
                object_ptr->cluster_list = list_create(slurm_destroy_char);
3116
 
                for(i=0; i<count; i++) {
3117
 
                        safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp, buffer);
3118
 
                        list_append(object_ptr->cluster_list, tmp_info);
3119
 
                }
 
3503
 
 
3504
        if(rpc_version >= 5) {
 
3505
                safe_unpack16(&object_ptr->classification, buffer);
 
3506
                safe_unpack32(&count, buffer);
 
3507
                if(count && count != NO_VAL) {
 
3508
                        object_ptr->cluster_list =
 
3509
                                list_create(slurm_destroy_char);
 
3510
                        for(i=0; i<count; i++) {
 
3511
                                safe_unpackstr_xmalloc(&tmp_info,
 
3512
                                                       &uint32_tmp, buffer);
 
3513
                                list_append(object_ptr->cluster_list, tmp_info);
 
3514
                        }
 
3515
                }
 
3516
                safe_unpack_time(&object_ptr->usage_end, buffer);
 
3517
                safe_unpack_time(&object_ptr->usage_start, buffer);
 
3518
 
 
3519
                safe_unpack16(&object_ptr->with_usage, buffer);
 
3520
                safe_unpack16(&object_ptr->with_deleted, buffer);
 
3521
        } else {
 
3522
                safe_unpack32(&count, buffer);
 
3523
                if(count && count != NO_VAL) {
 
3524
                        object_ptr->cluster_list =
 
3525
                                list_create(slurm_destroy_char);
 
3526
                        for(i=0; i<count; i++) {
 
3527
                                safe_unpackstr_xmalloc(&tmp_info,
 
3528
                                                       &uint32_tmp, buffer);
 
3529
                                list_append(object_ptr->cluster_list, tmp_info);
 
3530
                        }
 
3531
                }
 
3532
                safe_unpack32(&uint32_tmp, buffer);
 
3533
                object_ptr->usage_end = uint32_tmp;
 
3534
                safe_unpack32(&uint32_tmp, buffer);
 
3535
                object_ptr->usage_start = uint32_tmp;
 
3536
 
 
3537
                safe_unpack16(&object_ptr->with_usage, buffer);
 
3538
                safe_unpack16(&object_ptr->with_deleted, buffer);
3120
3539
        }
3121
 
        safe_unpack32(&object_ptr->usage_end, buffer);
3122
 
        safe_unpack32(&object_ptr->usage_start, buffer);
3123
 
 
3124
 
        safe_unpack16(&object_ptr->with_usage, buffer);
3125
 
        safe_unpack16(&object_ptr->with_deleted, buffer);
3126
 
 
3127
3540
        return SLURM_SUCCESS;
3128
3541
 
3129
3542
unpack_error:
3141
3554
        ListIterator itr = NULL;
3142
3555
        acct_association_cond_t *object = (acct_association_cond_t *)in;
3143
3556
 
3144
 
        if(rpc_version >= 3) {
 
3557
        if(rpc_version >= 5) {
 
3558
                if(!object) {
 
3559
                        pack32(NO_VAL, buffer);
 
3560
                        pack32(NO_VAL, buffer);
 
3561
 
 
3562
                        pack32(NO_VAL, buffer);
 
3563
 
 
3564
                        pack32(NO_VAL, buffer);
 
3565
                        pack32(NO_VAL, buffer);
 
3566
                        pack32(NO_VAL, buffer);
 
3567
                        pack32(NO_VAL, buffer);
 
3568
                        pack32(NO_VAL, buffer);
 
3569
                        pack32(NO_VAL, buffer);
 
3570
 
 
3571
                        pack32(NO_VAL, buffer);
 
3572
 
 
3573
                        pack32(NO_VAL, buffer);
 
3574
                        pack32(NO_VAL, buffer);
 
3575
                        pack32(NO_VAL, buffer);
 
3576
                        pack32(NO_VAL, buffer);
 
3577
                        pack32(NO_VAL, buffer);
 
3578
                        pack32(NO_VAL, buffer);
 
3579
 
 
3580
                        pack32(NO_VAL, buffer);
 
3581
                        pack32(NO_VAL, buffer);
 
3582
                        
 
3583
                        pack32(NO_VAL, buffer);
 
3584
 
 
3585
                        pack_time(0, buffer);
 
3586
                        pack_time(0, buffer);
 
3587
 
 
3588
                        pack32(NO_VAL, buffer);
 
3589
 
 
3590
                        pack16(0, buffer);
 
3591
                        pack16(0, buffer);
 
3592
                        pack16(0, buffer);
 
3593
                        pack16(0, buffer);
 
3594
                        pack16(0, buffer);
 
3595
                        pack16(0, buffer);
 
3596
                        return;
 
3597
                }
 
3598
 
 
3599
                if(object->acct_list)
 
3600
                        count = list_count(object->acct_list);
 
3601
        
 
3602
                pack32(count, buffer);
 
3603
                if(count && count != NO_VAL) {
 
3604
                        itr = list_iterator_create(object->acct_list);
 
3605
                        while((tmp_info = list_next(itr))) {
 
3606
                                packstr(tmp_info, buffer);
 
3607
                        }
 
3608
                        list_iterator_destroy(itr);
 
3609
                }
 
3610
                count = NO_VAL;
 
3611
 
 
3612
                if(object->cluster_list)
 
3613
                        count = list_count(object->cluster_list);
 
3614
        
 
3615
                pack32(count, buffer);
 
3616
                if(count && count != NO_VAL) {
 
3617
                        itr = list_iterator_create(object->cluster_list);
 
3618
                        while((tmp_info = list_next(itr))) {
 
3619
                                packstr(tmp_info, buffer);
 
3620
                        }
 
3621
                        list_iterator_destroy(itr);
 
3622
                }
 
3623
                count = NO_VAL;
 
3624
 
 
3625
                if(object->fairshare_list)
 
3626
                        count = list_count(object->fairshare_list);
 
3627
        
 
3628
                pack32(count, buffer);
 
3629
                if(count && count != NO_VAL) {
 
3630
                        itr = list_iterator_create(object->fairshare_list);
 
3631
                        while((tmp_info = list_next(itr))) {
 
3632
                                packstr(tmp_info, buffer);
 
3633
                        }
 
3634
                        list_iterator_destroy(itr);
 
3635
                }
 
3636
                count = NO_VAL;
 
3637
 
 
3638
                if(object->grp_cpu_mins_list)
 
3639
                        count = list_count(object->grp_cpu_mins_list);
 
3640
        
 
3641
                pack32(count, buffer);
 
3642
                if(count && count != NO_VAL) {
 
3643
                        itr = list_iterator_create(object->grp_cpu_mins_list);
 
3644
                        while((tmp_info = list_next(itr))) {
 
3645
                                packstr(tmp_info, buffer);
 
3646
                        }
 
3647
                        list_iterator_destroy(itr);
 
3648
                }
 
3649
                count = NO_VAL;
 
3650
 
 
3651
                if(object->grp_cpus_list)
 
3652
                        count = list_count(object->grp_cpus_list);
 
3653
        
 
3654
                pack32(count, buffer);
 
3655
                if(count && count != NO_VAL) {
 
3656
                        itr = list_iterator_create(object->grp_cpus_list);
 
3657
                        while((tmp_info = list_next(itr))) {
 
3658
                                packstr(tmp_info, buffer);
 
3659
                        }
 
3660
                        list_iterator_destroy(itr);
 
3661
                }
 
3662
                count = NO_VAL;
 
3663
 
 
3664
                if(object->grp_jobs_list)
 
3665
                        count = list_count(object->grp_jobs_list);
 
3666
        
 
3667
                pack32(count, buffer);
 
3668
                if(count && count != NO_VAL) {
 
3669
                        itr = list_iterator_create(object->grp_jobs_list);
 
3670
                        while((tmp_info = list_next(itr))) {
 
3671
                                packstr(tmp_info, buffer);
 
3672
                        }
 
3673
                        list_iterator_destroy(itr);
 
3674
                }
 
3675
                count = NO_VAL;
 
3676
 
 
3677
                if(object->grp_nodes_list)
 
3678
                        count = list_count(object->grp_nodes_list);
 
3679
        
 
3680
                pack32(count, buffer);
 
3681
                if(count && count != NO_VAL) {
 
3682
                        itr = list_iterator_create(object->grp_nodes_list);
 
3683
                        while((tmp_info = list_next(itr))) {
 
3684
                                packstr(tmp_info, buffer);
 
3685
                        }
 
3686
                        list_iterator_destroy(itr);
 
3687
                }
 
3688
                count = NO_VAL;
 
3689
 
 
3690
                if(object->grp_submit_jobs_list)
 
3691
                        count = list_count(object->grp_submit_jobs_list);
 
3692
        
 
3693
                pack32(count, buffer);
 
3694
                if(count && count != NO_VAL) {
 
3695
                        itr = list_iterator_create(
 
3696
                                object->grp_submit_jobs_list);
 
3697
                        while((tmp_info = list_next(itr))) {
 
3698
                                packstr(tmp_info, buffer);
 
3699
                        }
 
3700
                        list_iterator_destroy(itr);
 
3701
                }
 
3702
                count = NO_VAL;
 
3703
 
 
3704
                if(object->grp_wall_list)
 
3705
                        count = list_count(object->grp_wall_list);
 
3706
        
 
3707
                pack32(count, buffer);
 
3708
                if(count && count != NO_VAL) {
 
3709
                        itr = list_iterator_create(object->grp_wall_list);
 
3710
                        while((tmp_info = list_next(itr))) {
 
3711
                                packstr(tmp_info, buffer);
 
3712
                        }
 
3713
                        list_iterator_destroy(itr);
 
3714
                }
 
3715
                count = NO_VAL;
 
3716
 
 
3717
                if(object->id_list)
 
3718
                        count = list_count(object->id_list);
 
3719
        
 
3720
                pack32(count, buffer);
 
3721
                if(count && count != NO_VAL) {
 
3722
                        itr = list_iterator_create(object->id_list);
 
3723
                        while((tmp_info = list_next(itr))) {
 
3724
                                packstr(tmp_info, buffer);
 
3725
                        }
 
3726
                }
 
3727
                count = NO_VAL;
 
3728
 
 
3729
                if(object->max_cpu_mins_pj_list)
 
3730
                        count = list_count(object->max_cpu_mins_pj_list);
 
3731
        
 
3732
                pack32(count, buffer);
 
3733
                if(count && count != NO_VAL) {
 
3734
                        itr = list_iterator_create(
 
3735
                                object->max_cpu_mins_pj_list);
 
3736
                        while((tmp_info = list_next(itr))) {
 
3737
                                packstr(tmp_info, buffer);
 
3738
                        }
 
3739
                        list_iterator_destroy(itr);
 
3740
                }
 
3741
                count = NO_VAL;
 
3742
                if(object->max_cpus_pj_list)
 
3743
                        count = list_count(object->max_cpus_pj_list);
 
3744
        
 
3745
                pack32(count, buffer);
 
3746
                if(count && count != NO_VAL) {
 
3747
                        itr = list_iterator_create(object->max_cpus_pj_list);
 
3748
                        while((tmp_info = list_next(itr))) {
 
3749
                                packstr(tmp_info, buffer);
 
3750
                        }
 
3751
                        list_iterator_destroy(itr);
 
3752
                }
 
3753
                count = NO_VAL;
 
3754
                if(object->max_jobs_list)
 
3755
                        count = list_count(object->max_jobs_list);
 
3756
        
 
3757
                pack32(count, buffer);
 
3758
                if(count && count != NO_VAL) {
 
3759
                        itr = list_iterator_create(object->max_jobs_list);
 
3760
                        while((tmp_info = list_next(itr))) {
 
3761
                                packstr(tmp_info, buffer);
 
3762
                        }
 
3763
                        list_iterator_destroy(itr);
 
3764
                }
 
3765
                count = NO_VAL;
 
3766
                if(object->max_nodes_pj_list)
 
3767
                        count = list_count(object->max_nodes_pj_list);
 
3768
        
 
3769
                pack32(count, buffer);
 
3770
                if(count && count != NO_VAL) {
 
3771
                        itr = list_iterator_create(object->max_nodes_pj_list);
 
3772
                        while((tmp_info = list_next(itr))) {
 
3773
                                packstr(tmp_info, buffer);
 
3774
                        }
 
3775
                        list_iterator_destroy(itr);
 
3776
                }
 
3777
                count = NO_VAL;
 
3778
                if(object->max_submit_jobs_list)
 
3779
                        count = list_count(object->max_submit_jobs_list);
 
3780
        
 
3781
                pack32(count, buffer);
 
3782
                if(count && count != NO_VAL) {
 
3783
                        itr = list_iterator_create(
 
3784
                                object->max_submit_jobs_list);
 
3785
                        while((tmp_info = list_next(itr))) {
 
3786
                                packstr(tmp_info, buffer);
 
3787
                        }
 
3788
                        list_iterator_destroy(itr);
 
3789
                }
 
3790
                count = NO_VAL;
 
3791
                if(object->max_wall_pj_list)
 
3792
                        count = list_count(object->max_wall_pj_list);
 
3793
        
 
3794
                pack32(count, buffer);
 
3795
                if(count && count != NO_VAL) {
 
3796
                        itr = list_iterator_create(object->max_wall_pj_list);
 
3797
                        while((tmp_info = list_next(itr))) {
 
3798
                                packstr(tmp_info, buffer);
 
3799
                        }
 
3800
                        list_iterator_destroy(itr);
 
3801
                }
 
3802
                count = NO_VAL;
 
3803
        
 
3804
                if(object->partition_list)
 
3805
                        count = list_count(object->partition_list);
 
3806
        
 
3807
                pack32(count, buffer);
 
3808
                if(count && count != NO_VAL) {
 
3809
                        itr = list_iterator_create(object->partition_list);
 
3810
                        while((tmp_info = list_next(itr))) {
 
3811
                                packstr(tmp_info, buffer);
 
3812
                        }
 
3813
                        list_iterator_destroy(itr);
 
3814
                }
 
3815
                count = NO_VAL;
 
3816
 
 
3817
                if(object->parent_acct_list)
 
3818
                        count = list_count(object->parent_acct_list);
 
3819
        
 
3820
                pack32(count, buffer);
 
3821
                if(count && count != NO_VAL) {
 
3822
                        itr = list_iterator_create(object->parent_acct_list);
 
3823
                        while((tmp_info = list_next(itr))) {
 
3824
                                packstr(tmp_info, buffer);
 
3825
                        }
 
3826
                        list_iterator_destroy(itr);
 
3827
                }
 
3828
                count = NO_VAL;
 
3829
 
 
3830
                if(object->qos_list)
 
3831
                        count = list_count(object->qos_list);
 
3832
 
 
3833
                pack32(count, buffer);
 
3834
 
 
3835
                if(count && count != NO_VAL) {
 
3836
                        itr = list_iterator_create(object->qos_list);
 
3837
                        while((tmp_info = list_next(itr))) {
 
3838
                                packstr(tmp_info, buffer);
 
3839
                        }
 
3840
                        list_iterator_destroy(itr);
 
3841
                }
 
3842
                count = NO_VAL;
 
3843
 
 
3844
                pack_time(object->usage_end, buffer);
 
3845
                pack_time(object->usage_start, buffer);
 
3846
 
 
3847
                if(object->user_list)
 
3848
                        count = list_count(object->user_list);
 
3849
        
 
3850
                pack32(count, buffer);
 
3851
                if(count && count != NO_VAL) {
 
3852
                        itr = list_iterator_create(object->user_list);
 
3853
                        while((tmp_info = list_next(itr))) {
 
3854
                                packstr(tmp_info, buffer);
 
3855
                        }
 
3856
                        list_iterator_destroy(itr);
 
3857
                }
 
3858
                count = NO_VAL;
 
3859
 
 
3860
                pack16(object->with_usage, buffer);
 
3861
                pack16(object->with_deleted, buffer);
 
3862
                pack16(object->with_raw_qos, buffer);
 
3863
                pack16(object->with_sub_accts, buffer);
 
3864
                pack16(object->without_parent_info, buffer);
 
3865
                pack16(object->without_parent_limits, buffer);
 
3866
        } else if(rpc_version >= 3) {
3145
3867
                if(!object) {
3146
3868
                        pack32(NO_VAL, buffer);
3147
3869
                        pack32(NO_VAL, buffer);
3598
4320
        char *tmp_info = NULL;
3599
4321
        *object = object_ptr;
3600
4322
 
3601
 
        if(rpc_version >= 3) {
3602
 
                safe_unpack32(&count, buffer);
3603
 
                if(count != NO_VAL) {
3604
 
                        object_ptr->acct_list =
3605
 
                                list_create(slurm_destroy_char);
3606
 
                        for(i=0; i<count; i++) {
3607
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
3608
 
                                                       buffer);
3609
 
                                list_append(object_ptr->acct_list, tmp_info);
3610
 
                        }
3611
 
                }
3612
 
                safe_unpack32(&count, buffer);
3613
 
                if(count != NO_VAL) {
3614
 
                        object_ptr->cluster_list = 
3615
 
                                list_create(slurm_destroy_char);
3616
 
                        for(i=0; i<count; i++) {
3617
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
3618
 
                                                       buffer);
3619
 
                                list_append(object_ptr->cluster_list, 
3620
 
                                            tmp_info);
3621
 
                        }
3622
 
                }
3623
 
 
3624
 
                safe_unpack32(&count, buffer);
3625
 
                if(count != NO_VAL) {
3626
 
                        object_ptr->fairshare_list = 
3627
 
                                list_create(slurm_destroy_char);
3628
 
                        for(i=0; i<count; i++) {
3629
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
3630
 
                                                       buffer);
3631
 
                                list_append(object_ptr->fairshare_list, 
3632
 
                                            tmp_info);
3633
 
                        }
3634
 
                }
3635
 
 
3636
 
                safe_unpack32(&count, buffer);
3637
 
                if(count != NO_VAL) {
3638
 
                        object_ptr->grp_cpu_mins_list = 
3639
 
                                list_create(slurm_destroy_char);
3640
 
                        for(i=0; i<count; i++) {
3641
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
3642
 
                                                       buffer);
3643
 
                                list_append(object_ptr->grp_cpu_mins_list, 
3644
 
                                            tmp_info);
3645
 
                        }
3646
 
                }
3647
 
                safe_unpack32(&count, buffer);
3648
 
                if(count != NO_VAL) {
3649
 
                        object_ptr->grp_cpus_list = 
3650
 
                                list_create(slurm_destroy_char);
3651
 
                        for(i=0; i<count; i++) {
3652
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
3653
 
                                                       buffer);
3654
 
                                list_append(object_ptr->grp_cpus_list, 
3655
 
                                            tmp_info);
3656
 
                        }
3657
 
                }
3658
 
                safe_unpack32(&count, buffer);
3659
 
                if(count != NO_VAL) {
3660
 
                        object_ptr->grp_jobs_list = 
3661
 
                                list_create(slurm_destroy_char);
3662
 
                        for(i=0; i<count; i++) {
3663
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
3664
 
                                                       buffer);
3665
 
                                list_append(object_ptr->grp_jobs_list, 
3666
 
                                            tmp_info);
3667
 
                        }
3668
 
                }
3669
 
                safe_unpack32(&count, buffer);
3670
 
                if(count != NO_VAL) {
3671
 
                        object_ptr->grp_nodes_list = 
3672
 
                                list_create(slurm_destroy_char);
3673
 
                        for(i=0; i<count; i++) {
3674
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
3675
 
                                                       buffer);
3676
 
                                list_append(object_ptr->grp_nodes_list,
3677
 
                                            tmp_info);
3678
 
                        }
3679
 
                }
3680
 
                safe_unpack32(&count, buffer);
3681
 
                if(count != NO_VAL) {
3682
 
                        object_ptr->grp_submit_jobs_list = 
3683
 
                                list_create(slurm_destroy_char);
3684
 
                        for(i=0; i<count; i++) {
3685
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
3686
 
                                                       buffer);
3687
 
                                list_append(object_ptr->grp_submit_jobs_list, 
3688
 
                                            tmp_info);
3689
 
                        }
3690
 
                }
3691
 
                safe_unpack32(&count, buffer);
3692
 
                if(count != NO_VAL) {
3693
 
                        object_ptr->grp_wall_list = 
3694
 
                                list_create(slurm_destroy_char);
3695
 
                        for(i=0; i<count; i++) {
3696
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
3697
 
                                                       buffer);
3698
 
                                list_append(object_ptr->grp_wall_list, 
3699
 
                                            tmp_info);
3700
 
                        }
3701
 
                }
3702
 
 
3703
 
                safe_unpack32(&count, buffer);
3704
 
                if(count != NO_VAL) {
3705
 
                        object_ptr->id_list = list_create(slurm_destroy_char);
3706
 
                        for(i=0; i<count; i++) {
3707
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp, 
3708
 
                                                       buffer);
3709
 
                                list_append(object_ptr->id_list, tmp_info);
3710
 
                        }
3711
 
                }
3712
 
        
3713
 
                safe_unpack32(&count, buffer);
3714
 
                if(count != NO_VAL) {
3715
 
                        object_ptr->max_cpu_mins_pj_list = 
3716
 
                                list_create(slurm_destroy_char);
3717
 
                        for(i=0; i<count; i++) {
3718
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
3719
 
                                                       buffer);
3720
 
                                list_append(object_ptr->max_cpu_mins_pj_list,
3721
 
                                            tmp_info);
3722
 
                        }
3723
 
                }
3724
 
                safe_unpack32(&count, buffer);
3725
 
                if(count != NO_VAL) {
3726
 
                        object_ptr->max_cpus_pj_list = 
3727
 
                                list_create(slurm_destroy_char);
3728
 
                        for(i=0; i<count; i++) {
3729
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
3730
 
                                                       buffer);
3731
 
                                list_append(object_ptr->max_cpus_pj_list,
3732
 
                                            tmp_info);
3733
 
                        }
3734
 
                }
3735
 
                safe_unpack32(&count, buffer);
3736
 
                if(count != NO_VAL) {
3737
 
                        object_ptr->max_jobs_list = 
3738
 
                                list_create(slurm_destroy_char);
3739
 
                        for(i=0; i<count; i++) {
3740
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
3741
 
                                                       buffer);
3742
 
                                list_append(object_ptr->max_jobs_list,
3743
 
                                            tmp_info);
3744
 
                        }
3745
 
                }
3746
 
                safe_unpack32(&count, buffer);
3747
 
                if(count != NO_VAL) {
3748
 
                        object_ptr->max_nodes_pj_list = 
3749
 
                                list_create(slurm_destroy_char);
3750
 
                        for(i=0; i<count; i++) {
3751
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
3752
 
                                                       buffer);
3753
 
                                list_append(object_ptr->max_nodes_pj_list,
3754
 
                                            tmp_info);
3755
 
                        }
3756
 
                }
3757
 
                safe_unpack32(&count, buffer);
3758
 
                if(count != NO_VAL) {
3759
 
                        object_ptr->max_submit_jobs_list = 
3760
 
                                list_create(slurm_destroy_char);
3761
 
                        for(i=0; i<count; i++) {
3762
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
3763
 
                                                       buffer);
3764
 
                                list_append(object_ptr->max_submit_jobs_list, 
3765
 
                                            tmp_info);
3766
 
                        }
3767
 
                }
3768
 
                safe_unpack32(&count, buffer);
3769
 
                if(count != NO_VAL) {
3770
 
                        object_ptr->max_wall_pj_list = 
3771
 
                                list_create(slurm_destroy_char);
3772
 
                        for(i=0; i<count; i++) {
3773
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
3774
 
                                                       buffer);
3775
 
                                list_append(object_ptr->max_wall_pj_list,
3776
 
                                            tmp_info);
3777
 
                        }
3778
 
                }
3779
 
 
3780
 
                safe_unpack32(&count, buffer);
3781
 
                if(count != NO_VAL) {
3782
 
                        object_ptr->partition_list = 
3783
 
                                list_create(slurm_destroy_char);
3784
 
                        for(i=0; i<count; i++) {
3785
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
3786
 
                                                       buffer);
3787
 
                                list_append(object_ptr->partition_list,
3788
 
                                            tmp_info);
3789
 
                        }
3790
 
                }
3791
 
 
3792
 
                safe_unpack32(&count, buffer);
3793
 
                if(count != NO_VAL) {
3794
 
                        object_ptr->parent_acct_list = 
3795
 
                                list_create(slurm_destroy_char);
3796
 
                        for(i=0; i<count; i++) {
3797
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
3798
 
                                                       buffer);
3799
 
                                list_append(object_ptr->parent_acct_list,
3800
 
                                            tmp_info);
3801
 
                        }
3802
 
                }
3803
 
 
3804
 
                safe_unpack32(&count, buffer);
3805
 
                if(count != NO_VAL) {
3806
 
                        object_ptr->qos_list = list_create(slurm_destroy_char);
3807
 
                        for(i=0; i<count; i++) {
3808
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
3809
 
                                                       buffer);
3810
 
                                list_append(object_ptr->qos_list, tmp_info);
3811
 
                        }
3812
 
                }
3813
 
 
3814
 
                safe_unpack32(&object_ptr->usage_end, buffer);
3815
 
                safe_unpack32(&object_ptr->usage_start, buffer);
 
4323
        if(rpc_version >= 5) {
 
4324
                safe_unpack32(&count, buffer);
 
4325
                if(count != NO_VAL) {
 
4326
                        object_ptr->acct_list =
 
4327
                                list_create(slurm_destroy_char);
 
4328
                        for(i=0; i<count; i++) {
 
4329
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4330
                                                       buffer);
 
4331
                                list_append(object_ptr->acct_list, tmp_info);
 
4332
                        }
 
4333
                }
 
4334
                safe_unpack32(&count, buffer);
 
4335
                if(count != NO_VAL) {
 
4336
                        object_ptr->cluster_list = 
 
4337
                                list_create(slurm_destroy_char);
 
4338
                        for(i=0; i<count; i++) {
 
4339
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4340
                                                       buffer);
 
4341
                                list_append(object_ptr->cluster_list, 
 
4342
                                            tmp_info);
 
4343
                        }
 
4344
                }
 
4345
 
 
4346
                safe_unpack32(&count, buffer);
 
4347
                if(count != NO_VAL) {
 
4348
                        object_ptr->fairshare_list = 
 
4349
                                list_create(slurm_destroy_char);
 
4350
                        for(i=0; i<count; i++) {
 
4351
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4352
                                                       buffer);
 
4353
                                list_append(object_ptr->fairshare_list, 
 
4354
                                            tmp_info);
 
4355
                        }
 
4356
                }
 
4357
 
 
4358
                safe_unpack32(&count, buffer);
 
4359
                if(count != NO_VAL) {
 
4360
                        object_ptr->grp_cpu_mins_list = 
 
4361
                                list_create(slurm_destroy_char);
 
4362
                        for(i=0; i<count; i++) {
 
4363
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4364
                                                       buffer);
 
4365
                                list_append(object_ptr->grp_cpu_mins_list, 
 
4366
                                            tmp_info);
 
4367
                        }
 
4368
                }
 
4369
                safe_unpack32(&count, buffer);
 
4370
                if(count != NO_VAL) {
 
4371
                        object_ptr->grp_cpus_list = 
 
4372
                                list_create(slurm_destroy_char);
 
4373
                        for(i=0; i<count; i++) {
 
4374
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4375
                                                       buffer);
 
4376
                                list_append(object_ptr->grp_cpus_list, 
 
4377
                                            tmp_info);
 
4378
                        }
 
4379
                }
 
4380
                safe_unpack32(&count, buffer);
 
4381
                if(count != NO_VAL) {
 
4382
                        object_ptr->grp_jobs_list = 
 
4383
                                list_create(slurm_destroy_char);
 
4384
                        for(i=0; i<count; i++) {
 
4385
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4386
                                                       buffer);
 
4387
                                list_append(object_ptr->grp_jobs_list, 
 
4388
                                            tmp_info);
 
4389
                        }
 
4390
                }
 
4391
                safe_unpack32(&count, buffer);
 
4392
                if(count != NO_VAL) {
 
4393
                        object_ptr->grp_nodes_list = 
 
4394
                                list_create(slurm_destroy_char);
 
4395
                        for(i=0; i<count; i++) {
 
4396
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4397
                                                       buffer);
 
4398
                                list_append(object_ptr->grp_nodes_list,
 
4399
                                            tmp_info);
 
4400
                        }
 
4401
                }
 
4402
                safe_unpack32(&count, buffer);
 
4403
                if(count != NO_VAL) {
 
4404
                        object_ptr->grp_submit_jobs_list = 
 
4405
                                list_create(slurm_destroy_char);
 
4406
                        for(i=0; i<count; i++) {
 
4407
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4408
                                                       buffer);
 
4409
                                list_append(object_ptr->grp_submit_jobs_list, 
 
4410
                                            tmp_info);
 
4411
                        }
 
4412
                }
 
4413
                safe_unpack32(&count, buffer);
 
4414
                if(count != NO_VAL) {
 
4415
                        object_ptr->grp_wall_list = 
 
4416
                                list_create(slurm_destroy_char);
 
4417
                        for(i=0; i<count; i++) {
 
4418
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4419
                                                       buffer);
 
4420
                                list_append(object_ptr->grp_wall_list, 
 
4421
                                            tmp_info);
 
4422
                        }
 
4423
                }
 
4424
 
 
4425
                safe_unpack32(&count, buffer);
 
4426
                if(count != NO_VAL) {
 
4427
                        object_ptr->id_list = list_create(slurm_destroy_char);
 
4428
                        for(i=0; i<count; i++) {
 
4429
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp, 
 
4430
                                                       buffer);
 
4431
                                list_append(object_ptr->id_list, tmp_info);
 
4432
                        }
 
4433
                }
 
4434
        
 
4435
                safe_unpack32(&count, buffer);
 
4436
                if(count != NO_VAL) {
 
4437
                        object_ptr->max_cpu_mins_pj_list = 
 
4438
                                list_create(slurm_destroy_char);
 
4439
                        for(i=0; i<count; i++) {
 
4440
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4441
                                                       buffer);
 
4442
                                list_append(object_ptr->max_cpu_mins_pj_list,
 
4443
                                            tmp_info);
 
4444
                        }
 
4445
                }
 
4446
                safe_unpack32(&count, buffer);
 
4447
                if(count != NO_VAL) {
 
4448
                        object_ptr->max_cpus_pj_list = 
 
4449
                                list_create(slurm_destroy_char);
 
4450
                        for(i=0; i<count; i++) {
 
4451
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4452
                                                       buffer);
 
4453
                                list_append(object_ptr->max_cpus_pj_list,
 
4454
                                            tmp_info);
 
4455
                        }
 
4456
                }
 
4457
                safe_unpack32(&count, buffer);
 
4458
                if(count != NO_VAL) {
 
4459
                        object_ptr->max_jobs_list = 
 
4460
                                list_create(slurm_destroy_char);
 
4461
                        for(i=0; i<count; i++) {
 
4462
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4463
                                                       buffer);
 
4464
                                list_append(object_ptr->max_jobs_list,
 
4465
                                            tmp_info);
 
4466
                        }
 
4467
                }
 
4468
                safe_unpack32(&count, buffer);
 
4469
                if(count != NO_VAL) {
 
4470
                        object_ptr->max_nodes_pj_list = 
 
4471
                                list_create(slurm_destroy_char);
 
4472
                        for(i=0; i<count; i++) {
 
4473
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4474
                                                       buffer);
 
4475
                                list_append(object_ptr->max_nodes_pj_list,
 
4476
                                            tmp_info);
 
4477
                        }
 
4478
                }
 
4479
                safe_unpack32(&count, buffer);
 
4480
                if(count != NO_VAL) {
 
4481
                        object_ptr->max_submit_jobs_list = 
 
4482
                                list_create(slurm_destroy_char);
 
4483
                        for(i=0; i<count; i++) {
 
4484
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4485
                                                       buffer);
 
4486
                                list_append(object_ptr->max_submit_jobs_list, 
 
4487
                                            tmp_info);
 
4488
                        }
 
4489
                }
 
4490
                safe_unpack32(&count, buffer);
 
4491
                if(count != NO_VAL) {
 
4492
                        object_ptr->max_wall_pj_list = 
 
4493
                                list_create(slurm_destroy_char);
 
4494
                        for(i=0; i<count; i++) {
 
4495
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4496
                                                       buffer);
 
4497
                                list_append(object_ptr->max_wall_pj_list,
 
4498
                                            tmp_info);
 
4499
                        }
 
4500
                }
 
4501
 
 
4502
                safe_unpack32(&count, buffer);
 
4503
                if(count != NO_VAL) {
 
4504
                        object_ptr->partition_list = 
 
4505
                                list_create(slurm_destroy_char);
 
4506
                        for(i=0; i<count; i++) {
 
4507
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4508
                                                       buffer);
 
4509
                                list_append(object_ptr->partition_list,
 
4510
                                            tmp_info);
 
4511
                        }
 
4512
                }
 
4513
 
 
4514
                safe_unpack32(&count, buffer);
 
4515
                if(count != NO_VAL) {
 
4516
                        object_ptr->parent_acct_list = 
 
4517
                                list_create(slurm_destroy_char);
 
4518
                        for(i=0; i<count; i++) {
 
4519
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4520
                                                       buffer);
 
4521
                                list_append(object_ptr->parent_acct_list,
 
4522
                                            tmp_info);
 
4523
                        }
 
4524
                }
 
4525
 
 
4526
                safe_unpack32(&count, buffer);
 
4527
                if(count != NO_VAL) {
 
4528
                        object_ptr->qos_list = list_create(slurm_destroy_char);
 
4529
                        for(i=0; i<count; i++) {
 
4530
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4531
                                                       buffer);
 
4532
                                list_append(object_ptr->qos_list, tmp_info);
 
4533
                        }
 
4534
                }
 
4535
 
 
4536
                safe_unpack_time(&object_ptr->usage_end, buffer);
 
4537
                safe_unpack_time(&object_ptr->usage_start, buffer);
 
4538
 
 
4539
                safe_unpack32(&count, buffer);
 
4540
                if(count != NO_VAL) {
 
4541
                        object_ptr->user_list = 
 
4542
                                list_create(slurm_destroy_char);
 
4543
                        for(i=0; i<count; i++) {
 
4544
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4545
                                                       buffer);
 
4546
                                list_append(object_ptr->user_list, tmp_info);
 
4547
                        }
 
4548
                }
 
4549
 
 
4550
                safe_unpack16(&object_ptr->with_usage, buffer);
 
4551
                safe_unpack16(&object_ptr->with_deleted, buffer);
 
4552
                safe_unpack16(&object_ptr->with_raw_qos, buffer);
 
4553
                safe_unpack16(&object_ptr->with_sub_accts, buffer);
 
4554
                safe_unpack16(&object_ptr->without_parent_info, buffer);
 
4555
                safe_unpack16(&object_ptr->without_parent_limits, buffer);
 
4556
        } else if(rpc_version >= 3) {
 
4557
                safe_unpack32(&count, buffer);
 
4558
                if(count != NO_VAL) {
 
4559
                        object_ptr->acct_list =
 
4560
                                list_create(slurm_destroy_char);
 
4561
                        for(i=0; i<count; i++) {
 
4562
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4563
                                                       buffer);
 
4564
                                list_append(object_ptr->acct_list, tmp_info);
 
4565
                        }
 
4566
                }
 
4567
                safe_unpack32(&count, buffer);
 
4568
                if(count != NO_VAL) {
 
4569
                        object_ptr->cluster_list = 
 
4570
                                list_create(slurm_destroy_char);
 
4571
                        for(i=0; i<count; i++) {
 
4572
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4573
                                                       buffer);
 
4574
                                list_append(object_ptr->cluster_list, 
 
4575
                                            tmp_info);
 
4576
                        }
 
4577
                }
 
4578
 
 
4579
                safe_unpack32(&count, buffer);
 
4580
                if(count != NO_VAL) {
 
4581
                        object_ptr->fairshare_list = 
 
4582
                                list_create(slurm_destroy_char);
 
4583
                        for(i=0; i<count; i++) {
 
4584
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4585
                                                       buffer);
 
4586
                                list_append(object_ptr->fairshare_list, 
 
4587
                                            tmp_info);
 
4588
                        }
 
4589
                }
 
4590
 
 
4591
                safe_unpack32(&count, buffer);
 
4592
                if(count != NO_VAL) {
 
4593
                        object_ptr->grp_cpu_mins_list = 
 
4594
                                list_create(slurm_destroy_char);
 
4595
                        for(i=0; i<count; i++) {
 
4596
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4597
                                                       buffer);
 
4598
                                list_append(object_ptr->grp_cpu_mins_list, 
 
4599
                                            tmp_info);
 
4600
                        }
 
4601
                }
 
4602
                safe_unpack32(&count, buffer);
 
4603
                if(count != NO_VAL) {
 
4604
                        object_ptr->grp_cpus_list = 
 
4605
                                list_create(slurm_destroy_char);
 
4606
                        for(i=0; i<count; i++) {
 
4607
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4608
                                                       buffer);
 
4609
                                list_append(object_ptr->grp_cpus_list, 
 
4610
                                            tmp_info);
 
4611
                        }
 
4612
                }
 
4613
                safe_unpack32(&count, buffer);
 
4614
                if(count != NO_VAL) {
 
4615
                        object_ptr->grp_jobs_list = 
 
4616
                                list_create(slurm_destroy_char);
 
4617
                        for(i=0; i<count; i++) {
 
4618
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4619
                                                       buffer);
 
4620
                                list_append(object_ptr->grp_jobs_list, 
 
4621
                                            tmp_info);
 
4622
                        }
 
4623
                }
 
4624
                safe_unpack32(&count, buffer);
 
4625
                if(count != NO_VAL) {
 
4626
                        object_ptr->grp_nodes_list = 
 
4627
                                list_create(slurm_destroy_char);
 
4628
                        for(i=0; i<count; i++) {
 
4629
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4630
                                                       buffer);
 
4631
                                list_append(object_ptr->grp_nodes_list,
 
4632
                                            tmp_info);
 
4633
                        }
 
4634
                }
 
4635
                safe_unpack32(&count, buffer);
 
4636
                if(count != NO_VAL) {
 
4637
                        object_ptr->grp_submit_jobs_list = 
 
4638
                                list_create(slurm_destroy_char);
 
4639
                        for(i=0; i<count; i++) {
 
4640
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4641
                                                       buffer);
 
4642
                                list_append(object_ptr->grp_submit_jobs_list, 
 
4643
                                            tmp_info);
 
4644
                        }
 
4645
                }
 
4646
                safe_unpack32(&count, buffer);
 
4647
                if(count != NO_VAL) {
 
4648
                        object_ptr->grp_wall_list = 
 
4649
                                list_create(slurm_destroy_char);
 
4650
                        for(i=0; i<count; i++) {
 
4651
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4652
                                                       buffer);
 
4653
                                list_append(object_ptr->grp_wall_list, 
 
4654
                                            tmp_info);
 
4655
                        }
 
4656
                }
 
4657
 
 
4658
                safe_unpack32(&count, buffer);
 
4659
                if(count != NO_VAL) {
 
4660
                        object_ptr->id_list = list_create(slurm_destroy_char);
 
4661
                        for(i=0; i<count; i++) {
 
4662
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp, 
 
4663
                                                       buffer);
 
4664
                                list_append(object_ptr->id_list, tmp_info);
 
4665
                        }
 
4666
                }
 
4667
        
 
4668
                safe_unpack32(&count, buffer);
 
4669
                if(count != NO_VAL) {
 
4670
                        object_ptr->max_cpu_mins_pj_list = 
 
4671
                                list_create(slurm_destroy_char);
 
4672
                        for(i=0; i<count; i++) {
 
4673
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4674
                                                       buffer);
 
4675
                                list_append(object_ptr->max_cpu_mins_pj_list,
 
4676
                                            tmp_info);
 
4677
                        }
 
4678
                }
 
4679
                safe_unpack32(&count, buffer);
 
4680
                if(count != NO_VAL) {
 
4681
                        object_ptr->max_cpus_pj_list = 
 
4682
                                list_create(slurm_destroy_char);
 
4683
                        for(i=0; i<count; i++) {
 
4684
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4685
                                                       buffer);
 
4686
                                list_append(object_ptr->max_cpus_pj_list,
 
4687
                                            tmp_info);
 
4688
                        }
 
4689
                }
 
4690
                safe_unpack32(&count, buffer);
 
4691
                if(count != NO_VAL) {
 
4692
                        object_ptr->max_jobs_list = 
 
4693
                                list_create(slurm_destroy_char);
 
4694
                        for(i=0; i<count; i++) {
 
4695
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4696
                                                       buffer);
 
4697
                                list_append(object_ptr->max_jobs_list,
 
4698
                                            tmp_info);
 
4699
                        }
 
4700
                }
 
4701
                safe_unpack32(&count, buffer);
 
4702
                if(count != NO_VAL) {
 
4703
                        object_ptr->max_nodes_pj_list = 
 
4704
                                list_create(slurm_destroy_char);
 
4705
                        for(i=0; i<count; i++) {
 
4706
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4707
                                                       buffer);
 
4708
                                list_append(object_ptr->max_nodes_pj_list,
 
4709
                                            tmp_info);
 
4710
                        }
 
4711
                }
 
4712
                safe_unpack32(&count, buffer);
 
4713
                if(count != NO_VAL) {
 
4714
                        object_ptr->max_submit_jobs_list = 
 
4715
                                list_create(slurm_destroy_char);
 
4716
                        for(i=0; i<count; i++) {
 
4717
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4718
                                                       buffer);
 
4719
                                list_append(object_ptr->max_submit_jobs_list, 
 
4720
                                            tmp_info);
 
4721
                        }
 
4722
                }
 
4723
                safe_unpack32(&count, buffer);
 
4724
                if(count != NO_VAL) {
 
4725
                        object_ptr->max_wall_pj_list = 
 
4726
                                list_create(slurm_destroy_char);
 
4727
                        for(i=0; i<count; i++) {
 
4728
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4729
                                                       buffer);
 
4730
                                list_append(object_ptr->max_wall_pj_list,
 
4731
                                            tmp_info);
 
4732
                        }
 
4733
                }
 
4734
 
 
4735
                safe_unpack32(&count, buffer);
 
4736
                if(count != NO_VAL) {
 
4737
                        object_ptr->partition_list = 
 
4738
                                list_create(slurm_destroy_char);
 
4739
                        for(i=0; i<count; i++) {
 
4740
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4741
                                                       buffer);
 
4742
                                list_append(object_ptr->partition_list,
 
4743
                                            tmp_info);
 
4744
                        }
 
4745
                }
 
4746
 
 
4747
                safe_unpack32(&count, buffer);
 
4748
                if(count != NO_VAL) {
 
4749
                        object_ptr->parent_acct_list = 
 
4750
                                list_create(slurm_destroy_char);
 
4751
                        for(i=0; i<count; i++) {
 
4752
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4753
                                                       buffer);
 
4754
                                list_append(object_ptr->parent_acct_list,
 
4755
                                            tmp_info);
 
4756
                        }
 
4757
                }
 
4758
 
 
4759
                safe_unpack32(&count, buffer);
 
4760
                if(count != NO_VAL) {
 
4761
                        object_ptr->qos_list = list_create(slurm_destroy_char);
 
4762
                        for(i=0; i<count; i++) {
 
4763
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
4764
                                                       buffer);
 
4765
                                list_append(object_ptr->qos_list, tmp_info);
 
4766
                        }
 
4767
                }
 
4768
 
 
4769
                safe_unpack32(&uint32_tmp, buffer);
 
4770
                object_ptr->usage_end = uint32_tmp;
 
4771
                safe_unpack32(&uint32_tmp, buffer);
 
4772
                object_ptr->usage_start = uint32_tmp;
3816
4773
 
3817
4774
                safe_unpack32(&count, buffer);
3818
4775
                if(count != NO_VAL) {
3926
4883
                        list_append(object_ptr->parent_acct_list, tmp_info);
3927
4884
                }
3928
4885
 
3929
 
                safe_unpack32(&object_ptr->usage_end, buffer);
3930
 
                safe_unpack32(&object_ptr->usage_start, buffer);
 
4886
                safe_unpack32(&uint32_tmp, buffer);
 
4887
                object_ptr->usage_end = uint32_tmp;
 
4888
                safe_unpack32(&uint32_tmp, buffer);
 
4889
                object_ptr->usage_start = uint32_tmp;
3931
4890
 
3932
4891
                safe_unpack32(&count, buffer);
3933
4892
                if(count != NO_VAL) {
3963
4922
        ListIterator itr = NULL;
3964
4923
        acct_job_cond_t *object = (acct_job_cond_t *)in;
3965
4924
 
3966
 
        if(rpc_version >= 4) {
 
4925
        if(rpc_version >= 5) {
 
4926
                if(!object) {
 
4927
                        pack32(NO_VAL, buffer);
 
4928
                        pack32(NO_VAL, buffer);
 
4929
                        pack32(NO_VAL, buffer);
 
4930
                        pack16(0, buffer);
 
4931
                        pack32(NO_VAL, buffer);
 
4932
                        pack32(NO_VAL, buffer);
 
4933
                        pack32(NO_VAL, buffer);
 
4934
                        pack32(NO_VAL, buffer);
 
4935
                        pack32(NO_VAL, buffer);
 
4936
                        pack_time(0, buffer);
 
4937
                        pack_time(0, buffer);
 
4938
                        packnull(buffer);
 
4939
                        pack32(NO_VAL, buffer);
 
4940
                        pack32(NO_VAL, buffer);
 
4941
                        pack16(0, buffer);
 
4942
                        pack16(0, buffer);
 
4943
                        return;
 
4944
                }
 
4945
 
 
4946
                if(object->acct_list)
 
4947
                        count = list_count(object->acct_list);
 
4948
        
 
4949
                pack32(count, buffer);
 
4950
                if(count && count != NO_VAL) {
 
4951
                        itr = list_iterator_create(object->acct_list);
 
4952
                        while((tmp_info = list_next(itr))) {
 
4953
                                packstr(tmp_info, buffer);
 
4954
                        }
 
4955
                        list_iterator_destroy(itr);
 
4956
                }
 
4957
                count = NO_VAL;
 
4958
 
 
4959
                if(object->associd_list)
 
4960
                        count = list_count(object->associd_list);
 
4961
        
 
4962
                pack32(count, buffer);
 
4963
                if(count && count != NO_VAL) {
 
4964
                        itr = list_iterator_create(object->associd_list);
 
4965
                        while((tmp_info = list_next(itr))) {
 
4966
                                packstr(tmp_info, buffer);
 
4967
                        }
 
4968
                }
 
4969
                count = NO_VAL;
 
4970
 
 
4971
                if(object->cluster_list)
 
4972
                        count = list_count(object->cluster_list);
 
4973
        
 
4974
                pack32(count, buffer);
 
4975
                if(count && count != NO_VAL) {
 
4976
                        itr = list_iterator_create(object->cluster_list);
 
4977
                        while((tmp_info = list_next(itr))) {
 
4978
                                packstr(tmp_info, buffer);
 
4979
                        }
 
4980
                        list_iterator_destroy(itr);
 
4981
                }
 
4982
                count = NO_VAL;
 
4983
 
 
4984
                pack16(object->duplicates, buffer);
 
4985
 
 
4986
                if(object->groupid_list)
 
4987
                        count = list_count(object->groupid_list);
 
4988
        
 
4989
                pack32(count, buffer);
 
4990
                if(count && count != NO_VAL) {
 
4991
                        itr = list_iterator_create(object->groupid_list);
 
4992
                        while((tmp_info = list_next(itr))) {
 
4993
                                packstr(tmp_info, buffer);
 
4994
                        }
 
4995
                }
 
4996
                count = NO_VAL;
 
4997
        
 
4998
                if(object->partition_list)
 
4999
                        count = list_count(object->partition_list);
 
5000
        
 
5001
                pack32(count, buffer);
 
5002
                if(count && count != NO_VAL) {
 
5003
                        itr = list_iterator_create(object->partition_list);
 
5004
                        while((tmp_info = list_next(itr))) {
 
5005
                                packstr(tmp_info, buffer);
 
5006
                        }
 
5007
                        list_iterator_destroy(itr);
 
5008
                }
 
5009
                count = NO_VAL;
 
5010
 
 
5011
                if(object->resv_list)
 
5012
                        count = list_count(object->resv_list);
 
5013
        
 
5014
                pack32(count, buffer);
 
5015
                if(count && count != NO_VAL) {
 
5016
                        itr = list_iterator_create(object->resv_list);
 
5017
                        while((tmp_info = list_next(itr))) {
 
5018
                                packstr(tmp_info, buffer);
 
5019
                        }
 
5020
                        list_iterator_destroy(itr);
 
5021
                }
 
5022
                count = NO_VAL;
 
5023
 
 
5024
                if(object->resvid_list)
 
5025
                        count = list_count(object->resvid_list);
 
5026
        
 
5027
                pack32(count, buffer);
 
5028
                if(count && count != NO_VAL) {
 
5029
                        itr = list_iterator_create(object->resvid_list);
 
5030
                        while((tmp_info = list_next(itr))) {
 
5031
                                packstr(tmp_info, buffer);
 
5032
                        }
 
5033
                        list_iterator_destroy(itr);
 
5034
                }
 
5035
                count = NO_VAL;
 
5036
 
 
5037
                if(object->step_list)
 
5038
                        count = list_count(object->step_list);
 
5039
        
 
5040
                pack32(count, buffer);
 
5041
                if(count && count != NO_VAL) {
 
5042
                        itr = list_iterator_create(object->step_list);
 
5043
                        while((job = list_next(itr))) {
 
5044
                                pack_jobacct_selected_step(job, rpc_version, 
 
5045
                                                           buffer);
 
5046
                        }
 
5047
                        list_iterator_destroy(itr);
 
5048
                }
 
5049
                count = NO_VAL;
 
5050
 
 
5051
                if(object->state_list)
 
5052
                        count = list_count(object->state_list);
 
5053
        
 
5054
                pack32(count, buffer);
 
5055
                if(count && count != NO_VAL) {
 
5056
                        itr = list_iterator_create(object->state_list);
 
5057
                        while((tmp_info = list_next(itr))) {
 
5058
                                packstr(tmp_info, buffer);
 
5059
                        }
 
5060
                        list_iterator_destroy(itr);
 
5061
                }
 
5062
                count = NO_VAL;
 
5063
 
 
5064
                pack_time(object->usage_end, buffer);
 
5065
                pack_time(object->usage_start, buffer);
 
5066
 
 
5067
                packstr(object->used_nodes, buffer);
 
5068
 
 
5069
                if(object->userid_list)
 
5070
                        count = list_count(object->userid_list);
 
5071
        
 
5072
                pack32(count, buffer);
 
5073
                if(count && count != NO_VAL) {
 
5074
                        itr = list_iterator_create(object->userid_list);
 
5075
                        while((tmp_info = list_next(itr))) {
 
5076
                                packstr(tmp_info, buffer);
 
5077
                        }
 
5078
                        list_iterator_destroy(itr);
 
5079
                }
 
5080
                count = NO_VAL;
 
5081
 
 
5082
                pack32(count, buffer);
 
5083
                if(count && count != NO_VAL) {
 
5084
                        itr = list_iterator_create(object->wckey_list);
 
5085
                        while((tmp_info = list_next(itr))) {
 
5086
                                packstr(tmp_info, buffer);
 
5087
                        }
 
5088
                        list_iterator_destroy(itr);
 
5089
                }
 
5090
                count = NO_VAL;
 
5091
 
 
5092
                pack16(object->without_steps, buffer);
 
5093
                pack16(object->without_usage_truncation, buffer);
 
5094
        } else if(rpc_version >= 4) {
3967
5095
                if(!object) {
3968
5096
                        pack32(NO_VAL, buffer);
3969
5097
                        pack32(NO_VAL, buffer);
4240
5368
 
4241
5369
        *object = object_ptr;
4242
5370
 
4243
 
        if(rpc_version >= 4) {
4244
 
                safe_unpack32(&count, buffer);
4245
 
                if(count != NO_VAL) {
4246
 
                        object_ptr->acct_list = list_create(slurm_destroy_char);
4247
 
                        for(i=0; i<count; i++) {
4248
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
4249
 
                                                       buffer);
4250
 
                                list_append(object_ptr->acct_list, tmp_info);
4251
 
                        }
4252
 
                }
4253
 
 
4254
 
                safe_unpack32(&count, buffer);
4255
 
                if(count != NO_VAL) {
4256
 
                        object_ptr->associd_list =
4257
 
                                list_create(slurm_destroy_char);
4258
 
                        for(i=0; i<count; i++) {
4259
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
4260
 
                                                       buffer);
4261
 
                                list_append(object_ptr->associd_list, tmp_info);
4262
 
                        }
4263
 
                }
4264
 
 
4265
 
                safe_unpack32(&count, buffer);
4266
 
                if(count != NO_VAL) {
4267
 
                        object_ptr->cluster_list =
4268
 
                                list_create(slurm_destroy_char);
4269
 
                        for(i=0; i<count; i++) {
4270
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
4271
 
                                                       buffer);
4272
 
                                list_append(object_ptr->cluster_list, tmp_info);
4273
 
                        }
4274
 
                }
4275
 
 
4276
 
                safe_unpack16(&object_ptr->duplicates, buffer);
4277
 
 
4278
 
                safe_unpack32(&count, buffer);
4279
 
                if(count != NO_VAL) {
4280
 
                        object_ptr->groupid_list = 
4281
 
                                list_create(slurm_destroy_char);
4282
 
                        for(i=0; i<count; i++) {
4283
 
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp, 
4284
 
                                                       buffer);
4285
 
                                list_append(object_ptr->groupid_list, tmp_info);
4286
 
                        }
4287
 
                }
4288
 
        
4289
 
                safe_unpack32(&count, buffer);
4290
 
                if(count != NO_VAL) {
4291
 
                        object_ptr->partition_list =
4292
 
                                list_create(slurm_destroy_char);
4293
 
                        for(i=0; i<count; i++) {
4294
 
                                safe_unpackstr_xmalloc(&tmp_info,
4295
 
                                                       &uint32_tmp, buffer);
4296
 
                                list_append(object_ptr->partition_list, 
4297
 
                                            tmp_info);
4298
 
                        }
4299
 
                }
4300
 
 
4301
 
                safe_unpack32(&count, buffer);
4302
 
                if(count != NO_VAL) {
4303
 
                        object_ptr->step_list =
4304
 
                                list_create(destroy_jobacct_selected_step);
4305
 
                        for(i=0; i<count; i++) {
4306
 
                                unpack_jobacct_selected_step(&job, rpc_version,
4307
 
                                                             buffer);
4308
 
                                list_append(object_ptr->step_list, job);
4309
 
                        }
4310
 
                }
4311
 
 
4312
 
                safe_unpack32(&count, buffer);
4313
 
                if(count != NO_VAL) {
4314
 
                        object_ptr->state_list =
4315
 
                                list_create(slurm_destroy_char);
4316
 
                        for(i=0; i<count; i++) {
4317
 
                                safe_unpackstr_xmalloc(&tmp_info,
4318
 
                                                       &uint32_tmp, buffer);
4319
 
                                list_append(object_ptr->state_list, tmp_info);
4320
 
                        }
4321
 
                }
4322
 
        
4323
 
                safe_unpack32(&object_ptr->usage_end, buffer);
4324
 
                safe_unpack32(&object_ptr->usage_start, buffer);
 
5371
        if(rpc_version >= 5) {
 
5372
                safe_unpack32(&count, buffer);
 
5373
                if(count != NO_VAL) {
 
5374
                        object_ptr->acct_list = list_create(slurm_destroy_char);
 
5375
                        for(i=0; i<count; i++) {
 
5376
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
5377
                                                       buffer);
 
5378
                                list_append(object_ptr->acct_list, tmp_info);
 
5379
                        }
 
5380
                }
 
5381
 
 
5382
                safe_unpack32(&count, buffer);
 
5383
                if(count != NO_VAL) {
 
5384
                        object_ptr->associd_list =
 
5385
                                list_create(slurm_destroy_char);
 
5386
                        for(i=0; i<count; i++) {
 
5387
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
5388
                                                       buffer);
 
5389
                                list_append(object_ptr->associd_list, tmp_info);
 
5390
                        }
 
5391
                }
 
5392
 
 
5393
                safe_unpack32(&count, buffer);
 
5394
                if(count != NO_VAL) {
 
5395
                        object_ptr->cluster_list =
 
5396
                                list_create(slurm_destroy_char);
 
5397
                        for(i=0; i<count; i++) {
 
5398
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
5399
                                                       buffer);
 
5400
                                list_append(object_ptr->cluster_list, tmp_info);
 
5401
                        }
 
5402
                }
 
5403
 
 
5404
                safe_unpack16(&object_ptr->duplicates, buffer);
 
5405
 
 
5406
                safe_unpack32(&count, buffer);
 
5407
                if(count != NO_VAL) {
 
5408
                        object_ptr->groupid_list = 
 
5409
                                list_create(slurm_destroy_char);
 
5410
                        for(i=0; i<count; i++) {
 
5411
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp, 
 
5412
                                                       buffer);
 
5413
                                list_append(object_ptr->groupid_list, tmp_info);
 
5414
                        }
 
5415
                }
 
5416
        
 
5417
                safe_unpack32(&count, buffer);
 
5418
                if(count != NO_VAL) {
 
5419
                        object_ptr->partition_list =
 
5420
                                list_create(slurm_destroy_char);
 
5421
                        for(i=0; i<count; i++) {
 
5422
                                safe_unpackstr_xmalloc(&tmp_info,
 
5423
                                                       &uint32_tmp, buffer);
 
5424
                                list_append(object_ptr->partition_list, 
 
5425
                                            tmp_info);
 
5426
                        }
 
5427
                }
 
5428
 
 
5429
                safe_unpack32(&count, buffer);
 
5430
                if(count != NO_VAL) {
 
5431
                        object_ptr->resv_list =
 
5432
                                list_create(slurm_destroy_char);
 
5433
                        for(i=0; i<count; i++) {
 
5434
                                safe_unpackstr_xmalloc(&tmp_info,
 
5435
                                                       &uint32_tmp, buffer);
 
5436
                                list_append(object_ptr->resv_list, 
 
5437
                                            tmp_info);
 
5438
                        }
 
5439
                }
 
5440
 
 
5441
                safe_unpack32(&count, buffer);
 
5442
                if(count != NO_VAL) {
 
5443
                        object_ptr->resvid_list =
 
5444
                                list_create(slurm_destroy_char);
 
5445
                        for(i=0; i<count; i++) {
 
5446
                                safe_unpackstr_xmalloc(&tmp_info,
 
5447
                                                       &uint32_tmp, buffer);
 
5448
                                list_append(object_ptr->resvid_list, 
 
5449
                                            tmp_info);
 
5450
                        }
 
5451
                }
 
5452
 
 
5453
                safe_unpack32(&count, buffer);
 
5454
                if(count != NO_VAL) {
 
5455
                        object_ptr->step_list =
 
5456
                                list_create(destroy_jobacct_selected_step);
 
5457
                        for(i=0; i<count; i++) {
 
5458
                                unpack_jobacct_selected_step(&job, rpc_version,
 
5459
                                                             buffer);
 
5460
                                list_append(object_ptr->step_list, job);
 
5461
                        }
 
5462
                }
 
5463
 
 
5464
                safe_unpack32(&count, buffer);
 
5465
                if(count != NO_VAL) {
 
5466
                        object_ptr->state_list =
 
5467
                                list_create(slurm_destroy_char);
 
5468
                        for(i=0; i<count; i++) {
 
5469
                                safe_unpackstr_xmalloc(&tmp_info,
 
5470
                                                       &uint32_tmp, buffer);
 
5471
                                list_append(object_ptr->state_list, tmp_info);
 
5472
                        }
 
5473
                }
 
5474
        
 
5475
                safe_unpack_time(&object_ptr->usage_end, buffer);
 
5476
                safe_unpack_time(&object_ptr->usage_start, buffer);
 
5477
 
 
5478
                safe_unpackstr_xmalloc(&object_ptr->used_nodes,
 
5479
                                       &uint32_tmp, buffer);
 
5480
 
 
5481
                safe_unpack32(&count, buffer);
 
5482
                if(count != NO_VAL) {
 
5483
                        object_ptr->userid_list = 
 
5484
                                list_create(slurm_destroy_char);
 
5485
                        for(i=0; i<count; i++) {
 
5486
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
5487
                                                       buffer);
 
5488
                                list_append(object_ptr->userid_list, tmp_info);
 
5489
                        }
 
5490
                }
 
5491
 
 
5492
                safe_unpack32(&count, buffer);
 
5493
                if(count != NO_VAL) {
 
5494
                        object_ptr->wckey_list = 
 
5495
                                list_create(slurm_destroy_char);
 
5496
                        for(i=0; i<count; i++) {
 
5497
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
5498
                                                       buffer);
 
5499
                                list_append(object_ptr->wckey_list, tmp_info);
 
5500
                        }
 
5501
                }
 
5502
 
 
5503
                safe_unpack16(&object_ptr->without_steps, buffer);
 
5504
                safe_unpack16(&object_ptr->without_usage_truncation, buffer);
 
5505
        } else if(rpc_version >= 4) {
 
5506
                safe_unpack32(&count, buffer);
 
5507
                if(count != NO_VAL) {
 
5508
                        object_ptr->acct_list = list_create(slurm_destroy_char);
 
5509
                        for(i=0; i<count; i++) {
 
5510
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
5511
                                                       buffer);
 
5512
                                list_append(object_ptr->acct_list, tmp_info);
 
5513
                        }
 
5514
                }
 
5515
 
 
5516
                safe_unpack32(&count, buffer);
 
5517
                if(count != NO_VAL) {
 
5518
                        object_ptr->associd_list =
 
5519
                                list_create(slurm_destroy_char);
 
5520
                        for(i=0; i<count; i++) {
 
5521
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
5522
                                                       buffer);
 
5523
                                list_append(object_ptr->associd_list, tmp_info);
 
5524
                        }
 
5525
                }
 
5526
 
 
5527
                safe_unpack32(&count, buffer);
 
5528
                if(count != NO_VAL) {
 
5529
                        object_ptr->cluster_list =
 
5530
                                list_create(slurm_destroy_char);
 
5531
                        for(i=0; i<count; i++) {
 
5532
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
5533
                                                       buffer);
 
5534
                                list_append(object_ptr->cluster_list, tmp_info);
 
5535
                        }
 
5536
                }
 
5537
 
 
5538
                safe_unpack16(&object_ptr->duplicates, buffer);
 
5539
 
 
5540
                safe_unpack32(&count, buffer);
 
5541
                if(count != NO_VAL) {
 
5542
                        object_ptr->groupid_list = 
 
5543
                                list_create(slurm_destroy_char);
 
5544
                        for(i=0; i<count; i++) {
 
5545
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp, 
 
5546
                                                       buffer);
 
5547
                                list_append(object_ptr->groupid_list, tmp_info);
 
5548
                        }
 
5549
                }
 
5550
        
 
5551
                safe_unpack32(&count, buffer);
 
5552
                if(count != NO_VAL) {
 
5553
                        object_ptr->partition_list =
 
5554
                                list_create(slurm_destroy_char);
 
5555
                        for(i=0; i<count; i++) {
 
5556
                                safe_unpackstr_xmalloc(&tmp_info,
 
5557
                                                       &uint32_tmp, buffer);
 
5558
                                list_append(object_ptr->partition_list, 
 
5559
                                            tmp_info);
 
5560
                        }
 
5561
                }
 
5562
 
 
5563
                safe_unpack32(&count, buffer);
 
5564
                if(count != NO_VAL) {
 
5565
                        object_ptr->step_list =
 
5566
                                list_create(destroy_jobacct_selected_step);
 
5567
                        for(i=0; i<count; i++) {
 
5568
                                unpack_jobacct_selected_step(&job, rpc_version,
 
5569
                                                             buffer);
 
5570
                                list_append(object_ptr->step_list, job);
 
5571
                        }
 
5572
                }
 
5573
 
 
5574
                safe_unpack32(&count, buffer);
 
5575
                if(count != NO_VAL) {
 
5576
                        object_ptr->state_list =
 
5577
                                list_create(slurm_destroy_char);
 
5578
                        for(i=0; i<count; i++) {
 
5579
                                safe_unpackstr_xmalloc(&tmp_info,
 
5580
                                                       &uint32_tmp, buffer);
 
5581
                                list_append(object_ptr->state_list, tmp_info);
 
5582
                        }
 
5583
                }
 
5584
        
 
5585
                safe_unpack32(&uint32_tmp, buffer);
 
5586
                object_ptr->usage_end = uint32_tmp;
 
5587
                safe_unpack32(&uint32_tmp, buffer);
 
5588
                object_ptr->usage_start = uint32_tmp;
4325
5589
 
4326
5590
                safe_unpack32(&count, buffer);
4327
5591
                if(count != NO_VAL) {
4426
5690
                        }
4427
5691
                }
4428
5692
        
4429
 
                safe_unpack32(&object_ptr->usage_end, buffer);
4430
 
                safe_unpack32(&object_ptr->usage_start, buffer);
 
5693
                safe_unpack32(&uint32_tmp, buffer);
 
5694
                object_ptr->usage_end = uint32_tmp;
 
5695
                safe_unpack32(&uint32_tmp, buffer);
 
5696
                object_ptr->usage_start = uint32_tmp;
4431
5697
 
4432
5698
                safe_unpack32(&count, buffer);
4433
5699
                if(count != NO_VAL) {
4554
5820
        return SLURM_ERROR;
4555
5821
}
4556
5822
 
 
5823
extern void pack_acct_reservation_cond(void *in, uint16_t rpc_version,
 
5824
                                      Buf buffer)
 
5825
{
 
5826
        acct_reservation_cond_t *object = (acct_reservation_cond_t *)in;
 
5827
        uint32_t count = NO_VAL;
 
5828
        ListIterator itr = NULL;
 
5829
        char *tmp_info = NULL;
 
5830
 
 
5831
        if(!object) {
 
5832
                pack32((uint32_t)NO_VAL, buffer);
 
5833
                pack16(0, buffer);
 
5834
                pack32((uint16_t)NO_VAL, buffer);
 
5835
                pack32((uint16_t)NO_VAL, buffer);
 
5836
                packnull(buffer);
 
5837
                pack_time(0, buffer);
 
5838
                pack_time(0, buffer);
 
5839
                pack16(0, buffer);
 
5840
                return;
 
5841
        }
 
5842
        
 
5843
        if(object->cluster_list)
 
5844
                count = list_count(object->cluster_list);
 
5845
        
 
5846
        pack32(count, buffer);
 
5847
        if(count && count != NO_VAL) {
 
5848
                itr = list_iterator_create(object->cluster_list);
 
5849
                while((tmp_info = list_next(itr))) {
 
5850
                        packstr(tmp_info, buffer);
 
5851
                }
 
5852
                list_iterator_destroy(itr);
 
5853
        }
 
5854
        count = NO_VAL;
 
5855
 
 
5856
        pack16(object->flags, buffer);
 
5857
        
 
5858
        if(object->id_list)
 
5859
                count = list_count(object->id_list);
 
5860
        
 
5861
        pack32(count, buffer);
 
5862
        if(count && count != NO_VAL) {
 
5863
                itr = list_iterator_create(object->id_list);
 
5864
                while((tmp_info = list_next(itr))) {
 
5865
                        packstr(tmp_info, buffer);
 
5866
                }
 
5867
                list_iterator_destroy(itr);
 
5868
        }
 
5869
        count = NO_VAL;
 
5870
 
 
5871
        if(object->name_list)
 
5872
                count = list_count(object->name_list);
 
5873
        
 
5874
        pack32(count, buffer);
 
5875
        if(count && count != NO_VAL) {
 
5876
                itr = list_iterator_create(object->name_list);
 
5877
                while((tmp_info = list_next(itr))) {
 
5878
                        packstr(tmp_info, buffer);
 
5879
                }
 
5880
                list_iterator_destroy(itr);
 
5881
        }
 
5882
        count = NO_VAL;
 
5883
 
 
5884
        packstr(object->nodes, buffer);
 
5885
        pack_time(object->time_end, buffer);
 
5886
        pack_time(object->time_start, buffer);  
 
5887
        pack16(object->with_usage, buffer);     
 
5888
}
 
5889
 
 
5890
extern int unpack_acct_reservation_cond(void **object, uint16_t rpc_version,
 
5891
                                      Buf buffer)
 
5892
{
 
5893
        uint32_t uint32_tmp, count;
 
5894
        int i = 0;
 
5895
        char *tmp_info = NULL;
 
5896
        acct_reservation_cond_t *object_ptr = 
 
5897
                xmalloc(sizeof(acct_reservation_cond_t));
 
5898
 
 
5899
        *object = object_ptr;
 
5900
 
 
5901
        safe_unpack32(&count, buffer);
 
5902
        if(count != NO_VAL) {
 
5903
                object_ptr->cluster_list = list_create(slurm_destroy_char);
 
5904
                for(i=0; i<count; i++) {
 
5905
                        safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp, buffer);
 
5906
                        list_append(object_ptr->cluster_list, tmp_info);
 
5907
                }
 
5908
        }
 
5909
 
 
5910
        safe_unpack16(&object_ptr->flags, buffer);
 
5911
 
 
5912
        safe_unpack32(&count, buffer);
 
5913
        if(count != NO_VAL) {
 
5914
                object_ptr->id_list = list_create(slurm_destroy_char);
 
5915
                for(i=0; i<count; i++) {
 
5916
                        safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp, buffer);
 
5917
                        list_append(object_ptr->id_list, tmp_info);
 
5918
                }
 
5919
        }
 
5920
 
 
5921
        safe_unpack32(&count, buffer);
 
5922
        if(count != NO_VAL) {
 
5923
                object_ptr->name_list = list_create(slurm_destroy_char);
 
5924
                for(i=0; i<count; i++) {
 
5925
                        safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp, buffer);
 
5926
                        list_append(object_ptr->name_list, tmp_info);
 
5927
                }
 
5928
        }
 
5929
 
 
5930
        safe_unpackstr_xmalloc(&object_ptr->nodes, &uint32_tmp, buffer);
 
5931
        safe_unpack_time(&object_ptr->time_end, buffer);
 
5932
        safe_unpack_time(&object_ptr->time_start, buffer);      
 
5933
        safe_unpack16(&object_ptr->with_usage, buffer); 
 
5934
 
 
5935
        return SLURM_SUCCESS;
 
5936
 
 
5937
unpack_error:
 
5938
        destroy_acct_reservation_cond(object_ptr);
 
5939
        *object = NULL;
 
5940
        return SLURM_ERROR;
 
5941
}
 
5942
 
4557
5943
extern void pack_acct_txn_cond(void *in, uint16_t rpc_version, Buf buffer)
4558
5944
{
4559
5945
        uint32_t count = NO_VAL;
4561
5947
        ListIterator itr = NULL;
4562
5948
        acct_txn_cond_t *object = (acct_txn_cond_t *)in;
4563
5949
 
4564
 
        if(rpc_version >= 3) {
 
5950
        if(rpc_version >= 5) {
 
5951
                if(!object) {
 
5952
                        pack32(NO_VAL, buffer);
 
5953
                        pack32(NO_VAL, buffer);
 
5954
                        pack32(NO_VAL, buffer);
 
5955
                        pack32(NO_VAL, buffer);
 
5956
                        pack32(NO_VAL, buffer);
 
5957
                        pack32(NO_VAL, buffer);
 
5958
                        pack_time(0, buffer);
 
5959
                        pack_time(0, buffer);
 
5960
                        pack32(NO_VAL, buffer);
 
5961
                        pack16(0, buffer);
 
5962
                        return;
 
5963
                }
 
5964
                if(object->acct_list)
 
5965
                        count = list_count(object->acct_list);
 
5966
        
 
5967
                pack32(count, buffer);
 
5968
                if(count && count != NO_VAL) {
 
5969
                        itr = list_iterator_create(object->acct_list);
 
5970
                        while((tmp_info = list_next(itr))) {
 
5971
                                packstr(tmp_info, buffer);
 
5972
                        }
 
5973
                        list_iterator_destroy(itr);
 
5974
                }
 
5975
                count = NO_VAL;
 
5976
 
 
5977
                if(object->action_list)
 
5978
                        count = list_count(object->action_list);
 
5979
        
 
5980
                pack32(count, buffer);
 
5981
                if(count && count != NO_VAL) {
 
5982
                        itr = list_iterator_create(object->action_list);
 
5983
                        while((tmp_info = list_next(itr))) {
 
5984
                                packstr(tmp_info, buffer);
 
5985
                        }
 
5986
                        list_iterator_destroy(itr);
 
5987
                }
 
5988
                count = NO_VAL;
 
5989
 
 
5990
                if(object->actor_list) 
 
5991
                        count = list_count(object->actor_list);
 
5992
 
 
5993
                pack32(count, buffer);
 
5994
                if(count && count != NO_VAL) {
 
5995
                        itr = list_iterator_create(object->actor_list);
 
5996
                        while((tmp_info = list_next(itr))) {
 
5997
                                packstr(tmp_info, buffer);
 
5998
                        }
 
5999
                        list_iterator_destroy(itr); 
 
6000
                }
 
6001
                count = NO_VAL;
 
6002
 
 
6003
                if(object->cluster_list)
 
6004
                        count = list_count(object->cluster_list);
 
6005
         
 
6006
                pack32(count, buffer);
 
6007
                if(count && count != NO_VAL) {
 
6008
                        itr = list_iterator_create(object->cluster_list);
 
6009
                        while((tmp_info = list_next(itr))) {
 
6010
                                packstr(tmp_info, buffer);
 
6011
                        } 
 
6012
                        list_iterator_destroy(itr);
 
6013
                }
 
6014
                count = NO_VAL;
 
6015
 
 
6016
                if(object->id_list)
 
6017
                        count = list_count(object->id_list);
 
6018
         
 
6019
                pack32(count, buffer);
 
6020
                if(count && count != NO_VAL) {
 
6021
                        itr = list_iterator_create(object->id_list);
 
6022
                        while((tmp_info = list_next(itr))) {
 
6023
                                packstr(tmp_info, buffer);
 
6024
                        } 
 
6025
                        list_iterator_destroy(itr);
 
6026
                }
 
6027
                count = NO_VAL;
 
6028
 
 
6029
                if(object->info_list)
 
6030
                        count = list_count(object->info_list);
 
6031
         
 
6032
                pack32(count, buffer);
 
6033
                if(count && count != NO_VAL) {
 
6034
                        itr = list_iterator_create(object->info_list);
 
6035
                        while((tmp_info = list_next(itr))) {
 
6036
                                packstr(tmp_info, buffer);
 
6037
                        } 
 
6038
                        list_iterator_destroy(itr);
 
6039
                }
 
6040
                count = NO_VAL;
 
6041
 
 
6042
                if(object->name_list)
 
6043
                        count = list_count(object->name_list);
 
6044
         
 
6045
                pack32(count, buffer);
 
6046
                if(count && count != NO_VAL) {
 
6047
                        itr = list_iterator_create(object->name_list);
 
6048
                        while((tmp_info = list_next(itr))) {
 
6049
                                packstr(tmp_info, buffer);
 
6050
                        } 
 
6051
                        list_iterator_destroy(itr);
 
6052
                }
 
6053
                count = NO_VAL;
 
6054
 
 
6055
                pack_time(object->time_end, buffer);
 
6056
                pack_time(object->time_start, buffer);
 
6057
                if(object->user_list)
 
6058
                        count = list_count(object->user_list);
 
6059
         
 
6060
                pack32(count, buffer);
 
6061
                if(count && count != NO_VAL) {
 
6062
                        itr = list_iterator_create(object->user_list);
 
6063
                        while((tmp_info = list_next(itr))) {
 
6064
                                packstr(tmp_info, buffer);
 
6065
                        } 
 
6066
                        list_iterator_destroy(itr);
 
6067
                }
 
6068
                count = NO_VAL;
 
6069
                
 
6070
                pack16(object->with_assoc_info, buffer);
 
6071
        } else if(rpc_version >= 3) {
4565
6072
                if(!object) {
4566
6073
                        pack32(NO_VAL, buffer);
4567
6074
                        pack32(NO_VAL, buffer);
4744
6251
        char *tmp_info = NULL;
4745
6252
 
4746
6253
        *object = object_ptr;
4747
 
        if (rpc_version >= 3) {
4748
 
                safe_unpack32(&count, buffer);
4749
 
                if(count != NO_VAL) {
4750
 
                        object_ptr->acct_list =
4751
 
                                list_create(slurm_destroy_char);
4752
 
                        for(i=0; i<count; i++) {
4753
 
                                safe_unpackstr_xmalloc(&tmp_info,
4754
 
                                                       &uint32_tmp, buffer);
4755
 
                                list_append(object_ptr->acct_list, tmp_info);
4756
 
                        }
4757
 
                }
4758
 
 
4759
 
                safe_unpack32(&count, buffer);
4760
 
                if(count != NO_VAL) {
4761
 
                        object_ptr->action_list =
4762
 
                                list_create(slurm_destroy_char);
4763
 
                        for(i=0; i<count; i++) {
4764
 
                                safe_unpackstr_xmalloc(&tmp_info,
4765
 
                                                       &uint32_tmp, buffer);
4766
 
                                list_append(object_ptr->action_list, tmp_info);
4767
 
                        }
4768
 
                }
4769
 
 
4770
 
                safe_unpack32(&count, buffer);
4771
 
                if(count != NO_VAL) {
4772
 
                        object_ptr->actor_list = 
4773
 
                                list_create(slurm_destroy_char);
4774
 
                        for(i=0; i<count; i++) {
4775
 
                                safe_unpackstr_xmalloc(&tmp_info,
4776
 
                                                       &uint32_tmp, buffer);
4777
 
                                list_append(object_ptr->actor_list, tmp_info);
4778
 
                        }
4779
 
                }
4780
 
 
4781
 
                safe_unpack32(&count, buffer);
4782
 
                if(count != NO_VAL) {
4783
 
                        object_ptr->cluster_list =
4784
 
                                list_create(slurm_destroy_char);
4785
 
                        for(i=0; i<count; i++) {
4786
 
                                safe_unpackstr_xmalloc(&tmp_info,
4787
 
                                                       &uint32_tmp, buffer);
4788
 
                                list_append(object_ptr->cluster_list, tmp_info);
4789
 
                        }
4790
 
                }
4791
 
 
4792
 
                safe_unpack32(&count, buffer);
4793
 
                if(count != NO_VAL) {
4794
 
                        object_ptr->id_list = list_create(slurm_destroy_char);
4795
 
                        for(i=0; i<count; i++) {
4796
 
                                safe_unpackstr_xmalloc(&tmp_info,
4797
 
                                                       &uint32_tmp, buffer);
4798
 
                                list_append(object_ptr->id_list, tmp_info);
4799
 
                        }
4800
 
                }
4801
 
 
4802
 
                safe_unpack32(&count, buffer);
4803
 
                if(count != NO_VAL) {
4804
 
                        object_ptr->info_list =
4805
 
                                list_create(slurm_destroy_char);
4806
 
                        for(i=0; i<count; i++) {
4807
 
                                safe_unpackstr_xmalloc(&tmp_info,
4808
 
                                                       &uint32_tmp, buffer);
4809
 
                                list_append(object_ptr->info_list, tmp_info);
4810
 
                        }
4811
 
                }
4812
 
 
4813
 
                safe_unpack32(&count, buffer);
4814
 
                if(count != NO_VAL) {
4815
 
                        object_ptr->name_list =
4816
 
                                list_create(slurm_destroy_char);
4817
 
                        for(i=0; i<count; i++) {
4818
 
                                safe_unpackstr_xmalloc(&tmp_info,
4819
 
                                                       &uint32_tmp, buffer);
4820
 
                                list_append(object_ptr->name_list, tmp_info);
4821
 
                        }
4822
 
                }
4823
 
 
4824
 
                safe_unpack32(&object_ptr->time_end, buffer);
4825
 
                safe_unpack32(&object_ptr->time_start, buffer);
 
6254
        if (rpc_version >= 5) {
 
6255
                safe_unpack32(&count, buffer);
 
6256
                if(count != NO_VAL) {
 
6257
                        object_ptr->acct_list =
 
6258
                                list_create(slurm_destroy_char);
 
6259
                        for(i=0; i<count; i++) {
 
6260
                                safe_unpackstr_xmalloc(&tmp_info,
 
6261
                                                       &uint32_tmp, buffer);
 
6262
                                list_append(object_ptr->acct_list, tmp_info);
 
6263
                        }
 
6264
                }
 
6265
 
 
6266
                safe_unpack32(&count, buffer);
 
6267
                if(count != NO_VAL) {
 
6268
                        object_ptr->action_list =
 
6269
                                list_create(slurm_destroy_char);
 
6270
                        for(i=0; i<count; i++) {
 
6271
                                safe_unpackstr_xmalloc(&tmp_info,
 
6272
                                                       &uint32_tmp, buffer);
 
6273
                                list_append(object_ptr->action_list, tmp_info);
 
6274
                        }
 
6275
                }
 
6276
 
 
6277
                safe_unpack32(&count, buffer);
 
6278
                if(count != NO_VAL) {
 
6279
                        object_ptr->actor_list = 
 
6280
                                list_create(slurm_destroy_char);
 
6281
                        for(i=0; i<count; i++) {
 
6282
                                safe_unpackstr_xmalloc(&tmp_info,
 
6283
                                                       &uint32_tmp, buffer);
 
6284
                                list_append(object_ptr->actor_list, tmp_info);
 
6285
                        }
 
6286
                }
 
6287
 
 
6288
                safe_unpack32(&count, buffer);
 
6289
                if(count != NO_VAL) {
 
6290
                        object_ptr->cluster_list =
 
6291
                                list_create(slurm_destroy_char);
 
6292
                        for(i=0; i<count; i++) {
 
6293
                                safe_unpackstr_xmalloc(&tmp_info,
 
6294
                                                       &uint32_tmp, buffer);
 
6295
                                list_append(object_ptr->cluster_list, tmp_info);
 
6296
                        }
 
6297
                }
 
6298
 
 
6299
                safe_unpack32(&count, buffer);
 
6300
                if(count != NO_VAL) {
 
6301
                        object_ptr->id_list = list_create(slurm_destroy_char);
 
6302
                        for(i=0; i<count; i++) {
 
6303
                                safe_unpackstr_xmalloc(&tmp_info,
 
6304
                                                       &uint32_tmp, buffer);
 
6305
                                list_append(object_ptr->id_list, tmp_info);
 
6306
                        }
 
6307
                }
 
6308
 
 
6309
                safe_unpack32(&count, buffer);
 
6310
                if(count != NO_VAL) {
 
6311
                        object_ptr->info_list =
 
6312
                                list_create(slurm_destroy_char);
 
6313
                        for(i=0; i<count; i++) {
 
6314
                                safe_unpackstr_xmalloc(&tmp_info,
 
6315
                                                       &uint32_tmp, buffer);
 
6316
                                list_append(object_ptr->info_list, tmp_info);
 
6317
                        }
 
6318
                }
 
6319
 
 
6320
                safe_unpack32(&count, buffer);
 
6321
                if(count != NO_VAL) {
 
6322
                        object_ptr->name_list =
 
6323
                                list_create(slurm_destroy_char);
 
6324
                        for(i=0; i<count; i++) {
 
6325
                                safe_unpackstr_xmalloc(&tmp_info,
 
6326
                                                       &uint32_tmp, buffer);
 
6327
                                list_append(object_ptr->name_list, tmp_info);
 
6328
                        }
 
6329
                }
 
6330
 
 
6331
                safe_unpack_time(&object_ptr->time_end, buffer);
 
6332
                safe_unpack_time(&object_ptr->time_start, buffer);
 
6333
 
 
6334
                safe_unpack32(&count, buffer);
 
6335
                if(count != NO_VAL) {
 
6336
                        object_ptr->user_list =
 
6337
                                list_create(slurm_destroy_char);
 
6338
                        for(i=0; i<count; i++) {
 
6339
                                safe_unpackstr_xmalloc(&tmp_info,
 
6340
                                                       &uint32_tmp, buffer);
 
6341
                                list_append(object_ptr->user_list, tmp_info);
 
6342
                        }
 
6343
                }
 
6344
 
 
6345
                safe_unpack16(&object_ptr->with_assoc_info, buffer);
 
6346
        } else if (rpc_version >= 3) {
 
6347
                safe_unpack32(&count, buffer);
 
6348
                if(count != NO_VAL) {
 
6349
                        object_ptr->acct_list =
 
6350
                                list_create(slurm_destroy_char);
 
6351
                        for(i=0; i<count; i++) {
 
6352
                                safe_unpackstr_xmalloc(&tmp_info,
 
6353
                                                       &uint32_tmp, buffer);
 
6354
                                list_append(object_ptr->acct_list, tmp_info);
 
6355
                        }
 
6356
                }
 
6357
 
 
6358
                safe_unpack32(&count, buffer);
 
6359
                if(count != NO_VAL) {
 
6360
                        object_ptr->action_list =
 
6361
                                list_create(slurm_destroy_char);
 
6362
                        for(i=0; i<count; i++) {
 
6363
                                safe_unpackstr_xmalloc(&tmp_info,
 
6364
                                                       &uint32_tmp, buffer);
 
6365
                                list_append(object_ptr->action_list, tmp_info);
 
6366
                        }
 
6367
                }
 
6368
 
 
6369
                safe_unpack32(&count, buffer);
 
6370
                if(count != NO_VAL) {
 
6371
                        object_ptr->actor_list = 
 
6372
                                list_create(slurm_destroy_char);
 
6373
                        for(i=0; i<count; i++) {
 
6374
                                safe_unpackstr_xmalloc(&tmp_info,
 
6375
                                                       &uint32_tmp, buffer);
 
6376
                                list_append(object_ptr->actor_list, tmp_info);
 
6377
                        }
 
6378
                }
 
6379
 
 
6380
                safe_unpack32(&count, buffer);
 
6381
                if(count != NO_VAL) {
 
6382
                        object_ptr->cluster_list =
 
6383
                                list_create(slurm_destroy_char);
 
6384
                        for(i=0; i<count; i++) {
 
6385
                                safe_unpackstr_xmalloc(&tmp_info,
 
6386
                                                       &uint32_tmp, buffer);
 
6387
                                list_append(object_ptr->cluster_list, tmp_info);
 
6388
                        }
 
6389
                }
 
6390
 
 
6391
                safe_unpack32(&count, buffer);
 
6392
                if(count != NO_VAL) {
 
6393
                        object_ptr->id_list = list_create(slurm_destroy_char);
 
6394
                        for(i=0; i<count; i++) {
 
6395
                                safe_unpackstr_xmalloc(&tmp_info,
 
6396
                                                       &uint32_tmp, buffer);
 
6397
                                list_append(object_ptr->id_list, tmp_info);
 
6398
                        }
 
6399
                }
 
6400
 
 
6401
                safe_unpack32(&count, buffer);
 
6402
                if(count != NO_VAL) {
 
6403
                        object_ptr->info_list =
 
6404
                                list_create(slurm_destroy_char);
 
6405
                        for(i=0; i<count; i++) {
 
6406
                                safe_unpackstr_xmalloc(&tmp_info,
 
6407
                                                       &uint32_tmp, buffer);
 
6408
                                list_append(object_ptr->info_list, tmp_info);
 
6409
                        }
 
6410
                }
 
6411
 
 
6412
                safe_unpack32(&count, buffer);
 
6413
                if(count != NO_VAL) {
 
6414
                        object_ptr->name_list =
 
6415
                                list_create(slurm_destroy_char);
 
6416
                        for(i=0; i<count; i++) {
 
6417
                                safe_unpackstr_xmalloc(&tmp_info,
 
6418
                                                       &uint32_tmp, buffer);
 
6419
                                list_append(object_ptr->name_list, tmp_info);
 
6420
                        }
 
6421
                }
 
6422
 
 
6423
                safe_unpack32(&uint32_tmp, buffer);
 
6424
                object_ptr->time_end = uint32_tmp;
 
6425
                safe_unpack32(&uint32_tmp, buffer);
 
6426
                object_ptr->time_start = uint32_tmp;
4826
6427
 
4827
6428
                safe_unpack32(&count, buffer);
4828
6429
                if(count != NO_VAL) {
4869
6470
                        }
4870
6471
                }
4871
6472
 
4872
 
                safe_unpack32(&object_ptr->time_end, buffer);
4873
 
                safe_unpack32(&object_ptr->time_start, buffer);
4874
 
        } 
 
6473
                safe_unpack32(&uint32_tmp, buffer);
 
6474
                object_ptr->time_end = uint32_tmp;
 
6475
                safe_unpack32(&uint32_tmp, buffer);
 
6476
                object_ptr->time_start = uint32_tmp;
 
6477
        }
4875
6478
 
4876
6479
        return SLURM_SUCCESS;
4877
6480
 
4888
6491
 
4889
6492
        ListIterator itr = NULL;
4890
6493
        acct_wckey_cond_t *object = (acct_wckey_cond_t *)in;
4891
 
 
4892
 
        if(!object) {
4893
 
                pack32(NO_VAL, buffer);
4894
 
                pack32(NO_VAL, buffer);
4895
 
 
4896
 
                pack32(NO_VAL, buffer);
4897
 
                pack32(NO_VAL, buffer);
4898
 
 
4899
 
                pack32(NO_VAL, buffer);
4900
 
                pack32(NO_VAL, buffer);
4901
 
 
4902
 
                pack16(0, buffer);
4903
 
                pack16(0, buffer);
4904
 
                return;
4905
 
        }
4906
 
 
4907
 
        if(object->cluster_list)
4908
 
                count = list_count(object->cluster_list);
4909
 
        
4910
 
        pack32(count, buffer);
4911
 
        if(count && count != NO_VAL) {
4912
 
                itr = list_iterator_create(object->cluster_list);
4913
 
                while((tmp_info = list_next(itr))) {
4914
 
                        packstr(tmp_info, buffer);
4915
 
                }
4916
 
                list_iterator_destroy(itr);
4917
 
        }
4918
 
        count = NO_VAL;
4919
 
 
4920
 
        if(object->id_list)
4921
 
                count = list_count(object->id_list);
4922
 
        
4923
 
        pack32(count, buffer);
4924
 
        if(count && count != NO_VAL) {
4925
 
                itr = list_iterator_create(object->id_list);
4926
 
                while((tmp_info = list_next(itr))) {
4927
 
                        packstr(tmp_info, buffer);
4928
 
                }
4929
 
        }
4930
 
        count = NO_VAL;
4931
 
 
4932
 
        if(object->name_list)
4933
 
                count = list_count(object->name_list);
4934
 
        
4935
 
        pack32(count, buffer);
4936
 
        if(count && count != NO_VAL) {
4937
 
                itr = list_iterator_create(object->name_list);
4938
 
                while((tmp_info = list_next(itr))) {
4939
 
                        packstr(tmp_info, buffer);
4940
 
                }
4941
 
                list_iterator_destroy(itr);
4942
 
        }
4943
 
        count = NO_VAL;
4944
 
 
4945
 
        pack32(object->usage_end, buffer);
4946
 
        pack32(object->usage_start, buffer);
4947
 
 
4948
 
        if(object->user_list)
4949
 
                count = list_count(object->user_list);
4950
 
        
4951
 
        pack32(count, buffer);
4952
 
        if(count && count != NO_VAL) {
4953
 
                itr = list_iterator_create(object->user_list);
4954
 
                while((tmp_info = list_next(itr))) {
4955
 
                        packstr(tmp_info, buffer);
4956
 
                }
4957
 
                list_iterator_destroy(itr);
4958
 
        }
4959
 
        count = NO_VAL;
4960
 
 
4961
 
        pack16(object->with_usage, buffer);
4962
 
        pack16(object->with_deleted, buffer);
 
6494
        if(rpc_version >= 5) {
 
6495
                if(!object) {
 
6496
                        pack32(NO_VAL, buffer);
 
6497
                        pack32(NO_VAL, buffer);
 
6498
                        pack32(NO_VAL, buffer);
 
6499
 
 
6500
                        pack_time(0, buffer);
 
6501
                        pack_time(0, buffer);
 
6502
 
 
6503
                        pack32(NO_VAL, buffer);
 
6504
 
 
6505
                        pack16(0, buffer);
 
6506
                        pack16(0, buffer);
 
6507
                        return;
 
6508
                }
 
6509
 
 
6510
                if(object->cluster_list)
 
6511
                        count = list_count(object->cluster_list);
 
6512
        
 
6513
                pack32(count, buffer);
 
6514
                if(count && count != NO_VAL) {
 
6515
                        itr = list_iterator_create(object->cluster_list);
 
6516
                        while((tmp_info = list_next(itr))) {
 
6517
                                packstr(tmp_info, buffer);
 
6518
                        }
 
6519
                        list_iterator_destroy(itr);
 
6520
                }
 
6521
                count = NO_VAL;
 
6522
 
 
6523
                if(object->id_list)
 
6524
                        count = list_count(object->id_list);
 
6525
        
 
6526
                pack32(count, buffer);
 
6527
                if(count && count != NO_VAL) {
 
6528
                        itr = list_iterator_create(object->id_list);
 
6529
                        while((tmp_info = list_next(itr))) {
 
6530
                                packstr(tmp_info, buffer);
 
6531
                        }
 
6532
                }
 
6533
                count = NO_VAL;
 
6534
 
 
6535
                if(object->name_list)
 
6536
                        count = list_count(object->name_list);
 
6537
        
 
6538
                pack32(count, buffer);
 
6539
                if(count && count != NO_VAL) {
 
6540
                        itr = list_iterator_create(object->name_list);
 
6541
                        while((tmp_info = list_next(itr))) {
 
6542
                                packstr(tmp_info, buffer);
 
6543
                        }
 
6544
                        list_iterator_destroy(itr);
 
6545
                }
 
6546
                count = NO_VAL;
 
6547
 
 
6548
                pack_time(object->usage_end, buffer);
 
6549
                pack_time(object->usage_start, buffer);
 
6550
 
 
6551
                if(object->user_list)
 
6552
                        count = list_count(object->user_list);
 
6553
        
 
6554
                pack32(count, buffer);
 
6555
                if(count && count != NO_VAL) {
 
6556
                        itr = list_iterator_create(object->user_list);
 
6557
                        while((tmp_info = list_next(itr))) {
 
6558
                                packstr(tmp_info, buffer);
 
6559
                        }
 
6560
                        list_iterator_destroy(itr);
 
6561
                }
 
6562
                count = NO_VAL;
 
6563
 
 
6564
                pack16(object->with_usage, buffer);
 
6565
                pack16(object->with_deleted, buffer);
 
6566
        } else {
 
6567
                if(!object) {
 
6568
                        pack32(NO_VAL, buffer);
 
6569
                        pack32(NO_VAL, buffer);
 
6570
                        pack32(NO_VAL, buffer);
 
6571
 
 
6572
                        pack32(0, buffer);
 
6573
                        pack32(0, buffer);
 
6574
 
 
6575
                        pack32(NO_VAL, buffer);
 
6576
 
 
6577
                        pack16(0, buffer);
 
6578
                        pack16(0, buffer);
 
6579
                        return;
 
6580
                }
 
6581
 
 
6582
                if(object->cluster_list)
 
6583
                        count = list_count(object->cluster_list);
 
6584
        
 
6585
                pack32(count, buffer);
 
6586
                if(count && count != NO_VAL) {
 
6587
                        itr = list_iterator_create(object->cluster_list);
 
6588
                        while((tmp_info = list_next(itr))) {
 
6589
                                packstr(tmp_info, buffer);
 
6590
                        }
 
6591
                        list_iterator_destroy(itr);
 
6592
                }
 
6593
                count = NO_VAL;
 
6594
 
 
6595
                if(object->id_list)
 
6596
                        count = list_count(object->id_list);
 
6597
        
 
6598
                pack32(count, buffer);
 
6599
                if(count && count != NO_VAL) {
 
6600
                        itr = list_iterator_create(object->id_list);
 
6601
                        while((tmp_info = list_next(itr))) {
 
6602
                                packstr(tmp_info, buffer);
 
6603
                        }
 
6604
                }
 
6605
                count = NO_VAL;
 
6606
 
 
6607
                if(object->name_list)
 
6608
                        count = list_count(object->name_list);
 
6609
        
 
6610
                pack32(count, buffer);
 
6611
                if(count && count != NO_VAL) {
 
6612
                        itr = list_iterator_create(object->name_list);
 
6613
                        while((tmp_info = list_next(itr))) {
 
6614
                                packstr(tmp_info, buffer);
 
6615
                        }
 
6616
                        list_iterator_destroy(itr);
 
6617
                }
 
6618
                count = NO_VAL;
 
6619
 
 
6620
                pack32(object->usage_end, buffer);
 
6621
                pack32(object->usage_start, buffer);
 
6622
 
 
6623
                if(object->user_list)
 
6624
                        count = list_count(object->user_list);
 
6625
        
 
6626
                pack32(count, buffer);
 
6627
                if(count && count != NO_VAL) {
 
6628
                        itr = list_iterator_create(object->user_list);
 
6629
                        while((tmp_info = list_next(itr))) {
 
6630
                                packstr(tmp_info, buffer);
 
6631
                        }
 
6632
                        list_iterator_destroy(itr);
 
6633
                }
 
6634
                count = NO_VAL;
 
6635
 
 
6636
                pack16(object->with_usage, buffer);
 
6637
                pack16(object->with_deleted, buffer);
 
6638
        }
4963
6639
}
4964
6640
 
4965
6641
extern int unpack_acct_wckey_cond(void **object, uint16_t rpc_version,
4973
6649
 
4974
6650
        *object = object_ptr;
4975
6651
 
4976
 
        safe_unpack32(&count, buffer);
4977
 
        if(count != NO_VAL) {
4978
 
                object_ptr->cluster_list = 
4979
 
                        list_create(slurm_destroy_char);
4980
 
                for(i=0; i<count; i++) {
4981
 
                        safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
4982
 
                                               buffer);
4983
 
                        list_append(object_ptr->cluster_list, 
4984
 
                                    tmp_info);
4985
 
                }
4986
 
        }
4987
 
 
4988
 
        safe_unpack32(&count, buffer);
4989
 
        if(count != NO_VAL) {
4990
 
                object_ptr->id_list = list_create(slurm_destroy_char);
4991
 
                for(i=0; i<count; i++) {
4992
 
                        safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp, 
4993
 
                                               buffer);
4994
 
                        list_append(object_ptr->id_list, tmp_info);
4995
 
                }
4996
 
        }
4997
 
        
4998
 
        safe_unpack32(&count, buffer);
4999
 
        if(count != NO_VAL) {
5000
 
                object_ptr->name_list = 
5001
 
                        list_create(slurm_destroy_char);
5002
 
                for(i=0; i<count; i++) {
5003
 
                        safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
5004
 
                                               buffer);
5005
 
                        list_append(object_ptr->name_list, tmp_info);
5006
 
                }
5007
 
        }
5008
 
 
5009
 
        safe_unpack32(&object_ptr->usage_end, buffer);
5010
 
        safe_unpack32(&object_ptr->usage_start, buffer);
5011
 
 
5012
 
        safe_unpack32(&count, buffer);
5013
 
        if(count != NO_VAL) {
5014
 
                object_ptr->user_list = 
5015
 
                        list_create(slurm_destroy_char);
5016
 
                for(i=0; i<count; i++) {
5017
 
                        safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
5018
 
                                               buffer);
5019
 
                        list_append(object_ptr->user_list, tmp_info);
5020
 
                }
5021
 
        }
5022
 
 
5023
 
        safe_unpack16(&object_ptr->with_usage, buffer);
5024
 
        safe_unpack16(&object_ptr->with_deleted, buffer);
5025
 
 
 
6652
        if(rpc_version >= 5) {
 
6653
                safe_unpack32(&count, buffer);
 
6654
                if(count != NO_VAL) {
 
6655
                        object_ptr->cluster_list = 
 
6656
                                list_create(slurm_destroy_char);
 
6657
                        for(i=0; i<count; i++) {
 
6658
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
6659
                                                       buffer);
 
6660
                                list_append(object_ptr->cluster_list, 
 
6661
                                            tmp_info);
 
6662
                        }
 
6663
                }
 
6664
 
 
6665
                safe_unpack32(&count, buffer);
 
6666
                if(count != NO_VAL) {
 
6667
                        object_ptr->id_list = list_create(slurm_destroy_char);
 
6668
                        for(i=0; i<count; i++) {
 
6669
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp, 
 
6670
                                                       buffer);
 
6671
                                list_append(object_ptr->id_list, tmp_info);
 
6672
                        }
 
6673
                }
 
6674
        
 
6675
                safe_unpack32(&count, buffer);
 
6676
                if(count != NO_VAL) {
 
6677
                        object_ptr->name_list = 
 
6678
                                list_create(slurm_destroy_char);
 
6679
                        for(i=0; i<count; i++) {
 
6680
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
6681
                                                       buffer);
 
6682
                                list_append(object_ptr->name_list, tmp_info);
 
6683
                        }
 
6684
                }
 
6685
 
 
6686
                safe_unpack_time(&object_ptr->usage_end, buffer);
 
6687
                safe_unpack_time(&object_ptr->usage_start, buffer);
 
6688
 
 
6689
                safe_unpack32(&count, buffer);
 
6690
                if(count != NO_VAL) {
 
6691
                        object_ptr->user_list = 
 
6692
                                list_create(slurm_destroy_char);
 
6693
                        for(i=0; i<count; i++) {
 
6694
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
6695
                                                       buffer);
 
6696
                                list_append(object_ptr->user_list, tmp_info);
 
6697
                        }
 
6698
                }
 
6699
 
 
6700
                safe_unpack16(&object_ptr->with_usage, buffer);
 
6701
                safe_unpack16(&object_ptr->with_deleted, buffer);
 
6702
        } else {
 
6703
                safe_unpack32(&count, buffer);
 
6704
                if(count != NO_VAL) {
 
6705
                        object_ptr->cluster_list = 
 
6706
                                list_create(slurm_destroy_char);
 
6707
                        for(i=0; i<count; i++) {
 
6708
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
6709
                                                       buffer);
 
6710
                                list_append(object_ptr->cluster_list, 
 
6711
                                            tmp_info);
 
6712
                        }
 
6713
                }
 
6714
 
 
6715
                safe_unpack32(&count, buffer);
 
6716
                if(count != NO_VAL) {
 
6717
                        object_ptr->id_list = list_create(slurm_destroy_char);
 
6718
                        for(i=0; i<count; i++) {
 
6719
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp, 
 
6720
                                                       buffer);
 
6721
                                list_append(object_ptr->id_list, tmp_info);
 
6722
                        }
 
6723
                }
 
6724
        
 
6725
                safe_unpack32(&count, buffer);
 
6726
                if(count != NO_VAL) {
 
6727
                        object_ptr->name_list = 
 
6728
                                list_create(slurm_destroy_char);
 
6729
                        for(i=0; i<count; i++) {
 
6730
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
6731
                                                       buffer);
 
6732
                                list_append(object_ptr->name_list, tmp_info);
 
6733
                        }
 
6734
                }
 
6735
 
 
6736
                safe_unpack32(&uint32_tmp, buffer);
 
6737
                object_ptr->usage_end = uint32_tmp;
 
6738
                safe_unpack32(&uint32_tmp, buffer);
 
6739
                object_ptr->usage_start = uint32_tmp;
 
6740
 
 
6741
                safe_unpack32(&count, buffer);
 
6742
                if(count != NO_VAL) {
 
6743
                        object_ptr->user_list = 
 
6744
                                list_create(slurm_destroy_char);
 
6745
                        for(i=0; i<count; i++) {
 
6746
                                safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
 
6747
                                                       buffer);
 
6748
                                list_append(object_ptr->user_list, tmp_info);
 
6749
                        }
 
6750
                }
 
6751
 
 
6752
                safe_unpack16(&object_ptr->with_usage, buffer);
 
6753
                safe_unpack16(&object_ptr->with_deleted, buffer);
 
6754
        }
5026
6755
        return SLURM_SUCCESS;
5027
6756
 
5028
6757
unpack_error:
5038
6767
        if(!object) {
5039
6768
                packnull(buffer);
5040
6769
                pack16((uint16_t)NO_VAL, buffer);
 
6770
                pack16((uint16_t)NO_VAL, buffer);
5041
6771
                packnull(buffer);
5042
6772
                pack16((uint16_t)NO_VAL, buffer);
 
6773
                pack16((uint16_t)NO_VAL, buffer);
5043
6774
                pack_acct_job_cond(NULL, rpc_version, buffer);
5044
6775
                pack16((uint16_t)NO_VAL, buffer);
5045
6776
                pack16((uint16_t)NO_VAL, buffer);
 
6777
                pack16((uint16_t)NO_VAL, buffer);
 
6778
                pack16((uint16_t)NO_VAL, buffer);
5046
6779
                return;
5047
6780
        }
5048
6781
 
5049
6782
        packstr(object->archive_dir, buffer);
 
6783
        pack16(object->archive_events, buffer);
5050
6784
        pack16(object->archive_jobs, buffer);
5051
6785
        packstr(object->archive_script, buffer);
5052
6786
        pack16(object->archive_steps, buffer);
 
6787
        pack16(object->archive_suspend, buffer);
5053
6788
        pack_acct_job_cond(object->job_cond, rpc_version, buffer);
5054
 
        pack16(object->job_purge, buffer);
5055
 
        pack16(object->step_purge, buffer);
 
6789
        pack16(object->purge_event, buffer);
 
6790
        pack16(object->purge_job, buffer);
 
6791
        pack16(object->purge_step, buffer);
 
6792
        pack16(object->purge_suspend, buffer);
5056
6793
}
5057
6794
 
5058
6795
extern int unpack_acct_archive_cond(void **object, uint16_t rpc_version,
5065
6802
        *object = object_ptr;
5066
6803
 
5067
6804
        safe_unpackstr_xmalloc(&object_ptr->archive_dir, &uint32_tmp, buffer);
 
6805
        safe_unpack16(&object_ptr->archive_events, buffer);
5068
6806
        safe_unpack16(&object_ptr->archive_jobs, buffer);
5069
6807
        safe_unpackstr_xmalloc(&object_ptr->archive_script,
5070
6808
                               &uint32_tmp, buffer);
5071
6809
        safe_unpack16(&object_ptr->archive_steps, buffer);
 
6810
        safe_unpack16(&object_ptr->archive_suspend, buffer);
5072
6811
        if(unpack_acct_job_cond((void *)&object_ptr->job_cond,
5073
6812
                                rpc_version, buffer) == SLURM_ERROR)
5074
6813
                goto unpack_error;
5075
 
        safe_unpack16(&object_ptr->job_purge, buffer);
5076
 
        safe_unpack16(&object_ptr->step_purge, buffer);
 
6814
        safe_unpack16(&object_ptr->purge_event, buffer);
 
6815
        safe_unpack16(&object_ptr->purge_job, buffer);
 
6816
        safe_unpack16(&object_ptr->purge_step, buffer);
 
6817
        safe_unpack16(&object_ptr->purge_suspend, buffer);
5077
6818
 
5078
6819
        return SLURM_SUCCESS;
5079
6820
 
5218
6959
                return NULL;
5219
6960
        } else if(!level) {
5220
6961
                debug2("no level");
5221
 
                return "None";
 
6962
                return "";
5222
6963
        }
5223
6964
 
5224
6965
        itr = list_iterator_create(qos_list);
5401
7142
}
5402
7143
 
5403
7144
/* IN/OUT: tree_list a list of acct_print_tree_t's */ 
5404
 
extern char *get_tree_acct_name(char *name, char *parent, char *cluster, 
5405
 
                                List tree_list)
 
7145
extern char *get_tree_acct_name(char *name, char *parent, List tree_list)
5406
7146
{
5407
7147
        ListIterator itr = NULL;
5408
7148
        acct_print_tree_t *acct_print_tree = NULL;
5499
7239
        return print_this;
5500
7240
}
5501
7241
 
 
7242
extern char *get_classification_str(uint16_t class)
 
7243
{
 
7244
        bool classified = class & ACCT_CLASSIFIED_FLAG;
 
7245
        acct_classification_type_t type = class & ACCT_CLASS_BASE;
 
7246
 
 
7247
        switch(type) {
 
7248
        case ACCT_CLASS_NONE:
 
7249
                return NULL;
 
7250
                break;
 
7251
        case ACCT_CLASS_CAPACITY:
 
7252
                if(classified)
 
7253
                        return "*Capacity";
 
7254
                else
 
7255
                        return "Capacity";
 
7256
                break;
 
7257
        case ACCT_CLASS_CAPABILITY:
 
7258
                if(classified)
 
7259
                        return "*Capability";
 
7260
                else
 
7261
                        return "Capability";
 
7262
                break;
 
7263
        case ACCT_CLASS_CAPAPACITY:
 
7264
                if(classified)
 
7265
                        return "*Capapacity";
 
7266
                else
 
7267
                        return "Capapacity";
 
7268
                break;
 
7269
        default:
 
7270
                if(classified)
 
7271
                        return "*Unknown";
 
7272
                else
 
7273
                        return "Unknown";
 
7274
                break;
 
7275
        }
 
7276
}
 
7277
 
 
7278
extern uint16_t str_2_classification(char *class)
 
7279
{
 
7280
        uint16_t type = 0;
 
7281
        if(!class)
 
7282
                return type;
 
7283
 
 
7284
        if(slurm_strcasestr(class, "capac"))
 
7285
                type = ACCT_CLASS_CAPACITY;
 
7286
        else if(slurm_strcasestr(class, "capab"))
 
7287
                type = ACCT_CLASS_CAPABILITY;
 
7288
        else if(slurm_strcasestr(class, "capap"))
 
7289
                type = ACCT_CLASS_CAPAPACITY;
 
7290
        
 
7291
        if(slurm_strcasestr(class, "*")) 
 
7292
                type |= ACCT_CLASSIFIED_FLAG; 
 
7293
        else if(slurm_strcasestr(class, "class")) 
 
7294
                type |= ACCT_CLASSIFIED_FLAG;
 
7295
        
 
7296
        return type;
 
7297
}
5502
7298
 
5503
7299
extern void log_assoc_rec(acct_association_rec_t *assoc_ptr, List qos_list)
5504
7300
{
 
7301
        xassert(assoc_ptr);
 
7302
 
5505
7303
        debug2("association rec id : %u", assoc_ptr->id);
5506
7304
        debug2("  acct             : %s", assoc_ptr->acct);
5507
7305
        debug2("  cluster          : %s", assoc_ptr->cluster);
5508
7306
 
5509
 
        if(assoc_ptr->fairshare == INFINITE)
5510
 
                debug2("  Fairshare        : NONE");
5511
 
        else if(assoc_ptr->fairshare != NO_VAL) 
5512
 
                debug2("  Fairshare        : %u", assoc_ptr->fairshare);
 
7307
        if(assoc_ptr->shares_raw == INFINITE)
 
7308
                debug2("  RawShares        : NONE");
 
7309
        else if(assoc_ptr->shares_raw != NO_VAL) 
 
7310
                debug2("  RawShares        : %u", assoc_ptr->shares_raw);
 
7311
 
 
7312
        if(assoc_ptr->shares_norm != (double)NO_VAL) 
 
7313
                debug2("  NormalizedShares : %f", assoc_ptr->shares_norm);
 
7314
 
 
7315
        if(assoc_ptr->level_shares != NO_VAL) 
 
7316
                debug2("  LevelShares      : %u", assoc_ptr->level_shares);
5513
7317
 
5514
7318
        if(assoc_ptr->grp_cpu_mins == INFINITE)
5515
 
                debug2("  GrpCPUMins      : NONE");
 
7319
                debug2("  GrpCPUMins       : NONE");
5516
7320
        else if(assoc_ptr->grp_cpu_mins != NO_VAL) 
5517
 
                debug2("  GrpCPUMins      : %llu", assoc_ptr->grp_cpu_mins);
 
7321
                debug2("  GrpCPUMins       : %llu", assoc_ptr->grp_cpu_mins);
5518
7322
                
5519
7323
        if(assoc_ptr->grp_cpus == INFINITE)
5520
7324
                debug2("  GrpCPUs          : NONE");
5591
7395
        }
5592
7396
 
5593
7397
        if(assoc_ptr->parent_acct)
5594
 
                debug2("  parent_acct      : %s", assoc_ptr->parent_acct);
 
7398
                debug2("  ParentAccount    : %s", assoc_ptr->parent_acct);
5595
7399
        if(assoc_ptr->partition)
5596
 
                debug2("  partition        : %s", assoc_ptr->partition);
 
7400
                debug2("  Partition        : %s", assoc_ptr->partition);
5597
7401
        if(assoc_ptr->user)
5598
 
                debug2("  user             : %s(%u)",
 
7402
                debug2("  User             : %s(%u)",
5599
7403
                       assoc_ptr->user, assoc_ptr->uid);
5600
 
        debug2("  used_jobs        : %u", assoc_ptr->used_jobs);
5601
 
        debug2("  used_shares      : %u", assoc_ptr->used_shares);
 
7404
        debug2("  UsedJobs        : %u", assoc_ptr->used_jobs);
 
7405
        debug2("  RawUsage        : %Lf", assoc_ptr->usage_raw);
5602
7406
}
5603
7407
 
5604
7408
/*
5741
7545
                (db_conn, uid, wckey_list);
5742
7546
}
5743
7547
 
 
7548
extern int acct_storage_g_add_reservation(void *db_conn,
 
7549
                                           acct_reservation_rec_t *resv)
 
7550
{
 
7551
        if (slurm_acct_storage_init(NULL) < 0)
 
7552
                return NO_VAL;
 
7553
        return (*(g_acct_storage_context->ops.add_reservation))
 
7554
                (db_conn, resv);
 
7555
}
 
7556
 
5744
7557
extern List acct_storage_g_modify_users(void *db_conn, uint32_t uid,
5745
7558
                                        acct_user_cond_t *user_cond,
5746
7559
                                        acct_user_rec_t *user)
5802
7615
                (db_conn, uid, wckey_cond, wckey);
5803
7616
}
5804
7617
 
 
7618
extern int acct_storage_g_modify_reservation(void *db_conn,
 
7619
                                           acct_reservation_rec_t *resv)
 
7620
{
 
7621
        if (slurm_acct_storage_init(NULL) < 0)
 
7622
                return NO_VAL;
 
7623
        return (*(g_acct_storage_context->ops.modify_reservation))
 
7624
                (db_conn, resv);
 
7625
}
 
7626
 
5805
7627
extern List acct_storage_g_remove_users(void *db_conn, uint32_t uid,
5806
7628
                                        acct_user_cond_t *user_cond)
5807
7629
{
5867
7689
                (db_conn, uid, wckey_cond);
5868
7690
}
5869
7691
 
 
7692
extern int acct_storage_g_remove_reservation(void *db_conn,
 
7693
                                             acct_reservation_rec_t *resv)
 
7694
{
 
7695
        if (slurm_acct_storage_init(NULL) < 0)
 
7696
                return NO_VAL;
 
7697
        return (*(g_acct_storage_context->ops.remove_reservation))
 
7698
                (db_conn, resv);
 
7699
}
 
7700
 
5870
7701
extern List acct_storage_g_get_users(void *db_conn, uint32_t uid,
5871
7702
                                     acct_user_cond_t *user_cond)
5872
7703
{
5894
7725
                (db_conn, uid, cluster_cond);
5895
7726
}
5896
7727
 
 
7728
extern List acct_storage_g_get_config(void *db_conn)
 
7729
{
 
7730
        if (slurm_acct_storage_init(NULL) < 0)
 
7731
                return NULL;
 
7732
        return (*(g_acct_storage_context->ops.get_config))(db_conn);
 
7733
}
 
7734
 
5897
7735
extern List acct_storage_g_get_associations(void *db_conn, uint32_t uid,
5898
7736
                                            acct_association_cond_t *assoc_cond)
5899
7737
{
5920
7758
                                                           wckey_cond);
5921
7759
}
5922
7760
 
 
7761
extern List acct_storage_g_get_reservations(void *db_conn, uint32_t uid, 
 
7762
                                      acct_reservation_cond_t *resv_cond)
 
7763
{
 
7764
        if (slurm_acct_storage_init(NULL) < 0)
 
7765
                return NULL;
 
7766
        return (*(g_acct_storage_context->ops.get_resvs))(db_conn, uid,
 
7767
                                                          resv_cond);
 
7768
}
 
7769
 
5923
7770
extern List acct_storage_g_get_txn(void *db_conn,  uint32_t uid, 
5924
7771
                                   acct_txn_cond_t *txn_cond)
5925
7772
{
5939
7786
}
5940
7787
 
5941
7788
extern int acct_storage_g_roll_usage(void *db_conn, 
5942
 
                                     time_t sent_start)
 
7789
                                     time_t sent_start, time_t sent_end,
 
7790
                                     uint16_t archive_data)
5943
7791
{
5944
7792
        if (slurm_acct_storage_init(NULL) < 0)
5945
7793
                return SLURM_ERROR;
5946
 
        return (*(g_acct_storage_context->ops.roll_usage))(db_conn, sent_start);
 
7794
        return (*(g_acct_storage_context->ops.roll_usage))
 
7795
                (db_conn, sent_start, sent_end, archive_data);
5947
7796
}
5948
7797
 
5949
7798
extern int clusteracct_storage_g_node_down(void *db_conn,
5972
7821
 
5973
7822
extern int clusteracct_storage_g_cluster_procs(void *db_conn,
5974
7823
                                               char *cluster,
 
7824
                                               char *cluster_nodes,
5975
7825
                                               uint32_t procs,
5976
7826
                                               time_t event_time)
5977
7827
{
5978
7828
        if (slurm_acct_storage_init(NULL) < 0)
5979
7829
                return SLURM_ERROR;
5980
7830
        return (*(g_acct_storage_context->ops.cluster_procs))
5981
 
                (db_conn, cluster, procs, event_time);
 
7831
                (db_conn, cluster, cluster_nodes, procs, event_time);
5982
7832
}
5983
7833
 
5984
7834