Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pm/hydra/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ AC_ARG_WITH(hydra-bstrap,
[AC_HELP_STRING([--with-hydra-bstrap=name],
[Bstrap Server (ssh,rsh,slurm,ll,lsf,sge,pbs)])],
[ hydra_bstrap=$withval ],
[ hydra_bstrap="ssh,slurm" ])
[ hydra_bstrap="ssh,slurm,rsh,ll" ])
AC_MSG_CHECKING(bstrap server)
AC_MSG_RESULT($hydra_bstrap)
hydra_bstrap_list="`echo $hydra_bstrap | sed -e 's/:/ /g' -e 's/,/ /g'`"
Expand Down
2 changes: 2 additions & 0 deletions src/pm/hydra/libhydra/bstrap/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
include libhydra/bstrap/src/Makefile.mk
include libhydra/bstrap/ssh/Makefile.mk
include libhydra/bstrap/slurm/Makefile.mk
include libhydra/bstrap/rsh/Makefile.mk
include libhydra/bstrap/ll/Makefile.mk
14 changes: 14 additions & 0 deletions src/pm/hydra/libhydra/bstrap/ll/Makefile.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## -*- Mode: Makefile; -*-
##
## (C) 2017 by Argonne National Laboratory.
## See COPYRIGHT in top-level directory.
##

AM_CPPFLAGS += -I$(top_srcdir)/libhydra/bstrap/ll

noinst_HEADERS += \
libhydra/bstrap/ll/hydra_bstrap_ll.h

libhydra_la_SOURCES += \
libhydra/bstrap/ll/ll_launch.c \
libhydra/bstrap/ll/ll_finalize.c
16 changes: 16 additions & 0 deletions src/pm/hydra/libhydra/bstrap/ll/hydra_bstrap_ll.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
* (C) 2010 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#ifndef HYDRA_BSTRAP_LL_H_INCLUDED
#define HYDRA_BSTRAP_LL_H_INCLUDED

#include "hydra_base.h"

HYD_status HYDI_bstrap_ll_launch(const char *hostname, const char *launch_exec, char **args,
int *fd_stdin, int *fd_stdout, int *fd_stderr, int *pid,
int debug);
HYD_status HYDI_bstrap_ll_finalize(void);

#endif /* HYDRA_BSTRAP_LL_H_INCLUDED */
18 changes: 18 additions & 0 deletions src/pm/hydra/libhydra/bstrap/ll/ll_finalize.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
* (C) 2010 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include "hydra_bstrap_ll.h"
#include "hydra_err.h"

HYD_status HYDI_bstrap_ll_finalize(void)
{
HYD_status status = HYD_SUCCESS;

fn_exit:
return status;

fn_fail:
goto fn_exit;
}
62 changes: 62 additions & 0 deletions src/pm/hydra/libhydra/bstrap/ll/ll_launch.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
* (C) 2010 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include "hydra_bstrap_ll.h"
#include "hydra_str.h"
#include "hydra_err.h"
#include "hydra_fs.h"
#include "hydra_spawn.h"


HYD_status HYDI_bstrap_ll_launch(const char *hostname, const char *launch_exec, char **args,
int *fd_stdin, int *fd_stdout, int *fd_stderr, int *pid,
int debug)
{
char *targs[HYD_NUM_TMP_STRINGS] = { NULL };
int idx, i;
char *lexec = NULL;
HYD_status status = HYD_SUCCESS;

HYD_FUNC_ENTER();

/* We use the following priority order for the executable path:
* (1) user-specified; (2) search in path; (3) Hard-coded
* location */
if (launch_exec)
lexec = MPL_strdup(launch_exec);
if (lexec == NULL)
lexec = HYD_find_full_path("llspawn.stdio");
if (lexec == NULL)
lexec = MPL_strdup("/usr/bin/llspawn.stdio");
HYD_ASSERT(lexec, status);

idx = 0;

targs[idx++] = MPL_strdup(lexec);
targs[idx++] = MPL_strdup(hostname);
for (i = 0; args[i]; i++)
targs[idx++] = MPL_strdup(args[i]);
targs[idx++] = NULL;

if (debug) {
HYD_PRINT(stdout, "Launch arguments: ");
HYD_str_print_list(targs);
}

status = HYD_spawn(targs, 0, NULL, fd_stdin, fd_stdout, fd_stderr, pid, -1);
HYD_ERR_POP(status, "create process returned error\n");

fn_exit:
HYD_str_free_list(targs);
if (lexec)
MPL_free(lexec);
HYD_FUNC_EXIT();
return status;

fn_fail:
goto fn_exit;
}


