@@ -300,6 +300,14 @@ int AM_ACCOUNT::parse(XML_PARSER& xp) {
300300 safe_strcpy (url_signature, " " );
301301 authenticator.clear ();
302302 resource_share.init ();
303+ user_avg_ec = 0 ;
304+ user_total_ec = 0 ;
305+ cpu_ec = 0 ;
306+ cpu_time = 0 ;
307+ gpu_ec = 0 ;
308+ gpu_time = 0 ;
309+ njobs_success = 0 ;
310+ njobs_error = 0 ;
303311
304312 while (!xp.get_tag ()) {
305313 if (!xp.is_tag ) {
@@ -325,6 +333,14 @@ int AM_ACCOUNT::parse(XML_PARSER& xp) {
325333 if (xp.parse_string (" authenticator" , authenticator)) continue ;
326334 if (xp.parse_bool (" detach" , detach)) continue ;
327335 if (xp.parse_bool (" update" , update)) continue ;
336+ if (xp.parse_double (" user_avg_ec" , user_avg_ec)) continue ;
337+ if (xp.parse_double (" user_total_ec" , user_total_ec)) continue ;
338+ if (xp.parse_double (" cpu_ec" , cpu_ec)) continue ;
339+ if (xp.parse_double (" cpu_time" , cpu_time)) continue ;
340+ if (xp.parse_double (" gpu_ec" , gpu_ec)) continue ;
341+ if (xp.parse_double (" gpu_time" , gpu_time)) continue ;
342+ if (xp.parse_int (" njobs_success" , njobs_success)) continue ;
343+ if (xp.parse_int (" njobs_error" , njobs_error)) continue ;
328344 if (xp.parse_bool (" no_cpu" , btemp)) {
329345 handle_no_rsc (" CPU" , btemp);
330346 continue ;
@@ -652,6 +668,10 @@ void ACCT_MGR_OP::handle_reply(int http_op_retval) {
652668 for (const AM_ACCOUNT& acct: accounts) {
653669 pp = gstate.lookup_project (acct.url .c_str ());
654670 if (pp) {
671+ if (gstate.acct_mgr_info .dynamic ) {
672+ pp->user_expavg_credit = acct.user_avg_ec ;
673+ pp->user_total_credit = acct.user_total_ec ;
674+ }
655675 if (acct.detach ) {
656676 if (pp->attached_via_acct_mgr ) {
657677 gstate.detach_project (pp);
@@ -781,6 +801,21 @@ void ACCT_MGR_OP::handle_reply(int http_op_retval) {
781801 if (acct.suspend .present && acct.suspend .value ) {
782802 pp->suspend ();
783803 }
804+
805+ // The AM supplies initial accounting info
806+ // (in case the client was previously attached,
807+ // then detached).
808+ //
809+ if (gstate.acct_mgr_info .dynamic ) {
810+ pp->user_expavg_credit = acct.user_avg_ec ;
811+ pp->user_total_credit = acct.user_total_ec ;
812+ pp->cpu_ec = acct.cpu_ec ;
813+ pp->cpu_time = acct.cpu_time ;
814+ pp->gpu_ec = acct.gpu_ec ;
815+ pp->gpu_time = acct.gpu_time ;
816+ pp->njobs_success = acct.njobs_success ;
817+ pp->njobs_error = acct.njobs_error ;
818+ }
784819 } else {
785820 msg_printf (NULL , MSG_INTERNAL_ERROR,
786821 " Failed to add project: %s" ,
0 commit comments