static void dfs_post_file_map(opal_byte_object_t *bo, orte_dfs_post_callback_fn_t cbfunc, void *cbdata) { orte_dfs_request_t *dfs; dfs = OBJ_NEW(orte_dfs_request_t); dfs->cmd = ORTE_DFS_POST_CMD; dfs->bo = bo; dfs->post_cbfunc = cbfunc; dfs->cbdata = cbdata; /* post it for processing */ ORTE_DFS_POST_REQUEST(dfs, process_posts); }
static void dfs_get_file_map(orte_process_name_t *target, orte_dfs_fm_callback_fn_t cbfunc, void *cbdata) { orte_dfs_request_t *dfs; dfs = OBJ_NEW(orte_dfs_request_t); dfs->cmd = ORTE_DFS_GETFM_CMD; dfs->target.jobid = target->jobid; dfs->target.vpid = target->vpid; dfs->fm_cbfunc = cbfunc; dfs->cbdata = cbdata; /* post it for processing */ ORTE_DFS_POST_REQUEST(dfs, process_getfm); }
static void dfs_read(int fd, uint8_t *buffer, long length, orte_dfs_read_callback_fn_t cbfunc, void *cbdata) { orte_dfs_request_t *dfs; dfs = OBJ_NEW(orte_dfs_request_t); dfs->cmd = ORTE_DFS_READ_CMD; dfs->local_fd = fd; dfs->read_buffer = buffer; dfs->read_length = length; dfs->read_cbfunc = cbfunc; dfs->cbdata = cbdata; /* post it for processing */ ORTE_DFS_POST_REQUEST(dfs, process_reads); }
static void dfs_get_file_size(int fd, orte_dfs_size_callback_fn_t cbfunc, void *cbdata) { orte_dfs_request_t *dfs; opal_output_verbose(1, orte_dfs_base.output, "%s get_size called on fd %d", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), fd); dfs = OBJ_NEW(orte_dfs_request_t); dfs->cmd = ORTE_DFS_SIZE_CMD; dfs->local_fd = fd; dfs->size_cbfunc = cbfunc; dfs->cbdata = cbdata; /* post it for processing */ ORTE_DFS_POST_REQUEST(dfs, process_sizes); }
static void dfs_close(int fd, orte_dfs_close_callback_fn_t cbfunc, void *cbdata) { orte_dfs_request_t *dfs; opal_output_verbose(1, orte_dfs_base_framework.framework_output, "%s close called on fd %d", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), fd); dfs = OBJ_NEW(orte_dfs_request_t); dfs->cmd = ORTE_DFS_CLOSE_CMD; dfs->local_fd = fd; dfs->close_cbfunc = cbfunc; dfs->cbdata = cbdata; /* post it for processing */ ORTE_DFS_POST_REQUEST(dfs, process_close); }
/* in order to handle the possible opening/reading of files by * multiple threads, we have to ensure that all operations are * carried out in events - so the "open" cmd simply posts an * event containing the required info, and then returns */ static void dfs_open(char *uri, orte_dfs_open_callback_fn_t cbfunc, void *cbdata) { orte_dfs_request_t *dfs; opal_output_verbose(1, orte_dfs_base.output, "%s opening file %s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), uri); /* setup the request */ dfs = OBJ_NEW(orte_dfs_request_t); dfs->cmd = ORTE_DFS_OPEN_CMD; dfs->uri = strdup(uri); dfs->open_cbfunc = cbfunc; dfs->cbdata = cbdata; /* post it for processing */ ORTE_DFS_POST_REQUEST(dfs, process_opens); }
static void dfs_seek(int fd, long offset, int whence, orte_dfs_seek_callback_fn_t cbfunc, void *cbdata) { orte_dfs_request_t *dfs; opal_output_verbose(1, orte_dfs_base.output, "%s seek called on fd %d", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), fd); dfs = OBJ_NEW(orte_dfs_request_t); dfs->cmd = ORTE_DFS_SEEK_CMD; dfs->local_fd = fd; dfs->read_length = offset; dfs->remote_fd = whence; dfs->seek_cbfunc = cbfunc; dfs->cbdata = cbdata; /* post it for processing */ ORTE_DFS_POST_REQUEST(dfs, process_seeks); }