1
1
openmpi/orte/mca/plm/base/plm_private.h
Ralph Castain c56acf60ca Although we never really thought about it, we made an unconscious assumption in the mapper system - we assumed that the daemons would be placed on nodes in the order that the nodes appear in the allocation. In other words, we assumed that the launch environment would map processes in node order.
Turns out, this isn't necessarily true. The Cray, for example, launches processes in a toroidal pattern, thus causing the daemons to wind up somewhere other than what we thought. Other environments (e.g., slurm) are also capable of such behavior, depending upon the default mapping algorithm they are told to use.

Resolve this problem by making the daemon-to-node assignment in the affected environments when the daemon calls back and tells us what node it is on. Order the nodes in the mapping list so they are in daemon-vpid order as opposed to the order in which they show in the allocation. For environments that don't exhibit this mapping behavior (e.g., rsh), this won't have any impact.

Also, clean up the vm launch procedure a little bit so it more closely aligns with the state machine implementation that is coming, and remove some lingering "slave" code.

This commit was SVN r25551.
2011-11-30 19:58:24 +00:00

142 строки
4.2 KiB
C

/*
* Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2006 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/** @file:
*/
#ifndef MCA_PLM_PRIVATE_H
#define MCA_PLM_PRIVATE_H
/*
* includes
*/
#include "orte_config.h"
#include "orte/types.h"
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif /* HAVE_SYS_TIME_H */
#include "opal/class/opal_list.h"
#include "opal/class/opal_pointer_array.h"
#include "opal/dss/dss_types.h"
#include "opal/threads/condition.h"
#include "opal/dss/dss_types.h"
#include "orte/mca/plm/plm_types.h"
#include "orte/mca/rml/rml_types.h"
#include "orte/mca/odls/odls_types.h"
#include "orte/runtime/orte_globals.h"
BEGIN_C_DECLS
/* globals for use solely within PLM framework */
typedef struct {
/** Verbose/debug output stream */
int output;
/* orted cmd comm lock */
opal_mutex_t orted_cmd_lock;
/* orted cmd cond */
opal_condition_t orted_cmd_cond;
/* next jobid */
uint16_t next_jobid;
/* time when daemons started launch */
struct timeval daemonlaunchstart;
/* spawn lock */
opal_mutex_t spawn_lock;
/* spawn cond */
opal_condition_t spawn_cond;
/* spawn status */
int spawn_status;
/* completion flag */
bool spawn_complete;
/* spawn in progress cond */
opal_condition_t spawn_in_progress_cond;
/* flag */
bool spawn_in_progress;
/* tree spawn cmd */
opal_buffer_t tree_spawn_cmd;
/* daemon nodes assigned at launch */
bool daemon_nodes_assigned_at_launch;
} orte_plm_globals_t;
/**
* Global instance of PLM framework data
*/
ORTE_DECLSPEC extern orte_plm_globals_t orte_plm_globals;
/**
* Utility routine to set progress engine schedule
*/
ORTE_DECLSPEC int orte_plm_base_set_progress_sched(int sched);
/*
* Launch support
*/
ORTE_DECLSPEC int orte_plm_base_setup_job(orte_job_t *jdata);
ORTE_DECLSPEC int orte_plm_base_launch_apps(orte_jobid_t job);
ORTE_DECLSPEC int orte_plm_base_daemon_callback(orte_std_cntr_t num_daemons);
ORTE_DECLSPEC int orte_plm_base_set_hnp_name(void);
ORTE_DECLSPEC int orte_plm_base_create_jobid(orte_job_t *jdata);
ORTE_DECLSPEC void orte_plm_base_reset_job(orte_job_t *jdata);
ORTE_DECLSPEC int orte_plm_base_setup_orted_cmd(int *argc, char ***argv);
ORTE_DECLSPEC int orte_plm_base_setup_virtual_machine(orte_job_t *jdata);
/**
* Utilities for plm components that use proxy daemons
*/
ORTE_DECLSPEC int orte_plm_base_orted_exit(orte_daemon_cmd_flag_t command);
ORTE_DECLSPEC int orte_plm_base_orted_terminate_job(orte_jobid_t jobid);
ORTE_DECLSPEC int orte_plm_base_orted_kill_local_procs(opal_pointer_array_t *procs);
ORTE_DECLSPEC int orte_plm_base_orted_signal_local_procs(orte_jobid_t job, int32_t signal);
/*
* communications utilities
*/
ORTE_DECLSPEC int orte_plm_base_comm_start(void);
ORTE_DECLSPEC int orte_plm_base_comm_stop(void);
ORTE_DECLSPEC void orte_plm_base_recv(int status, orte_process_name_t* sender,
opal_buffer_t* buffer, orte_rml_tag_t tag,
void* cbdata);
/**
* Construct basic ORTE Daemon command line arguments
*/
ORTE_DECLSPEC int orte_plm_base_orted_append_basic_args(int *argc, char ***argv,
char *ess_module,
int *proc_vpid_index,
char *nodes);
/*
* Proxy functions for use by daemons and application procs
* needing dynamic operations
*/
ORTE_DECLSPEC int orte_plm_proxy_init(void);
ORTE_DECLSPEC int orte_plm_proxy_spawn(orte_job_t *jdata);
ORTE_DECLSPEC int orte_plm_proxy_finalize(void);
END_C_DECLS
#endif /* MCA_PLS_PRIVATE_H */