📄 smpd.h
字号:
} smpd_context_target_t;typedef enum smpd_command_state_t{ SMPD_CMD_INVALID, SMPD_CMD_READING_HDR, SMPD_CMD_READING_CMD, SMPD_CMD_WRITING_CMD, SMPD_CMD_READY, SMPD_CMD_HANDLED} smpd_command_state_t;typedef struct smpd_command_t{ smpd_command_state_t state; char cmd_hdr_str[SMPD_CMD_HDR_LENGTH]; char cmd_str[SMPD_MAX_CMD_STR_LENGTH]; char cmd[SMPD_MAX_CMD_LENGTH]; MPID_IOV iov[2]; int length; int src, dest, tag; int wait; int stdin_read_offset; struct smpd_context_t *context; struct smpd_command_t *next; int freed; /* debugging to see if freed more than once */} smpd_command_t;#ifdef HAVE_WINDOWS_Htypedef struct smpd_pwait_t{ HANDLE hProcess, hThread;} smpd_pwait_t;#elsetypedef pid_t smpd_pwait_t;#endiftypedef struct smpd_host_node_t{ int id, parent; char host[SMPD_MAX_HOST_LENGTH]; char alt_host[SMPD_MAX_HOST_LENGTH]; int nproc; SMPD_BOOL connected; int connect_cmd_tag; struct smpd_host_node_t *next; struct smpd_host_node_t *left; struct smpd_host_node_t *right;} smpd_host_node_t;struct smpd_spawn_context_t;typedef struct smpd_sspi_client_context_t{ int id;#ifdef HAVE_WINDOWS_H CtxtHandle context; CredHandle credential; TimeStamp expiration_time; HANDLE user_handle; HANDLE job; DWORD flags; SMPD_BOOL close_handle;#endif char target[SMPD_MAX_NAME_LENGTH]; void *buffer; int buffer_length; void *out_buffer; int out_buffer_length; int max_buffer_size; struct smpd_sspi_client_context_t *next;} smpd_sspi_client_context_t;typedef enum smpd_sspi_type_t{ SMPD_SSPI_IDENTIFY, SMPD_SSPI_IMPERSONATE, SMPD_SSPI_DELEGATE} smpd_sspi_type_t;typedef enum smpd_access_t{ SMPD_ACCESS_NONE, SMPD_ACCESS_ADMIN, SMPD_ACCESS_USER, SMPD_ACCESS_USER_PROCESS} smpd_access_t;typedef struct smpd_context_t{ smpd_context_type_t type; smpd_context_target_t target; smpd_access_t access; char host[SMPD_MAX_HOST_LENGTH]; int id, rank; smpd_pwait_t wait; MPIDU_Sock_set_t set; MPIDU_Sock_t sock; smpd_state_t state; smpd_state_t read_state; smpd_command_t read_cmd; smpd_state_t write_state; smpd_command_t *write_list; smpd_command_t *wait_list; smpd_host_node_t *connect_to; struct smpd_spawn_context_t *spawn_context; char pszCrypt[SMPD_AUTHENTICATION_STR_LEN]; char pszChallengeResponse[SMPD_AUTHENTICATION_STR_LEN]; char port_str[SMPD_MAX_PORT_STR_LENGTH]; char session[SMPD_SESSION_REQUEST_LEN]; char pwd_request[SMPD_MAX_PWD_REQUEST_LENGTH]; char cred_request[SMPD_MAX_CRED_REQUEST_LENGTH]; char account[SMPD_MAX_ACCOUNT_LENGTH]; char domain[SMPD_MAX_ACCOUNT_LENGTH]; char full_domain[SMPD_MAX_ACCOUNT_LENGTH]; char password[SMPD_MAX_PASSWORD_LENGTH]; char encrypted_password[SMPD_MAX_PASSWORD_LENGTH]; char smpd_pwd[SMPD_MAX_PASSWORD_LENGTH]; char session_header[SMPD_MAX_SESSION_HEADER_LENGTH]; /* FIXME: Remove this */ char singleton_init_kvsname[SMPD_SINGLETON_MAX_KVS_NAME_LEN]; char singleton_init_hostname[SMPD_SINGLETON_MAX_HOST_NAME_LEN]; int singleton_init_pm_port; /* FIXME: Remove this */ int connect_return_id, connect_return_tag; struct smpd_process_t *process; char sspi_header[SMPD_SSPI_HEADER_LENGTH]; char sspi_job_key[SMPD_SSPI_JOB_KEY_LENGTH]; smpd_sspi_client_context_t *sspi_context; smpd_sspi_type_t sspi_type; SMPD_BOOL first_output_stdout, first_output_stderr; struct smpd_context_t *next;} smpd_context_t;typedef struct smpd_stdin_write_node_t{ char *buffer; int length; struct smpd_stdin_write_node_t *next;} smpd_stdin_write_node_t;typedef struct smpd_map_drive_node_t{ int ref_count; char drive; char share[SMPD_MAX_EXE_LENGTH]; struct smpd_map_drive_node_t *next;} smpd_map_drive_node_t;typedef struct smpd_process_t{ int id; int num_valid_contexts; smpd_context_t *in, *out, *err, *pmi, *p_singleton_context; int context_refcount; int pid; char exe[SMPD_MAX_EXE_LENGTH]; char env[SMPD_MAX_ENV_LENGTH]; char dir[SMPD_MAX_DIR_LENGTH]; char path[SMPD_MAX_PATH_LENGTH]; char clique[SMPD_MAX_CLIQUE_LENGTH]; int rank; int nproc; smpd_pwait_t wait; int exitcode; char kvs_name[SMPD_MAX_DBS_NAME_LEN]; char domain_name[SMPD_MAX_DBS_NAME_LEN]; char err_msg[SMPD_MAX_ERROR_LEN]; smpd_stdin_write_node_t *stdin_write_list; int spawned; SMPD_BOOL local_process; SMPD_BOOL is_singleton_client; smpd_map_drive_node_t *map_list; int appnum; struct smpd_process_t *next;} smpd_process_t;typedef struct smpd_launch_node_t{ char exe[SMPD_MAX_EXE_LENGTH]; char args[SMPD_MAX_EXE_LENGTH]; char *env, env_data[SMPD_MAX_ENV_LENGTH]; char clique[SMPD_MAX_CLIQUE_LENGTH]; char dir[SMPD_MAX_DIR_LENGTH]; char path[SMPD_MAX_PATH_LENGTH]; smpd_map_drive_node_t *map_list; int host_id; char hostname[SMPD_MAX_HOST_LENGTH]; char alt_hostname[SMPD_MAX_HOST_LENGTH]; int iproc; int nproc; int appnum; int priority_class, priority_thread; struct smpd_launch_node_t *next, *prev;} smpd_launch_node_t;typedef struct smpd_spawn_context_t{ smpd_context_t *context; smpd_launch_node_t *launch_list; smpd_command_t *result_cmd; char kvs_name[SMPD_MAX_DBS_NAME_LEN]; char domain_name[SMPD_MAX_DBS_NAME_LEN]; int npreput; char preput[SMPD_MAX_CMD_LENGTH]; int num_outstanding_launch_cmds;} smpd_spawn_context_t;typedef struct smpd_delayed_spawn_node_t{ smpd_context_t *context; smpd_command_t cmd; struct smpd_delayed_spawn_node_t *next;} smpd_delayed_spawn_node_t;typedef struct smpd_env_node_t{ char name[SMPD_MAX_NAME_LENGTH]; char value[SMPD_MAX_VALUE_LENGTH]; struct smpd_env_node_t *next;} smpd_env_node_t;typedef struct smpd_database_element_t{ char pszKey[SMPD_MAX_DBS_KEY_LEN]; char pszValue[SMPD_MAX_DBS_VALUE_LEN]; struct smpd_database_element_t *pNext;} smpd_database_element_t;typedef struct smpd_database_node_t{ char pszName[SMPD_MAX_DBS_NAME_LEN]; smpd_database_element_t *pData, *pIter; struct smpd_database_node_t *pNext;} smpd_database_node_t;typedef struct smpd_barrier_in_t{ smpd_context_t *context; int dest; int cmd_tag; char ctx_key[100];} smpd_barrier_in_t;typedef struct smpd_barrier_node_t{ char name[SMPD_MAX_DBS_NAME_LEN]; int count; int in; smpd_barrier_in_t *in_array; struct smpd_barrier_node_t *next;} smpd_barrier_node_t;typedef struct smpd_data_t{ char name[SMPD_MAX_NAME_LENGTH]; char value[SMPD_MAX_VALUE_LENGTH]; struct smpd_data_t *next;} smpd_data_t;typedef struct smpd_exit_process_t{ SMPD_BOOL init_called, finalize_called, suspended, exited; int node_id, exitcode; char host[SMPD_MAX_HOST_LENGTH]; char ctx_key[100]; char *errmsg; smpd_command_t *suspend_cmd;} smpd_exit_process_t;typedef struct smpd_process_group_t{ SMPD_BOOL aborted, any_noinit_process_exited, any_init_received; char kvs[SMPD_MAX_DBS_NAME_LEN]; int num_procs, num_pending_suspends; smpd_exit_process_t *processes; struct smpd_process_group_t *next;} smpd_process_group_t;typedef enum smpd_builtin_commands_t{ SMPD_CMD_NONE, SMPD_CMD_SHUTDOWN, SMPD_CMD_RESTART, SMPD_CMD_VALIDATE, SMPD_CMD_DO_STATUS, SMPD_CMD_SET, SMPD_CMD_GET, SMPD_CMD_DELETE, SMPD_CMD_ADD_JOB, SMPD_CMD_ADD_JOB_AND_PASSWORD, SMPD_CMD_REMOVE_JOB, SMPD_CMD_ASSOCIATE_JOB, SMPD_CMD_VERSION} smpd_builtin_commands_t;/* If you add elements to the process structure you must add the appropriate initializer in smpd_connect.c where the global variable, smpd_process, lives */typedef struct smpd_global_t{ smpd_state_t state; int id, parent_id; int level; smpd_context_t *left_context, *right_context, *parent_context, *context_list; smpd_context_t *listener_context; smpd_process_t *process_list; int closing; int root_smpd; MPIDU_Sock_set_t set; char host[SMPD_MAX_HOST_LENGTH]; char pszExe[SMPD_MAX_EXE_LENGTH]; int bService;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -