diff --git a/src/common/slurm_protocol_defs.h b/src/common/slurm_protocol_defs.h index 4cfa822b71253ea0a8baca9d9abb6ac1d6f943d3..97d7d17f715fc85a60cd2d706c0d28e6dc747ba0 100644 --- a/src/common/slurm_protocol_defs.h +++ b/src/common/slurm_protocol_defs.h @@ -1,3 +1,29 @@ +/****************************************************************************\ + * slurm_protocol_defs.h - definitions used for RPCs + ***************************************************************************** + * Copyright (C) 2002 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Kevin Tew <tew1@llnl.gov>. + * UCRL-CODE-2002-040. + * + * This file is part of SLURM, a resource management program. + * For details, see <http://www.llnl.gov/linux/slurm/>. + * + * SLURM is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along + * with SLURM; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +\*****************************************************************************/ + #ifndef _SLURM_PROTOCOL_DEFS_H #define _SLURM_PROTOCOL_DEFS_H @@ -71,6 +97,25 @@ typedef enum { test1, test2 #define REQUEST_RECONFIGURE 1011 #define RESPONSE_RECONFIGURE 1012 +#define REQUEST_BUILD_INFO 3011 +#define RESPONSE_BUILD_INFO 3012 +#define REQUEST_JOB_INFO 3021 +#define RESPONSE_JOB_INFO 3022 +#define REQUEST_JOB_STEP_INFO 3031 +#define RESPONSE_JOB_STEP_INFO 3032 +#define REQUEST_NODE_INFO 3041 +#define RESPONSE_NODE_INFO 3042 +#define REQUEST_PARTITION_INFO 3051 +#define RESPONSE_PARTITION_INFO 3052 +#define REQUEST_ACCTING_INFO 3061 +#define RESPONSE_ACCOUNTING_INFO 3062 +#define REQUEST_GET_JOB_STEP_INFO 3071 +#define RESPONSE_GET_JOB_STEP_INFO 3072 + +#define REQUEST_UPDATE_JOB 3081 +#define REQUEST_UPDATE_NODE 3082 +#define REQUEST_UPDATE_PARTITION 3083 + #define REQUEST_RESOURCE_ALLOCATION 4001 #define RESPONSE_RESOURCE_ALLOCATION 4002 #define REQUEST_SUBMIT_BATCH_JOB 4011 @@ -91,24 +136,6 @@ typedef enum { test1, test2 #define RESPONSE_JOB_WILL_RUN 4082 #define MESSAGE_REVOKE_JOB_CREDENTIAL 4901 -#define REQUEST_BUILD_INFO 3011 -#define RESPONSE_BUILD_INFO 3012 -#define REQUEST_JOB_INFO 3021 -#define RESPONSE_JOB_INFO 3022 -#define REQUEST_JOB_STEP_INFO 3031 -#define RESPONSE_JOB_STEP_INFO 3032 -#define REQUEST_NODE_INFO 3041 -#define RESPONSE_NODE_INFO 3042 -#define REQUEST_PARTITION_INFO 3051 -#define RESPONSE_PARTITION_INFO 3052 -#define REQUEST_ACCTING_INFO 3061 -#define RESPONSE_ACCOUNTING_INFO 3062 -#define REQUEST_GET_JOB_STEP_INFO 3071 -#define RESPONSE_GET_JOB_STEP_INFO 3072 - -#define REQUEST_UPDATE_NODE 3081 -#define REQUEST_UPDATE_PARTITION 3091 - #define REQUEST_CREATE_JOB_STEP 5001 #define RESPONSE_CREATE_JOB_STEP 5002 #define REQUEST_RUN_JOB_STEP 5011 diff --git a/src/common/slurm_protocol_errno.c b/src/common/slurm_protocol_errno.c index 241af73df2e599a0ae6d186eba81e8451811fb8e..5b6848867eabec843420db0ac7fea51442299fd1 100644 --- a/src/common/slurm_protocol_errno.c +++ b/src/common/slurm_protocol_errno.c @@ -38,6 +38,9 @@ static slurm_errtab_t slurm_errtab[] = { { ESLURM_NOT_TOP_PRIORITY, "Immediate execution impossible, higher priority jobs pending" }, { ESLURM_REQUESTED_NODE_CONFIGURATION_UNAVAILBLE, "Requested node configuration is not available" }, { ESLURM_NODES_BUSY, "Requested nodes are busy" }, + { ESLURM_INVALID_JOB_ID, "Invalid job id specified" }, + { ESLURM_INVALID_NODE_NAMES, "Invalid node name specified" }, + { ESLURM_INVALID_PARTITION, "Invalid partition name specified" }, /* partition_mgr.c/update_part */ { ESLURM_INVALID_PARTITION_NAME, "Invalid partition name specified" }, diff --git a/src/common/slurm_protocol_errno.h b/src/common/slurm_protocol_errno.h index f57778805b0adfe442fb136ba6686f8cd008ef03..af05de7b728b8660ce22e884f301a50cbe675daa 100644 --- a/src/common/slurm_protocol_errno.h +++ b/src/common/slurm_protocol_errno.h @@ -35,6 +35,9 @@ #define ESLURM_NOT_TOP_PRIORITY -2014 #define ESLURM_REQUESTED_NODE_CONFIGURATION_UNAVAILBLE -2015 #define ESLURM_NODES_BUSY -2016 +#define ESLURM_INVALID_JOB_ID -2017 +#define ESLURM_INVALID_NODE_NAMES -2018 +#define ESLURM_INVALID_PARTITION -2019 /* partition_mgr.c/update_part */ #define ESLURM_INVALID_PARTITION_NAME -2101 diff --git a/src/common/slurm_protocol_pack.c b/src/common/slurm_protocol_pack.c index 4f942e54821807651bca34e9bb0daf78adfdf1b3..891a03e9d574ae5290bffbf4593389eec1952e52 100644 --- a/src/common/slurm_protocol_pack.c +++ b/src/common/slurm_protocol_pack.c @@ -1,3 +1,28 @@ +/****************************************************************************\ + * slurm_protocol_pack.c - functions to pack and unpack structures for RPCs + ***************************************************************************** + * Copyright (C) 2002 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Kevin Tew <tew1@llnl.gov>. + * UCRL-CODE-2002-040. + * + * This file is part of SLURM, a resource management program. + * For details, see <http://www.llnl.gov/linux/slurm/>. + * + * SLURM is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along + * with SLURM; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +\*****************************************************************************/ #include <stdio.h> #include <stdlib.h> #include <errno.h> @@ -90,11 +115,18 @@ int pack_msg ( slurm_msg_t const * msg , char ** buffer , uint32_t * buf_len ) case RESPONSE_JOB_WILL_RUN : pack_resource_allocation_response_msg ( ( resource_allocation_response_msg_t * ) msg -> data , ( void ** ) buffer , buf_len ) ; break ; + case REQUEST_UPDATE_JOB : + pack_job_desc ( (job_desc_msg_t * ) msg -> data , + ( void ** ) buffer , buf_len ) ; + break ; + break ; case REQUEST_UPDATE_NODE : - pack_update_node_msg ( ( update_node_msg_t * ) msg-> data , ( void ** ) buffer , buf_len ) ; + pack_update_node_msg ( ( update_node_msg_t * ) msg-> data , + ( void ** ) buffer , buf_len ) ; break ; case REQUEST_UPDATE_PARTITION : - pack_update_partition_msg ( ( update_part_msg_t * ) msg->data , ( void ** ) buffer , buf_len ) ; + pack_update_partition_msg ( ( update_part_msg_t * ) msg->data , + ( void ** ) buffer , buf_len ) ; break ; case REQUEST_LAUNCH_TASKS : pack_launch_tasks_msg ( ( launch_tasks_msg_t * ) msg->data , ( void ** ) buffer , buf_len ) ; @@ -207,18 +239,25 @@ int unpack_msg ( slurm_msg_t * msg , char ** buffer , uint32_t * buf_len ) case RESPONSE_JOB_WILL_RUN : unpack_resource_allocation_response_msg ( ( resource_allocation_response_msg_t ** ) & ( msg -> data ) , ( void ** ) buffer , buf_len ) ; break ; + case REQUEST_UPDATE_JOB : + unpack_job_desc ( ( job_desc_msg_t **) & ( msg-> data ), + ( void ** ) buffer , buf_len ) ; + break ; case REQUEST_UPDATE_NODE : - unpack_update_node_msg ( ( update_node_msg_t ** ) & ( msg-> data ) , ( void ** ) buffer , buf_len ) ; - + unpack_update_node_msg ( ( update_node_msg_t ** ) & ( msg-> data ) , + ( void ** ) buffer , buf_len ) ; break ; case REQUEST_UPDATE_PARTITION : - unpack_update_partition_msg ( ( update_part_msg_t ** ) & ( msg->data ) , ( void ** ) buffer , buf_len ) ; + unpack_update_partition_msg ( ( update_part_msg_t ** ) & ( msg->data ) , + ( void ** ) buffer , buf_len ) ; break ; case REQUEST_LAUNCH_TASKS : - unpack_launch_tasks_msg ( ( launch_tasks_msg_t ** ) & ( msg->data ) , ( void ** ) buffer , buf_len ) ; + unpack_launch_tasks_msg ( ( launch_tasks_msg_t ** ) & ( msg->data ) , + ( void ** ) buffer , buf_len ) ; break ; case REQUEST_KILL_TASKS : - unpack_kill_tasks_msg ( ( kill_tasks_msg_t ** ) & ( msg->data ) , ( void ** ) buffer , buf_len ) ; + unpack_kill_tasks_msg ( ( kill_tasks_msg_t ** ) & ( msg->data ) , + ( void ** ) buffer , buf_len ) ; break ; case REQUEST_CANCEL_JOB : break ;