1
1

* add some comments about what the spawn selection constraints mean

* memory leak cleanups
* implement rsh's kill_proc and kill_job for the case where we
  keep the ssh connections alive.  At least, I think this will work.
  Need to test some more.

This commit was SVN r2884.
Этот коммит содержится в:
Brian Barrett 2004-09-29 21:29:51 +00:00
родитель f14cc9d4b9
Коммит d5f4ebde71
3 изменённых файлов: 65 добавлений и 8 удалений

Просмотреть файл

@ -6,27 +6,60 @@
#include "ompi_config.h" #include "ompi_config.h"
#include <sys/types.h>
#include <signal.h>
#include <errno.h>
#include "pcm_rsh.h" #include "pcm_rsh.h"
#include "include/constants.h" #include "include/constants.h"
#include "runtime/runtime.h"
#include "mca/pcm/pcm.h" #include "mca/pcm/pcm.h"
#include "mca/pcm/base/base_job_track.h" #include "mca/pcm/base/base_job_track.h"
int int
mca_pcm_rsh_kill_proc(struct mca_pcm_base_module_1_0_0_t* me, mca_pcm_rsh_kill_proc(struct mca_pcm_base_module_1_0_0_t* me_super,
ompi_process_name_t *name, int flags) ompi_process_name_t *name, int flags)
{ {
return OMPI_ERROR; pid_t pid;
mca_pcm_rsh_module_t *me = (mca_pcm_rsh_module_t*) me_super;
if (0 != (OMPI_RTE_SPAWN_HIGH_QOS &me->constraints)) {
pid = mca_pcm_base_get_started_pid(ns_base_get_jobid(name),
ns_base_get_vpid(name),
false);
if (pid <= 0) return errno;
kill(pid, SIGTERM);
} else {
return OMPI_ERR_NOT_IMPLEMENTED;
}
return OMPI_SUCCESS;
} }
int int
mca_pcm_rsh_kill_job(struct mca_pcm_base_module_1_0_0_t* me, mca_pcm_rsh_kill_job(struct mca_pcm_base_module_1_0_0_t* me_super,
mca_ns_base_jobid_t jobid, int flags) mca_ns_base_jobid_t jobid, int flags)
{ {
/* BWB - do stuff */ pid_t *pids;
size_t pids_len, i;
int ret;
mca_pcm_rsh_module_t *me = (mca_pcm_rsh_module_t*) me_super;
mca_pcm_base_remove_job(jobid); if (0 != (OMPI_RTE_SPAWN_HIGH_QOS &me->constraints)) {
ret = mca_pcm_base_get_started_pid_list(jobid, &pids,
&pids_len, false);
if (ret != OMPI_SUCCESS) return ret;
return OMPI_ERROR; for (i = 0 ; i < pids_len ; ++i) {
kill(pids[i], SIGTERM);
}
} else {
return OMPI_ERR_NOT_IMPLEMENTED;
}
return OMPI_SUCCESS;
} }

Просмотреть файл

@ -493,4 +493,7 @@ internal_wait_cb(pid_t pid, int status, void *data)
ompi_registry.rte_unregister(test); ompi_registry.rte_unregister(test);
} }
#endif #endif
/* bwb - fix me - should only remove this range */
mca_pcm_base_remove_job(jobid);
} }

Просмотреть файл

@ -24,10 +24,31 @@
#include "mpi/runtime/mpiruntime.h" #include "mpi/runtime/mpiruntime.h"
/* constants for spawn constraints */ /* constants for spawn constraints */
/** Spawn constraint - require multi-cell support. The selected spawn
system must be capable of starting across multiple cells. This
allows multiple pcms to be used to satisfy a single resource
allocation request */
#define OMPI_RTE_SPAWN_MULTI_CELL 0x0001 #define OMPI_RTE_SPAWN_MULTI_CELL 0x0001
/** Spawn constraint - require ability to launch daemons. The
selected spawn system must be capable of starting daemon process.
Setting this flag will result in a spawn service that does not
provide process monitoring or standard I/O forwarding. The caller
may exit before all children are cleaned up, but
OMPI_RTE_SPAWN_EARLY_EXIT is not implied because there is no
expectation of process monitoring. */
#define OMPI_RTE_SPAWN_DAEMON 0x0002 #define OMPI_RTE_SPAWN_DAEMON 0x0002
/** Spawn constraint - require quality of service support. The
selected spawn system must provide I/O forwarding, quick process
shutdown, and process status monitoring. */
#define OMPI_RTE_SPAWN_HIGH_QOS 0x0004 #define OMPI_RTE_SPAWN_HIGH_QOS 0x0004
#define OMPI_RTE_SPAWN_FROM_MPI 0x0008 /** Spawn constraint - caller is an MPI process. The caller is an MPI
application (has called MPI_Init). Implies
OMPI_RTE_SPAWN_EARLY_EXIT */
#define OMPI_RTE_SPAWN_FROM_MPI 0x0018
/** Spawn constraint - caller may exit before child. The caller may
exit before children have exited. */
#define OMPI_RTE_SPAWN_EARLY_EXIT 0x0010
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {