/**************************************************************************\ * 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) { switch_g_node_fini(); jobacct_gather_fini(); acct_gather_profile_fini(); 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(); slurmd_req(NULL); /* purge memory allocated by slurmd_req() */ fini_setproctitle(); slurm_select_fini(); spank_slurmd_exit(); cpu_freq_fini(); job_container_fini(); acct_gather_conf_destroy(); return SLURM_SUCCESS; }
extern int stepd_cleanup(slurm_msg_t *msg, stepd_step_rec_t *job, slurm_addr_t *cli, slurm_addr_t *self, int rc, bool only_mem) { if (!only_mem) { if (job->batch) batch_finish(job, rc); /* sends batch complete message */ /* signal the message thread to shutdown, and wait for it */ eio_signal_shutdown(job->msg_handle); pthread_join(job->msgid, NULL); } mpi_fini(); /* Remove stale PMI2 sockets */ #ifdef MEMORY_LEAK_DEBUG acct_gather_conf_destroy(); (void) core_spec_g_fini(); _step_cleanup(job, msg, rc); fini_setproctitle(); xfree(cli); xfree(self); xfree(conf->block_map); xfree(conf->block_map_inv); xfree(conf->hostname); xfree(conf->job_acct_gather_freq); xfree(conf->job_acct_gather_type); xfree(conf->logfile); xfree(conf->node_name); xfree(conf->node_topo_addr); xfree(conf->node_topo_pattern); xfree(conf->spooldir); xfree(conf->task_epilog); xfree(conf->task_prolog); xfree(conf); #endif info("done with job"); return rc; }