Skip to content

Commit

Permalink
sim: added skipping sim_sched_thread_cond_wait_tillemoved if sched_re…
Browse files Browse the repository at this point in the history
…quests == 0
  • Loading branch information
nsimakov committed May 26, 2023
1 parent d5cfb09 commit 20bfce6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ TAGS
tags
# local build
/build/
/build_opt/
# IDE
/.cproject
/.project
Expand Down
1 change: 1 addition & 0 deletions contribs/sim/sim_comm.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ extern void * (*sim_decay_thread_ref)(void *no_data);
extern uint64_t (*sim_backfill_agent_ref)(void);

extern int64_t sim_slurmdbd_agent_sleep_till;
extern int64_t sim_slurmdbd_agent_count;

extern void (*sim_slurmctld_req_ref)(slurm_msg_t *msg);

Expand Down
2 changes: 1 addition & 1 deletion contribs/sim/sim_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int64_t sim_constructor_start_time=0;


int64_t sim_slurmdbd_agent_sleep_till = 0;

int64_t sim_slurmdbd_agent_count = 0;

slurm_msg_t * sim_request_msg = NULL;;
slurm_msg_t * sim_response_msg = NULL;
Expand Down
6 changes: 5 additions & 1 deletion contribs/sim/slurmctld_controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,10 +547,14 @@ int64_t sim_events_loop()
}
}
//
if(sim_slurmdbd_agent_sleep_till <= now) {
if(sim_slurmdbd_agent_sleep_till <= now || sim_slurmdbd_agent_count >= 100) {
if(sim_slurmdbd_agent_ref!=NULL) {
(*sim_slurmdbd_agent_ref)(NULL);
sim_slurmdbd_agent_count = 0;
now = get_sim_utime();
if(sim_slurmdbd_agent_sleep_till <= now) {
sim_slurmdbd_agent_sleep_till = now + 5*USEC_IN_SEC;
}
}
}
// run main scheduler if needed
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/accounting_storage/slurmdbd/slurmdbd_agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,8 @@ extern int slurmdbd_agent_send(uint16_t rpc_version, persist_msg_t *req)
}

#ifdef SLURM_SIMULATOR
sim_slurmdbd_agent_sleep_till = get_sim_utime();
//sim_slurmdbd_agent_sleep_till = get_sim_utime();
sim_slurmdbd_agent_count = cnt;
#endif
slurm_cond_broadcast(&agent_cond);
slurm_mutex_unlock(&agent_lock);
Expand Down

0 comments on commit 20bfce6

Please sign in to comment.