14 changes: 14 additions & 0 deletions src/pm/hydra/libhydra/bstrap/rsh/Makefile.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## -*- Mode: Makefile; -*-
##
## (C) 2017 by Argonne National Laboratory.
## See COPYRIGHT in top-level directory.
##

AM_CPPFLAGS += -I$(top_srcdir)/libhydra/bstrap/rsh

noinst_HEADERS += \
libhydra/bstrap/rsh/hydra_bstrap_rsh.h

libhydra_la_SOURCES += \
libhydra/bstrap/rsh/rsh_launch.c \
libhydra/bstrap/rsh/rsh_finalize.c
16 changes: 16 additions & 0 deletions src/pm/hydra/libhydra/bstrap/rsh/hydra_bstrap_rsh.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
* (C) 2010 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#ifndef HYDRA_BSTRAP_RSH_H_INCLUDED
#define HYDRA_BSTRAP_RSH_H_INCLUDED

#include "hydra_base.h"

HYD_status HYDI_bstrap_rsh_launch(const char *hostname, const char *launch_exec, char **args,
int *fd_stdin, int *fd_stdout, int *fd_stderr, int *pid,
int debug);
HYD_status HYDI_bstrap_rsh_finalize(void);

#endif /* HYDRA_BSTRAP_RSH_H_INCLUDED */
18 changes: 18 additions & 0 deletions src/pm/hydra/libhydra/bstrap/rsh/rsh_finalize.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
* (C) 2010 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include "hydra_bstrap_rsh.h"
#include "hydra_err.h"

HYD_status HYDI_bstrap_rsh_finalize(void)
{
HYD_status status = HYD_SUCCESS;

fn_exit:
return status;

fn_fail:
goto fn_exit;
}
66 changes: 66 additions & 0 deletions src/pm/hydra/libhydra/bstrap/rsh/rsh_launch.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
* (C) 2010 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include "hydra_bstrap_rsh.h"
#include "hydra_str.h"
#include "hydra_err.h"
#include "hydra_fs.h"
#include "hydra_spawn.h"


HYD_status HYDI_bstrap_rsh_launch(const char *hostname, const char *launch_exec, char **args,
int *fd_stdin, int *fd_stdout, int *fd_stderr, int *pid,
int debug)
{
char *targs[HYD_NUM_TMP_STRINGS] = { NULL };
int idx, i;
char *lexec = NULL;
HYD_status status = HYD_SUCCESS;

HYD_FUNC_ENTER();

/* We use the following priority order for the executable path:
* (1) user-specified; (2) search in path; (3) Hard-coded
* location */
if (launch_exec)
lexec = MPL_strdup(launch_exec);
if (lexec == NULL)
lexec = HYD_find_full_path("rsh");
if (lexec == NULL)
lexec = MPL_strdup("/usr/bin/rsh");
HYD_ASSERT(lexec, status);

idx = 0;
targs[idx++] = MPL_strdup(lexec);

targs[idx++] = MPL_strdup(hostname);

/* Fill in the remaining arguments */
/* We do not need to create a quoted version of the string for
* SLURM. It seems to be internally quoting it anyway. */
for (i = 0; args[i]; i++)
targs[idx++] = MPL_strdup(args[i]);

if (debug) {
HYD_PRINT(stdout, "Launch arguments: ");
HYD_str_print_list(targs);
}


status = HYD_spawn(targs, 0, NULL, fd_stdin, fd_stdout, fd_stderr, pid, -1);
HYD_ERR_POP(status, "create process returned error\n");

fn_exit:
HYD_str_free_list(targs);
if (lexec)
MPL_free(lexec);
HYD_FUNC_EXIT();
return status;

fn_fail:
goto fn_exit;
}


14 changes: 14 additions & 0 deletions src/pm/hydra/libhydra/bstrap/sge/Makefile.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## -*- Mode: Makefile; -*-
##
## (C) 2017 by Argonne National Laboratory.
## See COPYRIGHT in top-level directory.
##

