static int lsf_set_name(void) { int rc; int lsf_nodeid; orte_jobid_t jobid; orte_vpid_t vpid; char* tmp; mca_base_param_reg_string_name("orte", "ess_jobid", "Process jobid", true, false, NULL, &tmp); if (NULL == tmp) { ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); return ORTE_ERR_NOT_FOUND; } if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_jobid(&jobid, tmp))) { ORTE_ERROR_LOG(rc); return(rc); } free(tmp); ORTE_PROC_MY_NAME->jobid = jobid; /* get the vpid from the nodeid */ mca_base_param_reg_string_name("orte", "ess_vpid", "Process vpid", true, false, NULL, &tmp); if (NULL == tmp) { ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); return ORTE_ERR_NOT_FOUND; } if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_vpid(&vpid, tmp))) { ORTE_ERROR_LOG(rc); return(rc); } free(tmp); lsf_nodeid = atoi(getenv("LSF_PM_TASKID")); opal_output_verbose(1, orte_ess_base_output, "ess:lsf found LSF_PM_TASKID set to %d", lsf_nodeid); ORTE_PROC_MY_NAME->vpid = vpid + lsf_nodeid - 1; /* get the non-name common environmental variables */ if (ORTE_SUCCESS != (rc = orte_ess_env_get())) { ORTE_ERROR_LOG(rc); return rc; } return ORTE_SUCCESS; }
static int slave_set_name(void) { char *jobid_str, *procid_str; int id, rc; orte_jobid_t jobid; orte_vpid_t vpid; id = mca_base_param_register_string("orte", "ess", "jobid", NULL, NULL); mca_base_param_lookup_string(id, &jobid_str); if (NULL == jobid_str) { ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); return ORTE_ERR_NOT_FOUND; } if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_jobid(&jobid, jobid_str))) { ORTE_ERROR_LOG(rc); return(rc); } free(jobid_str); id = mca_base_param_register_string("orte", "ess", "vpid", NULL, NULL); mca_base_param_lookup_string(id, &procid_str); if (NULL == procid_str) { ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); return ORTE_ERR_NOT_FOUND; } if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_vpid(&vpid, procid_str))) { ORTE_ERROR_LOG(rc); return(rc); } free(procid_str); ORTE_PROC_MY_NAME->jobid = jobid; ORTE_PROC_MY_NAME->vpid = vpid; ORTE_EPOCH_SET(ORTE_PROC_MY_NAME->epoch,orte_ess.proc_get_epoch(ORTE_PROC_MY_NAME)); OPAL_OUTPUT_VERBOSE((1, orte_ess_base_output, "ess:slave set name to %s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME))); /* get the non-name common environmental variables */ if (ORTE_SUCCESS != (rc = orte_ess_env_get())) { ORTE_ERROR_LOG(rc); return rc; } return ORTE_SUCCESS; }
static int env_set_name(void) { char *tmp; int rc; orte_jobid_t jobid; orte_vpid_t vpid; mca_base_param_reg_string_name("orte", "ess_jobid", "Process jobid", true, false, NULL, &tmp); if (NULL == tmp) { ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); return ORTE_ERR_NOT_FOUND; } if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_jobid(&jobid, tmp))) { ORTE_ERROR_LOG(rc); return(rc); } free(tmp); mca_base_param_reg_string_name("orte", "ess_vpid", "Process vpid", true, false, NULL, &tmp); if (NULL == tmp) { ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); return ORTE_ERR_NOT_FOUND; } if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_vpid(&vpid, tmp))) { ORTE_ERROR_LOG(rc); return(rc); } free(tmp); ORTE_PROC_MY_NAME->jobid = jobid; ORTE_PROC_MY_NAME->vpid = vpid; OPAL_OUTPUT_VERBOSE((1, orte_ess_base_output, "ess:env set name to %s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME))); /* get the non-name common environmental variables */ if (ORTE_SUCCESS != (rc = orte_ess_env_get())) { ORTE_ERROR_LOG(rc); return rc; } return ORTE_SUCCESS; }
static int alps_set_name(void) { int rc; int rank; orte_jobid_t jobid; if (NULL == orte_ess_base_jobid) { ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); return ORTE_ERR_NOT_FOUND; } if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_jobid(&jobid, orte_ess_base_jobid))) { ORTE_ERROR_LOG(rc); return rc; } if (NULL == orte_ess_base_vpid) { ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); return ORTE_ERR_NOT_FOUND; } if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_vpid(&starting_vpid, orte_ess_base_vpid))) { ORTE_ERROR_LOG(rc); return(rc); } ORTE_PROC_MY_NAME->jobid = jobid; if (ORTE_SUCCESS != (rc = orte_ess_alps_get_first_rank_on_node(&rank))) { ORTE_ERROR_LOG(rc); return(rc); } ORTE_PROC_MY_NAME->vpid = (orte_vpid_t)rank + starting_vpid; /* get the num procs as provided in the cmd line param */ if (ORTE_SUCCESS != (rc = orte_ess_env_get())) { ORTE_ERROR_LOG(rc); return rc; } return ORTE_SUCCESS; }
static int tm_set_name(void) { int rc; orte_jobid_t jobid; orte_vpid_t vpid; OPAL_OUTPUT_VERBOSE((1, orte_ess_base_framework.framework_output, "ess:tm setting name")); if (NULL == orte_ess_base_jobid) { ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); return ORTE_ERR_NOT_FOUND; } if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_jobid(&jobid, orte_ess_base_jobid))) { ORTE_ERROR_LOG(rc); return(rc); } if (NULL == orte_ess_base_vpid) { ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); return ORTE_ERR_NOT_FOUND; } if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_vpid(&vpid, orte_ess_base_vpid))) { ORTE_ERROR_LOG(rc); return(rc); } ORTE_PROC_MY_NAME->jobid = jobid; ORTE_PROC_MY_NAME->vpid = vpid; OPAL_OUTPUT_VERBOSE((1, orte_ess_base_framework.framework_output, "ess:tm set name to %s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME))); /* get the non-name common environmental variables */ if (ORTE_SUCCESS != (rc = orte_ess_env_get())) { ORTE_ERROR_LOG(rc); return rc; } return ORTE_SUCCESS; }
static int slurm_set_name(void) { int slurm_nodeid; int rc; orte_jobid_t jobid; orte_vpid_t vpid; char* tmp; OPAL_OUTPUT_VERBOSE((1, orte_ess_base_output, "ess:slurm setting name")); mca_base_param_reg_string_name("orte", "ess_jobid", "Process jobid", true, false, NULL, &tmp); if (NULL == tmp) { ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); return ORTE_ERR_NOT_FOUND; } if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_jobid(&jobid, tmp))) { ORTE_ERROR_LOG(rc); return(rc); } free(tmp); mca_base_param_reg_string_name("orte", "ess_vpid", "Process vpid", true, false, NULL, &tmp); if (NULL == tmp) { ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); return ORTE_ERR_NOT_FOUND; } if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_vpid(&vpid, tmp))) { ORTE_ERROR_LOG(rc); return(rc); } free(tmp); ORTE_PROC_MY_NAME->jobid = jobid; /* fix up the vpid and make it the "real" vpid */ slurm_nodeid = atoi(getenv("SLURM_NODEID")); ORTE_PROC_MY_NAME->vpid = vpid + slurm_nodeid; OPAL_OUTPUT_VERBOSE((1, orte_ess_base_output, "ess:slurm set name to %s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME))); /* get my node rank in case we are using static ports - this won't * be present for daemons, so don't error out if we don't have it */ mca_base_param_reg_string_name("orte", "ess_node_rank", "Process node rank", true, false, NULL, &tmp); if (NULL != tmp) { my_node_rank = strtol(tmp, NULL, 10); } /* fix up the system info nodename to match exactly what slurm returned */ if (NULL != orte_process_info.nodename) { free(orte_process_info.nodename); } orte_process_info.nodename = get_slurm_nodename(slurm_nodeid); OPAL_OUTPUT_VERBOSE((1, orte_ess_base_output, "ess:slurm set nodename to %s", orte_process_info.nodename)); /* get the non-name common environmental variables */ if (ORTE_SUCCESS != (rc = orte_ess_env_get())) { ORTE_ERROR_LOG(rc); return rc; } return ORTE_SUCCESS; }
static int slurm_set_name(void) { int slurm_nodeid; int rc; int id; orte_jobid_t jobid; orte_vpid_t vpid; char* jobid_string; char* vpid_string; char *nodeid; OPAL_OUTPUT_VERBOSE((1, orte_ess_base_output, "ess:slurm setting name")); id = mca_base_param_register_string("orte", "ess", "jobid", NULL, NULL); mca_base_param_lookup_string(id, &jobid_string); if (NULL == jobid_string) { ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); return ORTE_ERR_NOT_FOUND; } if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_jobid(&jobid, jobid_string))) { ORTE_ERROR_LOG(rc); return(rc); } id = mca_base_param_register_string("orte", "ess", "vpid", NULL, NULL); mca_base_param_lookup_string(id, &vpid_string); if (NULL == vpid_string) { ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); return ORTE_ERR_NOT_FOUND; } if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_vpid(&vpid, vpid_string))) { ORTE_ERROR_LOG(rc); return(rc); } ORTE_PROC_MY_NAME->jobid = jobid; /* fix up the vpid and make it the "real" vpid */ if (NULL == (nodeid = getenv("SLURM_NODEID"))) { opal_output(0, "SLURM_NODEID not found - cannot define name"); return ORTE_ERR_NOT_FOUND; } slurm_nodeid = atoi(nodeid); ORTE_PROC_MY_NAME->vpid = vpid + slurm_nodeid; OPAL_OUTPUT_VERBOSE((1, orte_ess_base_output, "ess:slurm set name to %s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME))); /* fix up the system info nodename to match exactly what slurm returned */ if (NULL != orte_process_info.nodename) { free(orte_process_info.nodename); } orte_process_info.nodename = get_slurm_nodename(slurm_nodeid); OPAL_OUTPUT_VERBOSE((1, orte_ess_base_output, "ess:slurm set nodename to %s", orte_process_info.nodename)); /* get the non-name common environmental variables */ if (ORTE_SUCCESS != (rc = orte_ess_env_get())) { ORTE_ERROR_LOG(rc); return rc; } return ORTE_SUCCESS; }
static int slurm_set_name(void) { int slurm_nodeid; int rc; orte_jobid_t jobid; orte_vpid_t vpid; char *tmp; OPAL_OUTPUT_VERBOSE((1, orte_ess_base_framework.framework_output, "ess:slurm setting name")); if (NULL == orte_ess_base_jobid) { ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); return ORTE_ERR_NOT_FOUND; } if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_jobid(&jobid, orte_ess_base_jobid))) { ORTE_ERROR_LOG(rc); return(rc); } if (NULL == orte_ess_base_vpid) { ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); return ORTE_ERR_NOT_FOUND; } if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_vpid(&vpid, orte_ess_base_vpid))) { ORTE_ERROR_LOG(rc); return(rc); } ORTE_PROC_MY_NAME->jobid = jobid; /* fix up the vpid and make it the "real" vpid */ slurm_nodeid = atoi(getenv("SLURM_NODEID")); ORTE_PROC_MY_NAME->vpid = vpid + slurm_nodeid; OPAL_OUTPUT_VERBOSE((1, orte_ess_base_framework.framework_output, "ess:slurm set name to %s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME))); /* fix up the system info nodename to match exactly what slurm returned */ if (NULL != orte_process_info.nodename) { free(orte_process_info.nodename); } if (NULL == (tmp = getenv("SLURMD_NODENAME"))) { ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); return ORTE_ERR_NOT_FOUND; } orte_process_info.nodename = strdup(tmp); OPAL_OUTPUT_VERBOSE((1, orte_ess_base_framework.framework_output, "ess:slurm set nodename to %s", (NULL == orte_process_info.nodename) ? "NULL" : orte_process_info.nodename)); /* get the non-name common environmental variables */ if (ORTE_SUCCESS != (rc = orte_ess_env_get())) { ORTE_ERROR_LOG(rc); return rc; } return ORTE_SUCCESS; }
static int alps_set_name(void) { int rc; orte_jobid_t jobid; char *tmp; orte_vpid_t vpid; OPAL_OUTPUT_VERBOSE((1, orte_ess_base_output, "ess:alps setting name")); mca_base_param_reg_string_name("orte", "ess_jobid", "Process jobid", true, false, NULL, &tmp); if (NULL == tmp) { ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); return ORTE_ERR_NOT_FOUND; } if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_jobid(&jobid, tmp))) { ORTE_ERROR_LOG(rc); return rc; } free(tmp); mca_base_param_reg_string_name("orte", "ess_vpid", "Process vpid", true, false, NULL, &tmp); if (NULL == tmp) { ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND); return ORTE_ERR_NOT_FOUND; } if (ORTE_SUCCESS != (rc = orte_util_convert_string_to_vpid(&starting_vpid, tmp))) { ORTE_ERROR_LOG(rc); return(rc); } free(tmp); if (ORTE_SUCCESS != (rc = get_vpid(&vpid, starting_vpid))) { ORTE_ERROR_LOG(rc); return rc; } ORTE_PROC_MY_NAME->jobid = jobid; ORTE_PROC_MY_NAME->vpid = vpid; ORTE_EPOCH_SET(ORTE_PROC_MY_NAME->epoch,ORTE_EPOCH_INVALID); ORTE_EPOCH_SET(ORTE_PROC_MY_NAME->epoch, orte_ess.proc_get_epoch(ORTE_PROC_MY_NAME)); OPAL_OUTPUT_VERBOSE((1, orte_ess_base_output, "ess:alps set name to %s", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME))); /* get the num procs as provided in the cmd line param */ if (ORTE_SUCCESS != (rc = orte_ess_env_get())) { ORTE_ERROR_LOG(rc); return rc; } if (orte_process_info.max_procs < orte_process_info.num_procs) { orte_process_info.max_procs = orte_process_info.num_procs; } return ORTE_SUCCESS; }