int orte_sstore_central_global_request_checkpoint_handle(orte_sstore_base_handle_t *handle, int seq, orte_jobid_t jobid) { int ret, exit_status = ORTE_SUCCESS; orte_sstore_central_global_snapshot_info_t *handle_info = NULL; OPAL_OUTPUT_VERBOSE((10, mca_sstore_central_component.super.output_handle, "sstore:central:(global): request_checkpoint_handle()")); /* * Construct a handle * - Associate all of the necessary information */ handle_info = create_new_handle_info(seq, SSTORE_HANDLE_TYPE_CKPT, jobid); /* * Create the global checkpoint directory */ if( ORTE_SUCCESS != (ret = init_global_snapshot_directory(handle_info)) ) { ORTE_ERROR_LOG(ret); exit_status = ret; goto cleanup; } /* * Return the handle */ *handle = handle_info->id; cleanup: return exit_status; }
int orte_sstore_central_local_register(orte_sstore_base_handle_t handle) { int ret, exit_status = ORTE_SUCCESS; orte_sstore_central_local_snapshot_info_t *handle_info = NULL; OPAL_OUTPUT_VERBOSE((10, mca_sstore_central_component.super.output_handle, "sstore:central:(local): register()")); /* * Create a handle */ if( NULL == (handle_info = find_handle_info(handle)) ) { handle_info = create_new_handle_info(handle); } /* * Get basic information from Global SStore */ if( ORTE_SUCCESS != (ret = pull_handle_info(handle_info)) ) { ORTE_ERROR_LOG(ret); exit_status = ret; goto cleanup; } /* * Wait here until the pull request has been satisfied */ while(SSTORE_LOCAL_READY != handle_info->status && SSTORE_LOCAL_ERROR != handle_info->status ) { opal_progress(); } cleanup: return exit_status; }
void orte_sstore_central_local_recv(int status, orte_process_name_t* sender, opal_buffer_t* buffer, orte_rml_tag_t tag, void* cbdata) { int ret; orte_sstore_central_cmd_flag_t command; orte_std_cntr_t count; orte_sstore_base_handle_t loc_id; orte_sstore_central_local_snapshot_info_t *handle_info = NULL; if( ORTE_RML_TAG_SSTORE_INTERNAL != tag ) { return; } OPAL_OUTPUT_VERBOSE((10, mca_sstore_central_component.super.output_handle, "sstore:central:(local): process_cmd(%s)", ORTE_NAME_PRINT(sender))); count = 1; if (ORTE_SUCCESS != (ret = opal_dss.unpack(buffer, &command, &count, ORTE_SSTORE_CENTRAL_CMD))) { ORTE_ERROR_LOG(ret); goto cleanup; } count = 1; if (ORTE_SUCCESS != (ret = opal_dss.unpack(buffer, &loc_id, &count, ORTE_SSTORE_HANDLE )) ) { ORTE_ERROR_LOG(ret); goto cleanup; } /* * Find the referenced handle (Create if it does not exist) */ if(NULL == (handle_info = find_handle_info(loc_id)) ) { handle_info = create_new_handle_info(loc_id); } /* * Process the command */ if( ORTE_SSTORE_CENTRAL_PULL == command ) { if(OPAL_EQUAL == orte_util_compare_name_fields(ORTE_NS_CMP_ALL, ORTE_PROC_MY_HNP, sender)) { process_global_pull(sender, buffer, handle_info); } else { process_app_pull(sender, buffer, handle_info); } } else if( ORTE_SSTORE_CENTRAL_PUSH == command ) { if(OPAL_EQUAL == orte_util_compare_name_fields(ORTE_NS_CMP_ALL, ORTE_PROC_MY_HNP, sender)) { process_global_push(sender, buffer, handle_info); } else { process_app_push(sender, buffer, handle_info); } } cleanup: return; }
int orte_sstore_central_local_unpack(orte_process_name_t* peer, opal_buffer_t* buffer, orte_sstore_base_handle_t *handle) { int ret, exit_status = ORTE_SUCCESS; orte_sstore_central_local_snapshot_info_t *handle_info = NULL; orte_std_cntr_t count; OPAL_OUTPUT_VERBOSE((10, mca_sstore_central_component.super.output_handle, "sstore:central:(local): unpack()")); /* * Unpack the handle id */ count = 1; if (ORTE_SUCCESS != (ret = opal_dss.unpack(buffer, handle, &count, ORTE_SSTORE_HANDLE))) { ORTE_ERROR_LOG(ret); exit_status = ret; goto cleanup; } /* * Lookup the handle */ if( NULL == (handle_info = find_handle_info(*handle)) ) { handle_info = create_new_handle_info(*handle); } /* * Unpack the metadata piggybacked on this message */ if( ORTE_SUCCESS != (ret = process_global_push(peer, buffer, handle_info))) { ORTE_ERROR_LOG(ret); exit_status = ret; goto cleanup; } OPAL_OUTPUT_VERBOSE((10, mca_sstore_central_component.super.output_handle, "sstore:central:(local): unpack(%d, %d, %s)", handle_info->id, handle_info->seq_num, handle_info->global_ref_name)); cleanup: return exit_status; }
int orte_sstore_central_app_register(orte_sstore_base_handle_t handle) { int ret, exit_status = ORTE_SUCCESS; orte_sstore_central_app_snapshot_info_t *handle_info = NULL; OPAL_OUTPUT_VERBOSE((10, mca_sstore_central_component.super.output_handle, "sstore:central:(app): register(%d)", (int)handle)); /* * Create a handle */ orte_sstore_handle_current = handle; handle_info = find_handle_info(handle); if( NULL != handle_info ) { /* Remove the old, stale handle */ opal_list_remove_item(active_handles, &(handle_info->super)); } handle_info = create_new_handle_info(handle); /* * Get basic information from Local SStore */ if( ORTE_SUCCESS != (ret = pull_handle_info(handle_info)) ) { ORTE_ERROR_LOG(ret); exit_status = ret; goto cleanup; } /* * Setup the storage directory */ if( ORTE_SUCCESS != (ret = init_local_snapshot_directory(handle_info)) ) { ORTE_ERROR_LOG(ret); exit_status = ret; goto cleanup; } cleanup: return exit_status; }