AM_CPPFLAGS += -I$(top_srcdir)/libhydra/bstrap/sge

noinst_HEADERS += \
libhydra/bstrap/sge/hydra_bstrap_sge.h

libhydra_la_SOURCES += \
libhydra/bstrap/sge/sge_launch.c \
libhydra/bstrap/sge/sge_finalize.c
17 changes: 17 additions & 0 deletions src/pm/hydra/libhydra/bstrap/sge/hydra_bstrap_sge.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
* (C) 2010 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#ifndef HYDRA_BSTRAP_SGE_H_INCLUDED
#define HYDRA_BSTRAP_SGE_H_INCLUDED

#include "hydra_base.h"
#include "hydra_mem.h"

HYD_status HYDI_bstrap_sge_launch(const char *hostname, const char *launch_exec, char **args,
int *fd_stdin, int *fd_stdout, int *fd_stderr, int *pid,
int debug);
HYD_status HYDI_bstrap_sge_finalize(void);

#endif /* HYDRA_BSTRAP_SGE_H_INCLUDED */
18 changes: 18 additions & 0 deletions src/pm/hydra/libhydra/bstrap/sge/sge_finalize.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
* (C) 2010 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include "hydra_bstrap_sge.h"
#include "hydra_err.h"

HYD_status HYDI_bstrap_sge_finalize(void)
{
HYD_status status = HYD_SUCCESS;

fn_exit:
return status;

fn_fail:
goto fn_exit;
}
94 changes: 94 additions & 0 deletions src/pm/hydra/libhydra/bstrap/sge/sge_launch.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
* (C) 2010 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include "hydra_bstrap_sge.h"
#include "hydra_str.h"
#include "hydra_err.h"
#include "hydra_fs.h"
#include "hydra_spawn.h"

static HYD_status sge_get_path(char **path);

HYD_status HYDI_bstrap_sge_launch(const char *hostname, const char *launch_exec, char **args,
int *fd_stdin, int *fd_stdout, int *fd_stderr, int *pid,
int debug)
{
char *targs[HYD_NUM_TMP_STRINGS] = { NULL };
int idx, i;
char *lexec = NULL;
HYD_status status = HYD_SUCCESS;

HYD_FUNC_ENTER();

/* We use the following priority order for the executable path:
* (1) user-specified; (2) search in path; (3) Hard-coded
* location */
if (launch_exec)
lexec = MPL_strdup(launch_exec);

if (lexec == NULL)
status = sge_get_path(&lexec);

HYD_ASSERT(lexec, status);

idx = 0;
targs[idx++] = MPL_strdup(lexec);

targs[idx++] = MPL_strdup(hostname);

/* Fill in the remaining arguments */
/* We do not need to create a quoted version of the string for
* SLURM. It seems to be internally quoting it anyway. */
for (i = 0; args[i]; i++)
targs[idx++] = MPL_strdup(args[i]);

if (debug) {
HYD_PRINT(stdout, "Launch arguments: ");
HYD_str_print_list(targs);
}


status = HYD_spawn(targs, 0, NULL, fd_stdin, fd_stdout, fd_stderr, pid, -1);
HYD_ERR_POP(status, "create process returned error\n");

fn_exit:
HYD_str_free_list(targs);
if (lexec)
MPL_free(lexec);
HYD_FUNC_EXIT();
return status;

fn_fail:
goto fn_exit;
}


HYD_status sge_get_path(char **path)
{
char *sge_root = NULL, *arc = NULL;
int length;
HYD_status status = HYD_SUCCESS;

if (*path == NULL) {
MPL_env2str("SGE_ROOT", (const char **) &sge_root);
MPL_env2str("ARC", (const char **) &arc);
if (sge_root && arc) {
length = strlen(sge_root) + strlen("/bin/") + strlen(arc) + 1 + strlen("qrsh") + 1;
HYD_MALLOC((*path), char *, length, status);
MPL_snprintf(*path, length, "%s/bin/%s/qrsh", sge_root, arc);
}
}
if (*path == NULL)
*path = HYD_find_full_path("qrsh");
if (*path == NULL)
*path = MPL_strdup("/usr/bin/qrsh");

fn_exit:
return status;

fn_fail:
goto fn_exit;
}

Loading