diff --git a/src/slurmd/common/slurmstepd_init.h b/src/slurmd/common/slurmstepd_init.h index 0d800979c3ca6b52f6aefa7ee4ec3ec7c77c8ca4..1f7c3c4ed98e7b43ef8267fb85e6960234abfbc5 100644 --- a/src/slurmd/common/slurmstepd_init.h +++ b/src/slurmd/common/slurmstepd_init.h @@ -53,6 +53,7 @@ //#define SLURMSTEPD_MEMCHECK 1 /* Run slurmstepd with memcheck */ //#define SLURMSTEPD_MEMCHECK 2 /* Run slurmstepd with valgrind/memcheck */ //#define SLURMSTEPD_MEMCHECK 3 /* Run slurmstepd with valgrind/drd */ +//#define SLURMSTEPD_MEMCHECK 4 /* Run slurmstepd with valgrind/helgrind */ typedef enum slurmd_step_tupe { LAUNCH_BATCH_JOB = 0, diff --git a/src/slurmd/slurmd/req.c b/src/slurmd/slurmd/req.c index ad2ce40b76a72530daecd141a19bca1abb6fc8a6..3b26a27cc4b5936b7c26de90901cbf5b92ef15c0 100644 --- a/src/slurmd/slurmd/req.c +++ b/src/slurmd/slurmd/req.c @@ -850,7 +850,7 @@ _forkexec_slurmstepd(uint16_t type, void *req, "--log-file=/tmp/slurmstepd_valgrind_%u.%u", job_id, step_id); #elif (SLURMSTEPD_MEMCHECK == 3) - /* valgrind test of slurmstepd, option #2 */ + /* valgrind/drd test of slurmstepd, option #3 */ uint32_t job_id = 0, step_id = 0; char log_file[256]; char *const argv[10] = {"valgrind", "--tool=drd", @@ -870,6 +870,27 @@ _forkexec_slurmstepd(uint16_t type, void *req, snprintf(log_file, sizeof(log_file), "--log-file=/tmp/slurmstepd_valgrind_%u.%u", job_id, step_id); +#elif (SLURMSTEPD_MEMCHECK == 4) + /* valgrind/helgrind test of slurmstepd, option #4 */ + uint32_t job_id = 0, step_id = 0; + char log_file[256]; + char *const argv[10] = {"valgrind", "--tool=helgrind", + "--error-limit=no", + "--max-stackframe=16777216", + "--num-callers=20", + "--child-silent-after-fork=yes", + log_file, (char *)conf->stepd_loc, + NULL}; + if (type == LAUNCH_BATCH_JOB) { + job_id = ((batch_job_launch_msg_t *)req)->job_id; + step_id = ((batch_job_launch_msg_t *)req)->step_id; + } else if (type == LAUNCH_TASKS) { + job_id = ((launch_tasks_request_msg_t *)req)->job_id; + step_id = ((launch_tasks_request_msg_t *)req)->job_step_id; + } + snprintf(log_file, sizeof(log_file), + "--log-file=/tmp/slurmstepd_valgrind_%u.%u", + job_id, step_id); #else /* no memory checking, default */ char *const argv[2] = { (char *)conf->stepd_loc, NULL};