From 20bd445218913c035bdaa0c822a7d06cd73bb14e Mon Sep 17 00:00:00 2001
From: Morris Jette <jette@schedmd.com>
Date: Thu, 15 May 2014 16:00:35 -0700
Subject: [PATCH] Remove cpu_freq from suspend/resume RPC

The suspend/resume is performed on a per-job basis, but the cpu_freq
is set on a per job step basis. This is a partial reversion of
commit 5e40f62719d5bff23b7cae5598a4a352a9f462e3
---
 src/common/slurm_protocol_defs.h |  1 -
 src/common/slurm_protocol_pack.c |  2 --
 src/common/stepd_api.c           |  2 --
 src/slurmd/slurmstepd/req.c      | 15 ++++-----------
 4 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/src/common/slurm_protocol_defs.h b/src/common/slurm_protocol_defs.h
index aaee35df169..ab8de12338c 100644
--- a/src/common/slurm_protocol_defs.h
+++ b/src/common/slurm_protocol_defs.h
@@ -993,7 +993,6 @@ typedef struct forward_data_msg {
 
 /* suspend_msg_t variant for internal slurm daemon communications */
 typedef struct suspend_int_msg {
-	uint32_t cpu_freq;	/* requested cpu frequency */
 	uint8_t  indf_susp;     /* non-zero if being suspended indefinitely */
 	uint16_t job_core_spec;	/* Count of specialized cores */
 	uint32_t job_id;        /* slurm job_id */
diff --git a/src/common/slurm_protocol_pack.c b/src/common/slurm_protocol_pack.c
index 9cced3e682a..c5ba86f4dd6 100644
--- a/src/common/slurm_protocol_pack.c
+++ b/src/common/slurm_protocol_pack.c
@@ -9964,7 +9964,6 @@ static void _pack_suspend_int_msg(suspend_int_msg_t *msg, Buf buffer,
 {
 	xassert ( msg != NULL );
 	if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
-		pack32(msg->cpu_freq, buffer);
 		pack8(msg->indf_susp, buffer);
 		pack16(msg->job_core_spec, buffer);
 		pack32(msg->job_id,  buffer);
@@ -9997,7 +9996,6 @@ static int  _unpack_suspend_int_msg(suspend_int_msg_t **msg_ptr, Buf buffer,
 	*msg_ptr = msg ;
 
 	if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
-		safe_unpack32(&msg->cpu_freq, buffer);
 		safe_unpack8(&msg->indf_susp, buffer);
 		safe_unpack16(&msg->job_core_spec, buffer);
 		safe_unpack32(&msg->job_id, buffer);
diff --git a/src/common/stepd_api.c b/src/common/stepd_api.c
index 844fa5865ee..7b8404d52c9 100644
--- a/src/common/stepd_api.c
+++ b/src/common/stepd_api.c
@@ -732,7 +732,6 @@ stepd_suspend(int fd, suspend_int_msg_t *susp_req, int phase)
 
 	if (phase == 0) {
 		safe_write(fd, &req, sizeof(int));
-		safe_write(fd, &susp_req->cpu_freq, sizeof(uint32_t));
 		safe_write(fd, &susp_req->job_core_spec, sizeof(uint16_t));
 	} else {
 		/* Receive the return code and errno */
@@ -763,7 +762,6 @@ stepd_resume(int fd, suspend_int_msg_t *susp_req, int phase)
 
 	if (phase == 0) {
 		safe_write(fd, &req, sizeof(int));
-		safe_write(fd, &susp_req->cpu_freq, sizeof(uint32_t));
 		safe_write(fd, &susp_req->job_core_spec, sizeof(uint16_t));
 	} else {
 		/* Receive the return code and errno */
diff --git a/src/slurmd/slurmstepd/req.c b/src/slurmd/slurmstepd/req.c
index dcbc1ebae6c..8e63e046449 100644
--- a/src/slurmd/slurmstepd/req.c
+++ b/src/slurmd/slurmstepd/req.c
@@ -1122,14 +1122,12 @@ _handle_suspend(int fd, stepd_step_rec_t *job, uid_t uid)
 	static int launch_poe = -1;
 	int rc = SLURM_SUCCESS;
 	int errnum = 0;
-	uint32_t cpu_freq = 0;
 	uint16_t job_core_spec = 0;
 
-	safe_read(fd, &cpu_freq, sizeof(uint32_t));
 	safe_read(fd, &job_core_spec, sizeof(uint16_t));
 
-	debug("_handle_suspend for step:%u.%u uid:%ld cpu_freq:%u core_spec:%u",
-	      job->jobid, job->stepid, (long)uid, cpu_freq, job_core_spec);
+	debug("_handle_suspend for step:%u.%u uid:%ld core_spec:%u",
+	      job->jobid, job->stepid, (long)uid, job_core_spec);
 
 	if (!_slurm_authorized_user(uid)) {
 		debug("job step suspend request from uid %ld for job %u.%u ",
@@ -1196,9 +1194,6 @@ _handle_suspend(int fd, stepd_step_rec_t *job, uid_t uid)
 	}
 	if (core_spec_g_suspend(job->cont_id, job_core_spec))
 		error("core_spec_g_suspend: %m");
-	/* reset the cpu frequencies if cpu_freq option used */
-	if (job->cpu_freq != NO_VAL)
-		cpu_freq_reset(job);
 
 	pthread_mutex_unlock(&suspend_mutex);
 
@@ -1216,14 +1211,12 @@ _handle_resume(int fd, stepd_step_rec_t *job, uid_t uid)
 {
 	int rc = SLURM_SUCCESS;
 	int errnum = 0;
-	uint32_t cpu_freq = 0;
 	uint16_t job_core_spec = 0;
 
-	safe_read(fd, &cpu_freq, sizeof(uint32_t));
 	safe_read(fd, &job_core_spec, sizeof(uint16_t));
 
-	debug("_handle_resume for step:%u.%u uid:%ld cpu_freq:%u core_spec:%u",
-	      job->jobid, job->stepid, (long)uid, cpu_freq, job_core_spec);
+	debug("_handle_resume for step:%u.%u uid:%ld core_spec:%u",
+	      job->jobid, job->stepid, (long)uid, job_core_spec);
 
 	if (!_slurm_authorized_user(uid)) {
 		debug("job step resume request from uid %ld for job %u.%u ",
-- 
GitLab