extern int fini ( void ) { if (_run_in_daemon()) { /* just to make sure it closes things up since we call it * from here */ acct_gather_energy_fini(); } return SLURM_SUCCESS; }
extern int acct_gather_conf_destroy(void) { int rc; if (!inited) return SLURM_SUCCESS; rc = acct_gather_energy_fini(); rc = MAX(rc, acct_gather_filesystem_fini()); rc = MAX(rc, acct_gather_infiniband_fini()); rc = MAX(rc, acct_gather_profile_fini()); return rc; }
extern int fini (void) { if (_run_in_daemon()) { jobacct_gather_cgroup_cpuacct_fini(&slurm_cgroup_conf); jobacct_gather_cgroup_memory_fini(&slurm_cgroup_conf); /* jobacct_gather_cgroup_blkio_fini(&slurm_cgroup_conf); */ acct_gather_energy_fini(); /* unload configuration */ free_slurm_cgroup_conf(&slurm_cgroup_conf); } return SLURM_SUCCESS; }
extern int acct_gather_profile_fini(void) { int rc = SLURM_SUCCESS, i; if (!g_context) return SLURM_SUCCESS; slurm_mutex_lock(&g_context_lock); if (!g_context) goto done; init_run = false; for (i=0; i < PROFILE_CNT; i++) { switch (i) { case PROFILE_ENERGY: acct_gather_energy_fini(); break; case PROFILE_TASK: jobacct_gather_fini(); break; case PROFILE_FILESYSTEM: acct_gather_filesystem_fini(); break; case PROFILE_NETWORK: acct_gather_infiniband_fini(); break; default: fatal("Unhandled profile option %d please update " "slurm_acct_gather_profile.c " "(acct_gather_profile_fini)", i); } } if (timer_thread_id) { pthread_cancel(timer_thread_id); pthread_join(timer_thread_id, NULL); } rc = plugin_context_destroy(g_context); g_context = NULL; done: slurm_mutex_unlock(&g_context_lock); return rc; }
/**************************************************************************\ * To test for memory leaks, set MEMORY_LEAK_DEBUG to 1 using * "configure --enable-memory-leak-debug" then execute * $ valgrind --tool=memcheck --leak-check=yes --num-callers=8 \ * --leak-resolution=med ./slurmd -Dc >valg.slurmd.out 2>&1 * * Then exercise the slurmd functionality before executing * > scontrol shutdown * * All allocated memory should be freed \**************************************************************************/ static int _slurmd_fini(void) { save_cred_state(conf->vctx); switch_fini(); slurmd_task_fini(); slurm_conf_destroy(); slurm_proctrack_fini(); slurm_auth_fini(); node_fini2(); gres_plugin_fini(); slurm_topo_fini(); acct_gather_energy_fini(); slurmd_req(NULL); /* purge memory allocated by slurmd_req() */ fini_setproctitle(); slurm_select_fini(); spank_slurmd_exit(); cpu_freq_fini(); job_container_fini(); return SLURM_SUCCESS; }