2005-06-18 01:12:50 +04:00
|
|
|
/* -*- C -*-
|
|
|
|
*
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
* 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$
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
/**
|
2005-08-09 02:17:22 +04:00
|
|
|
* @file:
|
2005-06-18 01:12:50 +04:00
|
|
|
* Header file for the bproc launcher. This launcher is actually split into 2
|
|
|
|
* modules: pls_bproc & pls_bproc_orted. The general idea behind this launcher is:
|
2005-08-09 02:17:22 +04:00
|
|
|
* -# pls_bproc is called by orterun. It figures out the process mapping and
|
2005-06-18 01:12:50 +04:00
|
|
|
* launches orted's on the nodes
|
2005-08-09 02:17:22 +04:00
|
|
|
* -# pls_bproc_orted is called by orted. This module intializes either a pty or
|
2005-06-18 01:12:50 +04:00
|
|
|
* pipes, places symlinks to them in well know points of the filesystem, and
|
|
|
|
* sets up the io forwarding. It then sends an ack back to orterun.
|
2005-08-09 02:17:22 +04:00
|
|
|
* -# pls_bproc waits for an ack to come back from the orteds, then does several
|
2005-06-18 01:12:50 +04:00
|
|
|
* parallel launches of the application processes. The number of launches is
|
|
|
|
* equal to the maximum number of processes on a node. For example, if there
|
|
|
|
* were 2 processes assigned to node 1, and 1 process asigned to node 2, we
|
|
|
|
* would do a parallel launch that launches on process on each node, then
|
|
|
|
* another which launches another process on node 1.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ORTE_PLS_BPROC_H_
|
|
|
|
#define ORTE_PLS_BPROC_H_
|
|
|
|
|
2005-07-13 23:46:55 +04:00
|
|
|
#include "orte_config.h"
|
2005-07-25 19:57:15 +04:00
|
|
|
#include "orte/class/orte_pointer_array.h"
|
|
|
|
#include "orte/include/orte_constants.h"
|
2005-07-13 23:46:55 +04:00
|
|
|
#include "orte/mca/pls/base/base.h"
|
2005-07-25 19:57:15 +04:00
|
|
|
#include "orte/util/proc_info.h"
|
2005-07-04 02:45:48 +04:00
|
|
|
#include "opal/threads/condition.h"
|
2005-06-18 01:12:50 +04:00
|
|
|
#include <sys/bproc.h>
|
|
|
|
|
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Module open / close
|
|
|
|
*/
|
|
|
|
int orte_pls_bproc_component_open(void);
|
|
|
|
int orte_pls_bproc_component_close(void);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Startup / Shutdown
|
|
|
|
*/
|
|
|
|
orte_pls_base_module_t* orte_pls_bproc_init(int *priority);
|
|
|
|
int orte_pls_bproc_finalize(void);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Interface
|
|
|
|
*/
|
|
|
|
int orte_pls_bproc_launch(orte_jobid_t);
|
|
|
|
int orte_pls_bproc_terminate_job(orte_jobid_t);
|
|
|
|
int orte_pls_bproc_terminate_proc(const orte_process_name_t* proc_name);
|
|
|
|
|
|
|
|
/**
|
2005-08-09 02:17:22 +04:00
|
|
|
* PLS bproc Component
|
2005-06-18 01:12:50 +04:00
|
|
|
*/
|
|
|
|
struct orte_pls_bproc_component_t {
|
|
|
|
orte_pls_base_component_t super;
|
2005-08-09 02:17:22 +04:00
|
|
|
/**< The base class */
|
2005-07-21 23:53:04 +04:00
|
|
|
bool done_launching;
|
2005-08-09 02:17:22 +04:00
|
|
|
/**< Is true if we are done launching the user's app. */
|
|
|
|
char * orted;
|
|
|
|
/**< The orted executeable. This can be an absolute path, or if not found
|
|
|
|
* we will look for it in the user's path */
|
2005-06-18 01:12:50 +04:00
|
|
|
int debug;
|
2005-08-09 02:17:22 +04:00
|
|
|
/**< If greater than 0 print debugging information */
|
2005-07-21 23:53:04 +04:00
|
|
|
int num_procs;
|
2005-08-09 02:17:22 +04:00
|
|
|
/**< The number of processes that are running */
|
2005-06-18 01:12:50 +04:00
|
|
|
int priority;
|
2005-08-09 02:17:22 +04:00
|
|
|
/**< The priority of this component. This will be returned if we determine
|
|
|
|
* that bproc is available and running on this node, */
|
2005-06-18 01:12:50 +04:00
|
|
|
int terminate_sig;
|
2005-08-09 02:17:22 +04:00
|
|
|
/**< The signal that gets sent to a process to kill it. */
|
2005-08-03 02:22:55 +04:00
|
|
|
size_t num_daemons;
|
2005-08-09 02:17:22 +04:00
|
|
|
/**< The number of daemons that are currently running. */
|
2005-07-13 23:46:55 +04:00
|
|
|
opal_mutex_t lock;
|
2005-08-09 02:17:22 +04:00
|
|
|
/**< Lock used to prevent some race conditions */
|
2005-07-21 23:53:04 +04:00
|
|
|
opal_condition_t condition;
|
2005-08-09 02:17:22 +04:00
|
|
|
/**< Condition that is signaled when all the daemons have died */
|
2005-07-25 19:57:15 +04:00
|
|
|
orte_pointer_array_t * daemon_names;
|
2005-08-09 02:17:22 +04:00
|
|
|
/**< Array of the process names of all the daemons. This is used to send
|
|
|
|
* the daemons a termonation signal when all the user processes are done */
|
2005-06-18 01:12:50 +04:00
|
|
|
};
|
2005-08-09 02:17:22 +04:00
|
|
|
/**
|
|
|
|
* Convenience typedef
|
|
|
|
*/
|
2005-06-18 01:12:50 +04:00
|
|
|
typedef struct orte_pls_bproc_component_t orte_pls_bproc_component_t;
|
|
|
|
|
|
|
|
ORTE_DECLSPEC extern orte_pls_bproc_component_t mca_pls_bproc_component;
|
|
|
|
ORTE_DECLSPEC extern orte_pls_base_module_t orte_pls_bproc_module;
|
|
|
|
|
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif /* ORTE_PLS_BPROC_H_ */
|
|
|
|
|