int orte_ess_base_app_finalize(void) { orte_notifier_base_close(); orte_cr_finalize(); #if OPAL_ENABLE_FT_CR == 1 orte_snapc_base_close(); #endif orte_filem_base_close(); orte_wait_finalize(); /* close the multicast */ #if ORTE_ENABLE_MULTICAST orte_rmcast_base_close(); #endif /* now can close the rml and its friendly group comm */ orte_grpcomm_base_close(); orte_routed_base_close(); orte_rml_base_close(); orte_session_dir_finalize(ORTE_PROC_MY_NAME); return ORTE_SUCCESS; }
int orte_ess_base_tool_finalize(void) { orte_wait_finalize(); #if OPAL_ENABLE_FT_CR == 1 mca_base_framework_close(&orte_snapc_base_framework); mca_base_framework_close(&orte_sstore_base_framework); #endif orte_rml.close_conduit(orte_mgmt_conduit); /* if I am a tool, then all I will have done is * a very small subset of orte_init - ensure that * I only back those elements out */ if (NULL != orte_process_info.my_hnp_uri) { (void) mca_base_framework_close(&orte_iof_base_framework); } (void) mca_base_framework_close(&orte_routed_base_framework); (void) mca_base_framework_close(&orte_rml_base_framework); (void) mca_base_framework_close(&orte_errmgr_base_framework); (void) mca_base_framework_close(&opal_pmix_base_framework); return ORTE_SUCCESS; }
int orte_ess_base_tool_finalize(void) { orte_wait_finalize(); #if OPAL_ENABLE_FT_CR == 1 mca_base_framework_close(&orte_snapc_base_framework); mca_base_framework_close(&orte_sstore_base_framework); #endif /* if I am a tool, then all I will have done is * a very small subset of orte_init - ensure that * I only back those elements out */ if (NULL != orte_process_info.my_hnp_uri) { (void) mca_base_framework_close(&orte_iof_base_framework); } (void) mca_base_framework_close(&orte_routed_base_framework); (void) mca_base_framework_close(&orte_rml_base_framework); (void) mca_base_framework_close(&orte_schizo_base_framework); (void) mca_base_framework_close(&orte_errmgr_base_framework); /* release the event base */ if (progress_thread_running) { opal_stop_progress_thread("orte", true); progress_thread_running = false; } return ORTE_SUCCESS; }
static void local_fin(void) { orte_wait_finalize(); /* close pnp */ orcm_leader_base_close(); orcm_pnp_base_close(); orte_rmcast_base_close(); orte_routed_base_close(); orte_rml_base_close(); }
/** * Leave ORTE. * * @retval ORTE_SUCCESS Upon success. * @retval ORTE_ERROR Upon failure. * * This function performs */ int orte_system_finalize(void) { char *contact_path; /* if I'm the seed, remove the universe contact info file */ if (orte_process_info.seed) { contact_path = opal_os_path(false, orte_process_info.universe_session_dir, "universe-setup.txt", NULL); unlink(contact_path); free(contact_path); } /* rmgr and odls close depend on wait/iof */ orte_rmgr_base_close(); orte_odls_base_close(); orte_wait_finalize(); orte_iof_base_close(); orte_ns_base_close(); orte_gpr_base_close(); orte_schema_base_close(); /* finalize selected modules so they can de-register * their receives */ orte_rds_base_close(); orte_ras_base_close(); orte_rmaps_base_close(); orte_pls_base_close(); /* the errmgr close function retains the base * module so that error logging can continue */ orte_errmgr_base_close(); /* now can close the rml */ orte_rml_base_close(); orte_dss_close(); opal_progress_finalize(); opal_event_fini(); orte_session_dir_finalize(orte_process_info.my_name); /* clean out the global structures */ orte_sys_info_finalize(); orte_proc_info_finalize(); orte_univ_info_finalize(); return ORTE_SUCCESS; }
static void local_fin(void) { int i; orte_node_t *node; orte_job_t *job; /* stop the local sensors */ orte_sensor.stop(ORTE_PROC_MY_NAME->jobid); orte_sensor_base_close(); orte_odls_base_close(); orte_wait_finalize(); /* finalize selected modules */ orte_errmgr_base_close(); /* close the orcm-related frameworks */ orcm_leader_base_close(); orcm_pnp_base_close(); /* close the multicast */ orte_rmcast_base_close(); orte_routed_base_close(); orte_rml_base_close(); /* cleanup the job and node info arrays */ if (NULL != orte_node_pool) { for (i=0; i < orte_node_pool->size; i++) { if (NULL != (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool,i))) { OBJ_RELEASE(node); } } OBJ_RELEASE(orte_node_pool); } if (NULL != orte_job_data) { for (i=0; i < orte_job_data->size; i++) { if (NULL != (job = (orte_job_t*)opal_pointer_array_get_item(orte_job_data,i))) { OBJ_RELEASE(job); } } OBJ_RELEASE(orte_job_data); } /* handle the orcm-specific OPAL stuff */ opal_sysinfo_base_close(); opal_pstat_base_close(); }
int orte_ess_base_tool_finalize(void) { orte_wait_finalize(); /* if I am a tool, then all I will have done is * a very small subset of orte_init - ensure that * I only back those elements out */ if (NULL != orte_process_info.my_hnp_uri) { (void) mca_base_framework_close(&orte_iof_base_framework); } (void) mca_base_framework_close(&orte_routed_base_framework); (void) mca_base_framework_close(&orte_rml_base_framework); (void) mca_base_framework_close(&orte_schizo_base_framework); (void) mca_base_framework_close(&orte_errmgr_base_framework); return ORTE_SUCCESS; }
static void tool_finalize(void) { if (signals_set) { /* Release all local signal handlers */ opal_event_del(&epipe_handler); opal_event_del(&term_handler); opal_event_del(&int_handler); opal_event_signal_del(&sigusr1_handler); opal_event_signal_del(&sigusr2_handler); } (void) mca_base_framework_close(&orte_errmgr_base_framework); (void) mca_base_framework_close(&orte_routed_base_framework); orte_wait_finalize(); if (progress_thread_running) { /* we had to leave the progress thread running until * we closed the routed framework as that closure * sends a "sync" message to the local daemon. it * is now safe to stop the progress thread */ orte_event_base_active = false; /* break the event loop */ opal_event_base_loopbreak(orte_event_base); /* wait for thread to exit */ opal_thread_join(&progress_thread, NULL); OBJ_DESTRUCT(&progress_thread); progress_thread_running = false; } (void) mca_base_framework_close(&orte_rml_base_framework); (void) mca_base_framework_close(&orte_oob_base_framework); (void) mca_base_framework_close(&orte_state_base_framework); (void) mca_base_framework_close(&orcm_db_base_framework); (void) mca_base_framework_close(&opal_dstore_base_framework); }
int orte_ess_base_app_finalize(void) { orte_cr_finalize(); #if OPAL_ENABLE_FT_CR == 1 orte_snapc_base_close(); #endif orte_filem_base_close(); orte_wait_finalize(); orte_errmgr_base_close(); /* now can close the rml and its friendly group comm */ orte_grpcomm_base_close(); orte_db_base_close(); orte_routed_base_close(); orte_rml_base_close(); orte_session_dir_finalize(ORTE_PROC_MY_NAME); return ORTE_SUCCESS; }
int orte_restart(orte_process_name_t *name, const char* uri) { int rc; orte_process_name_t* old_name; orte_process_name_t* new_name; if (ORTE_SUCCESS != (rc = orte_dss.copy((void**)&old_name, orte_process_info.my_name, ORTE_NAME))) { ORTE_ERROR_LOG(rc); return rc; } if (ORTE_SUCCESS != (rc = orte_dss.copy((void**)&new_name, name, ORTE_NAME))) { ORTE_ERROR_LOG(rc); return rc; } /* * Restart event library */ if (ORTE_SUCCESS != (rc = opal_event_restart())) { ORTE_ERROR_LOG(rc); return rc; } /* * Close selected components. */ orte_iof_base.iof_flush = false; if (ORTE_SUCCESS != (rc = orte_iof_base_close())) { ORTE_ERROR_LOG(rc); return rc; } if (ORTE_SUCCESS != (rc = orte_smr_base_close())) { ORTE_ERROR_LOG(rc); return rc; } if (ORTE_SUCCESS != (rc = orte_gpr_base_close())) { ORTE_ERROR_LOG(rc); return rc; } if (ORTE_SUCCESS != (rc = orte_ns_base_close())) { ORTE_ERROR_LOG(rc); return rc; } if (ORTE_SUCCESS != (rc = orte_rml_base_close())) { ORTE_ERROR_LOG(rc); return rc; } if (ORTE_SUCCESS != (rc = orte_wait_finalize())) { ORTE_ERROR_LOG(rc); return rc; } /* * setup new global state */ orte_process_info.seed = false; /* if NULL, set ns_replica to old_name and set the corresponding uri parameter */ if (NULL == orte_process_info.ns_replica) { orte_process_info.ns_replica = old_name; orte_process_info.ns_replica_uri = strdup(uri); } /* if NULL, set gpr_replica to old_name and set the corresponding uri parameter */ if (NULL == orte_process_info.gpr_replica) { orte_process_info.gpr_replica = old_name; orte_process_info.gpr_replica_uri = strdup(uri); } /* ensure my_name is set to the new_name */ if (NULL != orte_process_info.my_name) { free(orte_process_info.my_name); } orte_process_info.my_name = new_name; #if 0 /* close the proc_info structure so it can be reinitialized */ if (ORTE_SUCCESS != (rc = orte_proc_info_finalize())) { ORTE_ERROR_LOG(rc); return rc; } /* set seed flag to false */ id = mca_base_param_register_int("seed", NULL, NULL, NULL, (int)false); if (ORTE_SUCCESS != (rc = mca_base_param_set_int(id, (int)false))) { ORTE_ERROR_LOG(rc); return rc; } /* call proc_info to reset the structure */ if (ORTE_SUCCESS != (rc = orte_proc_info())) { ORTE_ERROR_LOG(rc); return rc; } /* finalize the sys_info structure so it can be reinitialized */ if (ORTE_SUCCESS != (rc = orte_sys_info_finalize())) { ORTE_ERROR_LOG(rc); return rc; } /* call the sys_info function to load structure with any new info */ orte_system_info.init = false; if (ORTE_SUCCESS != (rc = orte_sys_info())) { ORTE_ERROR_LOG(rc); return rc; } /* establish the session directory structure for this process */ if (ORTE_SUCCESS != (rc = orte_ns.get_jobid_string(&jobid_str, orte_process_info.my_name))) { ORTE_ERROR_LOG(rc); return rc; } if (ORTE_SUCCESS != (rc = orte_ns.get_vpid_string(&procid_str, orte_process_info.my_name))) { ORTE_ERROR_LOG(rc); return rc; } if (orte_debug_flag) { opal_output(0, "[%lu,%lu,%lu] setting up session dir with", ORTE_NAME_ARGS(orte_process_info.my_name)); if (NULL != orte_process_info.tmpdir_base) { opal_output(0, "\ttmpdir %s", orte_process_info.tmpdir_base); } opal_output(0, "\tuniverse %s", orte_universe_info.name); opal_output(0, "\tuser %s", orte_system_info.user); opal_output(0, "\thost %s", orte_system_info.nodename); opal_output(0, "\tjobid %s", jobid_str); opal_output(0, "\tprocid %s", procid_str); } if (ORTE_SUCCESS != (rc = orte_session_dir(true, orte_process_info.tmpdir_base, orte_system_info.user, orte_system_info.nodename, NULL, orte_universe_info.name, jobid_str, procid_str))) { ORTE_ERROR_LOG(rc); if (jobid_str != NULL) free(jobid_str); if (procid_str != NULL) free(procid_str); return rc; } if (NULL != jobid_str) { free(jobid_str); } if (NULL != procid_str) { free(procid_str); } #endif /* * Re-open components. */ if (ORTE_SUCCESS != (rc = orte_wait_init())) { ORTE_ERROR_LOG(rc); return rc; } if (ORTE_SUCCESS != (rc = orte_ns_base_open())) { ORTE_ERROR_LOG(rc); return rc; } if (ORTE_SUCCESS != (rc = orte_rml_base_open())) { ORTE_ERROR_LOG(rc); return rc; } if (ORTE_SUCCESS != (rc = orte_gpr_base_open())) { ORTE_ERROR_LOG(rc); return rc; } if (ORTE_SUCCESS != (rc = orte_smr_base_open())) { ORTE_ERROR_LOG(rc); return rc; } /* * Select new modules. */ if (ORTE_SUCCESS != (rc = orte_rml_base_select())) { ORTE_ERROR_LOG(rc); return rc; } if (ORTE_SUCCESS != (rc = orte_ns_base_select())) { ORTE_ERROR_LOG(rc); return rc; } if (ORTE_SUCCESS != (rc = orte_gpr_base_select())) { ORTE_ERROR_LOG(rc); return rc; } if (ORTE_SUCCESS != (rc = orte_smr_base_select())) { ORTE_ERROR_LOG(rc); return rc; } /* * Set contact info for the replicas */ if (ORTE_SUCCESS != (rc = orte_rml.set_uri(orte_process_info.ns_replica_uri))) { ORTE_ERROR_LOG(rc); return rc; } if (ORTE_SUCCESS != (rc = orte_rml.set_uri(orte_process_info.gpr_replica_uri))) { ORTE_ERROR_LOG(rc); return rc; } /* * Re-init selected modules. */ if (ORTE_SUCCESS != (rc = orte_rml.init())) { ORTE_ERROR_LOG(rc); return rc; } if (ORTE_SUCCESS != (rc = orte_ns.init())) { ORTE_ERROR_LOG(rc); return rc; } if (ORTE_SUCCESS != (rc = orte_gpr.init())) { ORTE_ERROR_LOG(rc); return rc; } /* * Complete restart */ if (ORTE_SUCCESS != (rc = orte_iof_base_open())) { ORTE_ERROR_LOG(rc); return rc; } if (ORTE_SUCCESS != (rc = orte_iof_base_select())) { ORTE_ERROR_LOG(rc); return rc; } return ORTE_SUCCESS; }
static int rte_finalize(void) { char *contact_path; opal_list_item_t *item; /* remove my contact info file */ contact_path = opal_os_path(false, orte_process_info.top_session_dir, "contact.txt", NULL); unlink(contact_path); free(contact_path); orte_notifier_base_close(); orte_cr_finalize(); #if OPAL_ENABLE_FT == 1 orte_snapc_base_close(); #endif orte_filem_base_close(); orte_odls_base_close(); orte_wait_finalize(); orte_iof_base_close(); /* finalize selected modules so they can de-register * any receives */ orte_ras_base_close(); orte_rmaps_base_close(); orte_plm_base_close(); orte_errmgr_base_close(); /* now can close the rml and its friendly group comm */ orte_grpcomm_base_close(); orte_routed_base_close(); orte_rml_base_close(); /* cleanup the global list of local children and job data */ while (NULL != (item = opal_list_remove_first(&orte_local_children))) { OBJ_RELEASE(item); } OBJ_DESTRUCT(&orte_local_children); while (NULL != (item = opal_list_remove_first(&orte_local_jobdata))) { OBJ_RELEASE(item); } OBJ_DESTRUCT(&orte_local_jobdata); /* finalize the session directory tree */ orte_session_dir_finalize(ORTE_PROC_MY_NAME); /* clean out the global structures */ orte_proc_info_finalize(); if (NULL != orte_job_ident) { free(orte_job_ident); } /* close the xml output file, if open */ if (orte_xml_output) { fprintf(orte_xml_fp, "</%s>\n", orte_cmd_basename); fflush(orte_xml_fp); if (stdout != orte_xml_fp) { fclose(orte_xml_fp); } } return ORTE_SUCCESS; }
static int rte_finalize(void) { char *contact_path; opal_list_item_t *item; orte_node_t *node; orte_job_t *job; int i; /* remove my contact info file */ contact_path = opal_os_path(false, orte_process_info.top_session_dir, "contact.txt", NULL); unlink(contact_path); free(contact_path); orte_notifier_base_close(); orte_cr_finalize(); #if OPAL_ENABLE_FT_CR == 1 orte_snapc_base_close(); #endif orte_filem_base_close(); orte_odls_base_close(); orte_wait_finalize(); orte_iof_base_close(); /* finalize selected modules so they can de-register * any receives */ orte_ras_base_close(); orte_rmaps_base_close(); orte_plm_base_close(); orte_errmgr_base_close(); /* close the multicast */ #if ORTE_ENABLE_MULTICAST orte_rmcast_base_close(); #endif /* now can close the rml and its friendly group comm */ orte_grpcomm_base_close(); orte_routed_base_close(); orte_rml_base_close(); /* if we were doing timing studies, close the timing file */ if (orte_timing) { if (stdout != orte_timing_output && stderr != orte_timing_output) { fclose(orte_timing_output); } } /* cleanup the global list of local children and job data */ while (NULL != (item = opal_list_remove_first(&orte_local_children))) { OBJ_RELEASE(item); } OBJ_DESTRUCT(&orte_local_children); while (NULL != (item = opal_list_remove_first(&orte_local_jobdata))) { OBJ_RELEASE(item); } OBJ_DESTRUCT(&orte_local_jobdata); /* cleanup the job and node info arrays */ if (NULL != orte_node_pool) { for (i=0; i < orte_node_pool->size; i++) { if (NULL != (node = (orte_node_t*)opal_pointer_array_get_item(orte_node_pool,i))) { OBJ_RELEASE(node); } } OBJ_RELEASE(orte_node_pool); } if (NULL != orte_job_data) { for (i=0; i < orte_job_data->size; i++) { if (NULL != (job = (orte_job_t*)opal_pointer_array_get_item(orte_job_data,i))) { OBJ_RELEASE(job); } } OBJ_RELEASE(orte_job_data); } /* finalize the session directory tree */ orte_session_dir_finalize(ORTE_PROC_MY_NAME); /* clean out the global structures */ orte_proc_info_finalize(); if (NULL != orte_job_ident) { free(orte_job_ident); } /* close the xml output file, if open */ if (orte_xml_output) { fprintf(orte_xml_fp, "</mpirun>\n"); fflush(orte_xml_fp); if (stdout != orte_xml_fp) { fclose(orte_xml_fp); } } /* handle the orted-specific OPAL stuff */ opal_sysinfo_base_close(); opal_pstat_base_close(); return ORTE_SUCCESS; }