Skip to content
Snippets Groups Projects
Commit f3cfe970 authored by Moe Jette's avatar Moe Jette
Browse files

Remove local timer functions

Remove local timer functions and make use of functions in src/common/timers.[ch]
parent 6e18da64
No related branches found
No related tags found
No related merge requests found
...@@ -117,8 +117,6 @@ static void _add_reservation(uint32_t start_time, uint32_t end_reserve, ...@@ -117,8 +117,6 @@ static void _add_reservation(uint32_t start_time, uint32_t end_reserve,
node_space_map_t *node_space, node_space_map_t *node_space,
int *node_space_recs); int *node_space_recs);
static int _attempt_backfill(void); static int _attempt_backfill(void);
static void _diff_tv_str(struct timeval *tv1,struct timeval *tv2,
char *tv_str, int len_tv_str);
static bool _job_is_completing(void); static bool _job_is_completing(void);
static void _load_config(void); static void _load_config(void);
static bool _many_pending_rpcs(void); static bool _many_pending_rpcs(void);
...@@ -157,22 +155,6 @@ static void _dump_node_space_table(node_space_map_t *node_space_ptr) ...@@ -157,22 +155,6 @@ static void _dump_node_space_table(node_space_map_t *node_space_ptr)
info("========================================="); info("=========================================");
} }
/*
* _diff_tv_str - build a string showing the time difference between two times
* IN tv1 - start of event
* IN tv2 - end of event
* OUT tv_str - place to put delta time in format "usec=%ld"
* IN len_tv_str - size of tv_str in bytes
*/
static void _diff_tv_str(struct timeval *tv1,struct timeval *tv2,
char *tv_str, int len_tv_str)
{
long delta_t;
delta_t = (tv2->tv_sec - tv1->tv_sec) * 1000000;
delta_t += tv2->tv_usec - tv1->tv_usec;
snprintf(tv_str, len_tv_str, "usec=%ld", delta_t);
}
/* /*
* _job_is_completing - Determine if jobs are in the process of completing. * _job_is_completing - Determine if jobs are in the process of completing.
* This is a variant of job_is_completing in slurmctld/job_scheduler.c. * This is a variant of job_is_completing in slurmctld/job_scheduler.c.
...@@ -394,8 +376,7 @@ extern void backfill_reconfig(void) ...@@ -394,8 +376,7 @@ extern void backfill_reconfig(void)
/* backfill_agent - detached thread periodically attempts to backfill jobs */ /* backfill_agent - detached thread periodically attempts to backfill jobs */
extern void *backfill_agent(void *args) extern void *backfill_agent(void *args)
{ {
struct timeval tv1, tv2; DEF_TIMERS;
char tv_str[20];
time_t now; time_t now;
double wait_time; double wait_time;
static time_t last_backfill_time = 0; static time_t last_backfill_time = 0;
...@@ -420,15 +401,14 @@ extern void *backfill_agent(void *args) ...@@ -420,15 +401,14 @@ extern void *backfill_agent(void *args)
!avail_front_end() || !_more_work(last_backfill_time)) !avail_front_end() || !_more_work(last_backfill_time))
continue; continue;
gettimeofday(&tv1, NULL); START_TIMER;
lock_slurmctld(all_locks); lock_slurmctld(all_locks);
while (_attempt_backfill()) ; while (_attempt_backfill()) ;
last_backfill_time = time(NULL); last_backfill_time = time(NULL);
unlock_slurmctld(all_locks); unlock_slurmctld(all_locks);
gettimeofday(&tv2, NULL); END_TIMER;
_diff_tv_str(&tv1, &tv2, tv_str, 20);
if (debug_flags & DEBUG_FLAG_BACKFILL) if (debug_flags & DEBUG_FLAG_BACKFILL)
info("backfill: completed, %s", tv_str); info("backfill: completed, %s", TIME_STR);
} }
return NULL; return NULL;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment