/* $Id$ */ /* * PSNC DRMAA for LL * Copyright (C) 2010 Poznan Supercomputing and Networking Center * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include #include #include #ifndef lint static char rcsid[] # ifdef __GNUC__ __attribute__ ((unused)) # endif = "$Id$"; #endif const char * lldrmaa_err_ckpt(int _llerrno) { switch(_llerrno) { case API_OK: return "Checkpoint completed successfully."; case LL_CKPT_UNCLEAR: return "Checkpoint event did not receive status and the success or failure of the checkpoint is unclear."; case LL_CKPT_ERROR: return "Error occurred attempting to checkpoint."; case LL_CKPT_JOB_ID_ERR: return "Format not valid for job step, not in the form host.jobid.stepid."; case LL_CKPT_MALLOC_ERR: return "Cannot allocate memory."; case LL_CKPT_SOCKET_ERR: return "API cannot create listen socket."; case LL_CKPT_CONF_ERR: return "Configuration file errors."; default: fsd_assert(false); return "Invalid error code"; } } int lldrmaa_map_ckpt(int _llerrno) { switch(_llerrno) { case API_OK: return FSD_ERRNO_SUCCESS; case LL_CKPT_UNCLEAR: return FSD_ERRNO_INTERNAL_ERROR; case LL_CKPT_ERROR: return FSD_DRMAA_ERRNO_SUSPEND_INCONSISTENT_STATE; case LL_CKPT_JOB_ID_ERR: return FSD_ERRNO_INTERNAL_ERROR; case LL_CKPT_MALLOC_ERR: return FSD_ERRNO_NO_MEMORY; case LL_CKPT_SOCKET_ERR: return FSD_ERRNO_INTERNAL_ERROR; case LL_CKPT_CONF_ERR: return FSD_ERRNO_DENIED_BY_DRM; default: fsd_assert(false); return FSD_ERRNO_INTERNAL_ERROR; } } const char * lldrmaa_err_control(int _llerrno) { switch(_llerrno) { case LL_CONTROL_OK: return "The specified command has been sent to the appropriate LoadLeveler daemon."; case LL_CONTROL_CM_ERR: return "The specified command cannot be sent to the central manager."; case LL_CONTROL_MASTER_ERR: return "The specified command cannot be sent to one of the LoadL_master daemons."; case LL_CONTROL_CONFIG_ERR: return "ll_control encountered an error while processing the administration or configuration file."; case LL_CONTROL_XMIT_ERR: return "A data transmission failure has occurred."; case LL_CONTROL_AUTH_ERR : return "The calling program does not have LoadLeveler administrator authority."; case LL_CONTROL_VERSION_ERR: return "An incorrect ll_control version has been specified."; case LL_CONTROL_SYSTEM_ERR: return "A system error has occurred."; case LL_CONTROL_MALLOC_ERR: return "The system cannot allocate memory."; case LL_CONTROL_INVALID_OP_ERR: return "A control_op operation that is not valid has been specified."; case LL_CONTROL_JOB_LIST_ERR: return "The job_list argument contains one or more errors."; case LL_CONTROL_HOST_LIST_ERR: return "The host_list argument contains one or more errors."; case LL_CONTROL_USER_LIST_ERR: return "The user_list argument contains one or more errors."; case LL_CONTROL_HOLD_ERR: return "Incompatible arguments have been specified for HOLD operation."; case LL_CONTROL_PRIO_ERR: return "Incompatible arguments have been specified for PRIORITY operation."; case LL_CONTROL_FAVORJOB_ERR: return "Incompatible arguments have been specified for FAVORJOB operation."; case LL_CONTROL_FAVORUSER_ERR: return "Incompatible arguments have been specified for FAVORUSER operation."; case LL_CONTROL_SYS_ERR: return "An error occurred while ll_control tried to start a child process."; case LL_CONTROL_START_ERR: return "An error occurred while ll_control tried to start the LoadL_master daemon."; case LL_CONTROL_UNUSED_1_ERR: return "Unused"; case LL_CONTROL_CLASS_ERR: return "The class_list argument contains incompatible information."; case LL_CONTROL_TMP_ERR: return "ll_control cannot create a file in the /tmp directory."; case LL_CONTROL_ERR: return "LoadLeveler has encountered miscellaneous incompatible input specifications."; case LL_CONTROL_NO_DCE_ID: return "DCE identity can not be determined."; case LL_CONTROL_NO_DCE_CRED: return "No DCE credentials."; case LL_CONTROL_INSUFFICIENT_DCE_CRED: return "DCE credentials within 300 secs of expiration."; case LL_CONTROL_64BIT_DCE_ERR: return "64-bit API not supported when DCE is enabled"; case LL_CONTROL_NO_DCE_SUPPORT_ERR: return "This version of LL does not support DCE security."; case LL_CONTROL_NO_CTSEC_SUPPORT_ERR: return "This version of LL does not support CTSEC security."; case LL_CONTROL_NO_GANG_SUPPORT_ERR: return "This version of LL does not support GANG scheduling."; case LL_CONTROL_NO_PVM_SUPPORT_ERR: return "This version of LL does not support PVM."; case LL_CONTROL_NO_NQS_SUPPORT_ERR: return "This version of LL does not support NQS."; default: fsd_assert(false); return "Invalid error code"; } } int lldrmaa_map_control(int _llerrno) { switch( _llerrno ) { case LL_CONTROL_OK: /* Command successfully sent to appropriate LL daemon. */ return FSD_ERRNO_SUCCESS; case LL_CONTROL_CM_ERR: /* Cannot send command to central manager. */ case LL_CONTROL_MASTER_ERR: /* Cannot send command to one of LoadL_master daemons. */ return FSD_ERRNO_INTERNAL_ERROR; case LL_CONTROL_CONFIG_ERR: /* Errors encountered while processing the LL admin/config files. */ return FSD_ERRNO_DENIED_BY_DRM; case LL_CONTROL_XMIT_ERR: /* A data transmission failure occurred. */ return FSD_ERRNO_INTERNAL_ERROR; case LL_CONTROL_AUTH_ERR: /* Calling program does not have LL administrator authority. */ return FSD_ERRNO_AUTHZ_FAILURE; case LL_CONTROL_VERSION_ERR: /* An incorrect ll_control version has been specified. */ case LL_CONTROL_SYSTEM_ERR: /* A system error occurred. */ return FSD_ERRNO_INTERNAL_ERROR; case LL_CONTROL_MALLOC_ERR: /* Unable to allocate memory. */ return FSD_ERRNO_NO_MEMORY; case LL_CONTROL_INVALID_OP_ERR: /* An invalid control_op operation has been specified. */ case LL_CONTROL_JOB_LIST_ERR: /* job_list argument contains one or more errors. */ case LL_CONTROL_HOST_LIST_ERR: /* host_list argument contains one or more errors. */ case LL_CONTROL_USER_LIST_ERR: /* user_list argument contains one or more errors. */ case LL_CONTROL_HOLD_ERR: /* Incompatible arguments specified for HOLD operation. */ case LL_CONTROL_PRIO_ERR: /* Incompatible arguments specified for PRIORITY operation. */ case LL_CONTROL_FAVORJOB_ERR: /* Incompatible arguments specified for FAVORJOB operation. */ case LL_CONTROL_FAVORUSER_ERR: /* Incompatible arguments specified for FAVORUSER operation. */ case LL_CONTROL_SYS_ERR: /* An error occurred while trying to start a child process. */ case LL_CONTROL_START_ERR: /* An error occurred while trying to start the LoadL_master daemon. */ case LL_CONTROL_UNUSED_1_ERR: case LL_CONTROL_CLASS_ERR: /* class_list argument contains incompatible information. */ case LL_CONTROL_TMP_ERR: /* Unable to create a file in /tmp directory. */ case LL_CONTROL_ERR: /* Miscellaneous incompatible input specifications. */ case LL_CONTROL_NO_DCE_ID: /* DCE identity can not be determined. */ case LL_CONTROL_NO_DCE_CRED: /* No DCE credentials. */ case LL_CONTROL_INSUFFICIENT_DCE_CRED: /* DCE credentials within 300 secs of expiration. */ case LL_CONTROL_64BIT_DCE_ERR: /* 64-bit API not supported when DCE is enabled */ case LL_CONTROL_NO_DCE_SUPPORT_ERR: /* This version of LL does not support DCE security. */ case LL_CONTROL_NO_CTSEC_SUPPORT_ERR: /* This version of LL does not support CTSEC security. */ case LL_CONTROL_NO_GANG_SUPPORT_ERR: /* This version of LL does not support GANG scheduling. */ case LL_CONTROL_NO_PVM_SUPPORT_ERR: /* This version of LL does not support PVM. */ case LL_CONTROL_NO_NQS_SUPPORT_ERR: /* This version of LL does not support NQS. */ return FSD_ERRNO_INTERNAL_ERROR; default: fsd_assert(false); return FSD_ERRNO_INTERNAL_ERROR; } } const char * lldrmaa_err_get_data(int _llerrno) { switch(_llerrno) { case API_OK : return "Operation successful"; case API_INVALID_INPUT: return "You specified an object that is not valid."; case LL_GET_DATA_NOT_VALID_LLAPI_SPECIFICATION_ERR: return "You specified an LLAPI_Specification that is not valid."; default: fsd_assert(false); return "Invalid error code"; } } int lldrmaa_map_get_data(int _llerrno) { switch(_llerrno) { case API_OK : /* API call runs to complete */ return FSD_ERRNO_SUCCESS; case API_INVALID_INPUT: /* Invalid input */ case LL_GET_DATA_NOT_VALID_LLAPI_SPECIFICATION_ERR: /* input not valid */ return FSD_ERRNO_INTERNAL_ERROR; default: fsd_assert(false); return FSD_ERRNO_INTERNAL_ERROR; } } const char * lldrmaa_err_get_objs(int _llerrno) { switch( _llerrno ) { case API_OK: return "Operation successful"; case LL_GET_OBJS_QUERY_ELEMENT_NOT_VALID_ERR: return "query_element not valid."; case LL_GET_OBJS_QUERY_DEAMON_NOT_VALID_ERR: return "query_daemon not valid."; case LL_GET_OBJS_HOSTNAME_ERR: return "Cannot resolve hostname."; case LL_GET_OBJS_INVALID_REQUEST_ERR: return "Request type for specified daemon not valid."; case LL_GET_OBJS_SYS_ERR: return "System error."; case LL_GET_OBJS_NO_OBJECTS_ERR: return "No valid objects meet the request."; case LL_GET_OBJS_CONF_ERR: return "Configuration error."; case LL_GET_OBJS_DEAMON_CONNECTION_ERR: return "Connection to daemon failed."; case LL_GET_OBJS_HISTORY_F_PROCESS_ERR: return "Error processing history file (LL_HISTORY_FILE query only)."; case LL_GET_OBJS_NO_HISTORY_FILE: return "History file must be specified in the hostname argument (LL_HISTORY_FILE query only)."; case LL_GET_OBJS_HISTORY_F_NO_ACCES_ERR: return "Unable to access the history file (LL_HISTORY_FILE query only)."; default: fsd_assert(false); return "Invalid error code"; } } int lldrmaa_map_get_objs(int _llerrno) { switch( _llerrno ) { case API_OK: /* API call runs to complete */ return FSD_ERRNO_SUCCESS; case LL_GET_OBJS_QUERY_ELEMENT_NOT_VALID_ERR: /* Invalid input */ case LL_GET_OBJS_QUERY_DEAMON_NOT_VALID_ERR: /* input not valid */ case LL_GET_OBJS_HOSTNAME_ERR: case LL_GET_OBJS_INVALID_REQUEST_ERR: case LL_GET_OBJS_SYS_ERR: case LL_GET_OBJS_NO_OBJECTS_ERR: return FSD_DRMAA_ERRNO_INVALID_JOB ; /* "No valid objects meet the request." */ case LL_GET_OBJS_CONF_ERR: return FSD_ERRNO_DENIED_BY_DRM; case LL_GET_OBJS_DEAMON_CONNECTION_ERR: return FSD_ERRNO_DRM_COMMUNICATION_FAILURE; case LL_GET_OBJS_HISTORY_F_PROCESS_ERR: case LL_GET_OBJS_NO_HISTORY_FILE: case LL_GET_OBJS_HISTORY_F_NO_ACCES_ERR: return FSD_ERRNO_INTERNAL_ERROR; default: fsd_assert(false); return FSD_ERRNO_INTERNAL_ERROR; } } const char * lldrmaa_err_set_request(int _llerrno) { switch(_llerrno) { case API_OK: return "Operation successful"; case API_INVALID_INPUT: return "You specified a query_element that is not valid."; case LL_SET_REQUEST_QUERY_FLAG_NOT_VALID_ERR: return "You specified a query_flag that is not valid."; case LL_SET_REQUEST_OBJ_FILTER_NOT_VALID_ERR: return "You specified an object_filter that is not valid."; case LL_SET_REQUEST_DATA_FILTER_NOT_VALID_ERR: return "You specified a data_filter that is not valid."; case LL_SET_REQUEST_SYS_ERR: return "A system error occurred."; default: fsd_assert(false); return "Invalid error code"; } } int lldrmaa_map_set_request(int _llerrno) { switch(_llerrno) { case API_OK: /* API call runs to complete */ return FSD_ERRNO_SUCCESS; case API_INVALID_INPUT: /* Invalid input */ case LL_SET_REQUEST_QUERY_FLAG_NOT_VALID_ERR: case LL_SET_REQUEST_OBJ_FILTER_NOT_VALID_ERR: case LL_SET_REQUEST_DATA_FILTER_NOT_VALID_ERR: case LL_SET_REQUEST_SYS_ERR: return FSD_ERRNO_INTERNAL_ERROR; default: fsd_assert(false); return FSD_ERRNO_INTERNAL_ERROR; } } const char * lldrmaa_err_preempt_jobs(int _llerrno) { switch(_llerrno) { case API_OK: return "Request successfully sent to the central manager."; case API_INVALID_INPUT: return "An LL_preempt_op that is not valid was specified."; case API_CANT_CONNECT: return "Cannot send request to central manager."; case LL_PREEMPT_JOBS_VERSION_ERR: return "An incorrect version was specified."; case API_CONFIG_ERR : return "Errors encountered while processing the LoadLeveler administration or configuration files."; case LL_PREEMPT_JOBS_SYS_ERR: return "A system error occurred."; case API_CANT_TRANSMIT: return "A data transmission failure occurred."; case API_CANT_AUTH: return "The calling program does not have LoadLeveler administrator authority."; default: fsd_assert(false); return "Invalid error code"; } } int lldrmaa_map_preempt_jobs(int _llerrno) { switch(_llerrno) { case API_OK: /* API call runs to complete */ return FSD_ERRNO_SUCCESS; case API_INVALID_INPUT: /* Invalid input */ return FSD_ERRNO_INVALID_ARGUMENT; case API_CANT_CONNECT: /* can't connect to daemon */ case LL_PREEMPT_JOBS_VERSION_ERR: return FSD_ERRNO_INTERNAL_ERROR; case API_CONFIG_ERR: /* Error from init_params() */ return FSD_ERRNO_DENIED_BY_DRM; case LL_PREEMPT_JOBS_SYS_ERR: case API_CANT_TRANSMIT: /* xdr error */ return FSD_ERRNO_INTERNAL_ERROR; case API_CANT_AUTH: /* can't authorize */ return FSD_ERRNO_AUTHZ_FAILURE; default: fsd_assert(false); return FSD_ERRNO_INTERNAL_ERROR; } } const char * lldrmaa_err_submit(int _llerrno) { switch(_llerrno) { case API_OK: return "The job was submitted successfully."; case LL_SUBMIT_ERROR: return "Error, error messages written to stderr."; default: fsd_assert(false); return "Invalid error code"; } } int lldrmaa_map_submit(int _llerrno) { switch(_llerrno) { case API_OK: /* API call runs to complete */ return FSD_ERRNO_SUCCESS; case LL_SUBMIT_ERROR: return FSD_ERRNO_INTERNAL_ERROR; default: fsd_assert(false); return FSD_ERRNO_INTERNAL_ERROR; } } const char * lldrmaa_err_terminate_job(int _llerrno) { switch(_llerrno) { case API_OK: return "Operation successful"; case API_INVALID_INPUT: return "There is an error in the input parameter."; case API_CONFIG_ERR: return "An error occurred reading parameters from the administration or the configuration file."; case API_CANT_TRANSMIT: return "A data transmission failure occurred."; case API_CANT_AUTH: return "The subroutine cannot authorize the action because you are not a LoadLeveler administrator or you are not the user who submitted the job."; case API_WRNG_PROC_VERSION: return "The job object version number is incorrect."; default: fsd_assert(false); return "Invalid error code"; } } int lldrmaa_map_terminate_job(int _llerrno) { switch(_llerrno) { case API_OK: return FSD_ERRNO_SUCCESS; /* API call runs to complete */ case API_INVALID_INPUT: return FSD_ERRNO_INTERNAL_ERROR; case API_CONFIG_ERR: /* Error from init_params() */ return FSD_ERRNO_DENIED_BY_DRM; case API_CANT_TRANSMIT: /* xdr error */ return FSD_ERRNO_INTERNAL_ERROR; case API_CANT_AUTH: /* can't authorize */ return FSD_ERRNO_AUTHZ_FAILURE; case API_WRNG_PROC_VERSION: /* Wrong proc version */ return FSD_ERRNO_INTERNAL_ERROR; default: fsd_assert(false); return FSD_ERRNO_INTERNAL_ERROR; } }