2006-08-11 01:46:52 +04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 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 (c) 2006 Sun Microsystems, Inc. All rights reserved.
|
|
|
|
* Use is subject to license terms.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @file:
|
|
|
|
* Process launcher for the Grid Engine
|
|
|
|
*
|
|
|
|
* (1) Example of running a batch job under the Grid Engine:
|
|
|
|
*
|
|
|
|
* Write a script and put in the MPI job
|
|
|
|
* @code
|
|
|
|
* % cat gridengine.csh
|
|
|
|
* #!/usr/bin/csh
|
|
|
|
*
|
|
|
|
* # you can optionally set PATH and LD_LIBRARY_PATH instead of setting prefix
|
|
|
|
* set prefix=/path_to/open-mpi-build
|
|
|
|
*
|
|
|
|
* /path_to/mpirun -np 4 -prefix $prefix ./connectivity -v
|
|
|
|
* @endcode
|
|
|
|
*
|
|
|
|
* Source the grid engine environment:
|
|
|
|
* @code
|
|
|
|
* % source /opt/n1ge/default/common/settings.csh
|
|
|
|
* @endcode
|
|
|
|
*
|
|
|
|
* Submit the job with 4 PE slots
|
|
|
|
* under a predefined Parallel Environment 'orte':
|
|
|
|
* @code
|
|
|
|
* % qsub -pe orte 4 gridengine.csh
|
|
|
|
* your job 305 ("gridengine.csh") has been submitted
|
|
|
|
* @endcode
|
|
|
|
*
|
|
|
|
* Getting the output:
|
|
|
|
* @code
|
|
|
|
* % more gridengine.csh.o305
|
|
|
|
* Warning: no access to tty (Bad file number).
|
|
|
|
* Thus no job control in this shell.
|
|
|
|
* Sun Microsystems Inc. SunOS 5.10 Generic January 2005
|
|
|
|
* checking connection 0 <-> 1
|
|
|
|
* checking connection 0 <-> 2
|
|
|
|
* checking connection 1 <-> 2
|
|
|
|
* checking connection 0 <-> 3
|
|
|
|
* checking connection 1 <-> 3
|
|
|
|
* checking connection 2 <-> 3
|
|
|
|
* Connectivity test on 4 processes PASSED.
|
|
|
|
* @endcode
|
|
|
|
*
|
|
|
|
* (2) Example of running an interactive job under the Grid Engine:
|
|
|
|
*
|
|
|
|
* Source the grid engine environment:
|
|
|
|
* @code
|
|
|
|
* % source /opt/n1ge/default/common/settings.csh
|
|
|
|
* @endcode
|
|
|
|
*
|
|
|
|
* Start an interactive job with 4 slots
|
|
|
|
* under a predefined Parallel Environment 'orte':
|
|
|
|
* @code
|
|
|
|
* % qsh -pe orte 4
|
|
|
|
* waiting for interactive job to be scheduled ...
|
|
|
|
* Your interactive job 324 has been successfully scheduled.
|
|
|
|
* @endcode
|
|
|
|
*
|
|
|
|
* Run the MPI job. You may need to set PATH and LD_LIBRARY_PATH or -prefix
|
|
|
|
* @code
|
|
|
|
* % /path_to/mpirun -np 4 hostname
|
|
|
|
* host-5
|
|
|
|
* host-5
|
|
|
|
* host-4
|
|
|
|
* host-4
|
|
|
|
* @endcode
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ORTE_PLS_GRIDENGINE_EXPORT_H
|
|
|
|
#define ORTE_PLS_GRIDENGINE_EXPORT_H
|
|
|
|
|
|
|
|
#include "orte_config.h"
|
2007-01-25 17:17:44 +03:00
|
|
|
|
|
|
|
#ifdef HAVE_SYS_TIME_H
|
|
|
|
#include <sys/time.h>
|
|
|
|
#endif
|
|
|
|
|
2006-08-11 01:46:52 +04:00
|
|
|
#include "orte/mca/pls/pls.h"
|
|
|
|
#include "opal/mca/mca.h"
|
|
|
|
|
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Module open / close
|
|
|
|
*/
|
|
|
|
int orte_pls_gridengine_component_open(void);
|
|
|
|
int orte_pls_gridengine_component_close(void);
|
|
|
|
orte_pls_base_module_t* orte_pls_gridengine_component_init(int *priority);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Startup / Shutdown
|
|
|
|
*/
|
|
|
|
int orte_pls_gridengine_finalize(void);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Interface
|
|
|
|
*/
|
2006-09-15 01:29:51 +04:00
|
|
|
int orte_pls_gridengine_launch_job(orte_jobid_t);
|
2007-01-25 17:17:44 +03:00
|
|
|
int orte_pls_gridengine_terminate_job(orte_jobid_t, struct timeval *timeout, opal_list_t *attrs);
|
2007-04-25 15:51:18 +04:00
|
|
|
int orte_pls_gridengine_terminate_orteds(struct timeval *timeout, opal_list_t *attrs);
|
2006-08-11 01:46:52 +04:00
|
|
|
int orte_pls_gridengine_terminate_proc(const orte_process_name_t*);
|
Bring over the update to terminate orteds that are generated by a dynamic spawn such as comm_spawn. This introduces the concept of a job "family" - i.e., jobs that have a parent/child relationship. Comm_spawn'ed jobs have a parent (the one that spawned them). We track that relationship throughout the lineage - i.e., if a comm_spawned job in turn calls comm_spawn, then it has a parent (the one that spawned it) and a "root" job (the original job that started things).
Accordingly, there are new APIs to the name service to support the ability to get a job's parent, root, immediate children, and all its descendants. In addition, the terminate_job, terminate_orted, and signal_job APIs for the PLS have been modified to accept attributes that define the extent of their actions. For example, doing a "terminate_job" with an attribute of ORTE_NS_INCLUDE_DESCENDANTS will terminate the given jobid AND all jobs that descended from it.
I have tested this capability on a MacBook under rsh, Odin under SLURM, and LANL's Flash (bproc). It worked successfully on non-MPI jobs (both simple and including a spawn), and MPI jobs (again, both simple and with a spawn).
This commit was SVN r12597.
2006-11-14 22:34:59 +03:00
|
|
|
int orte_pls_gridengine_signal_job(orte_jobid_t, int32_t, opal_list_t *attrs);
|
2006-08-11 01:46:52 +04:00
|
|
|
int orte_pls_gridengine_signal_proc(const orte_process_name_t*, int32_t);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* PLS Component
|
|
|
|
*/
|
|
|
|
struct orte_pls_gridengine_component_t {
|
|
|
|
orte_pls_base_component_t super;
|
|
|
|
orte_jobid_t jobid;
|
|
|
|
int priority;
|
|
|
|
int verbose;
|
|
|
|
int debug;
|
|
|
|
char* orted;
|
|
|
|
};
|
|
|
|
typedef struct orte_pls_gridengine_component_t orte_pls_gridengine_component_t;
|
|
|
|
|
2006-08-24 00:40:01 +04:00
|
|
|
ORTE_MODULE_DECLSPEC extern orte_pls_gridengine_component_t mca_pls_gridengine_component;
|
|
|
|
extern orte_pls_base_module_t orte_pls_gridengine_module;
|
2006-08-11 01:46:52 +04:00
|
|
|
|
|
|
|
|
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif /* ORTE_PLS_GRIDENGINE_EXPORT_H */
|