From 04b1bfeb90f7e428d66ed6c2857b5efac3ff4c43 Mon Sep 17 00:00:00 2001 From: Ralph Castain Date: Sun, 25 Jun 2023 10:48:07 -0600 Subject: [PATCH 1/4] Add psched daemon Add a daemon that can act as a scheduler in support of development of PMIx scheduler integration. Signed-off-by: Ralph Castain --- .gitignore | 1 + config/prte_config_files.m4 | 1 + src/mca/ess/base/ess_base_std_prolog.c | 7 +- src/mca/schizo/psched/Makefile.am | 44 ++ src/mca/schizo/psched/configure.m4 | 37 ++ src/mca/schizo/psched/help-schizo-psched.txt | 99 ++++ src/mca/schizo/psched/owner.txt | 7 + src/mca/schizo/psched/schizo_psched.c | 309 ++++++++++ src/mca/schizo/psched/schizo_psched.h | 37 ++ .../schizo/psched/schizo_psched_component.c | 66 +++ src/tools/Makefile.am | 6 +- src/tools/psched/Makefile.am | 54 ++ src/tools/psched/psched.c | 555 ++++++++++++++++++ 13 files changed, 1218 insertions(+), 5 deletions(-) create mode 100644 src/mca/schizo/psched/Makefile.am create mode 100644 src/mca/schizo/psched/configure.m4 create mode 100644 src/mca/schizo/psched/help-schizo-psched.txt create mode 100644 src/mca/schizo/psched/owner.txt create mode 100644 src/mca/schizo/psched/schizo_psched.c create mode 100644 src/mca/schizo/psched/schizo_psched.h create mode 100644 src/mca/schizo/psched/schizo_psched_component.c create mode 100644 src/tools/psched/Makefile.am create mode 100644 src/tools/psched/psched.c diff --git a/.gitignore b/.gitignore index 9ae0b574d5..d216856cf7 100644 --- a/.gitignore +++ b/.gitignore @@ -162,6 +162,7 @@ src/tools/prte/prte src/tools/pcc/pcc src/tools/pcc/pcc-wrapper-data.txt src/tools/pterm/pterm +src/tools/psched/psched src/util/hostfile/hostfile_lex.c src/util/keyval/keyval_lex.c diff --git a/config/prte_config_files.m4 b/config/prte_config_files.m4 index 750484975e..ef3f2eb2e1 100644 --- a/config/prte_config_files.m4 +++ b/config/prte_config_files.m4 @@ -26,5 +26,6 @@ AC_DEFUN([PRTE_CONFIG_FILES],[ src/tools/prte_info/Makefile src/tools/prte/Makefile src/tools/pterm/Makefile + src/tools/psched/Makefile ]) ]) diff --git a/src/mca/ess/base/ess_base_std_prolog.c b/src/mca/ess/base/ess_base_std_prolog.c index c63d78df2f..c475fd9e58 100644 --- a/src/mca/ess/base/ess_base_std_prolog.c +++ b/src/mca/ess/base/ess_base_std_prolog.c @@ -11,7 +11,7 @@ * All rights reserved. * Copyright (c) 2019 Intel, Inc. All rights reserved. * Copyright (c) 2020 Cisco Systems, Inc. All rights reserved - * Copyright (c) 2021-2022 Nanook Consulting. All rights reserved. + * Copyright (c) 2021-2023 Nanook Consulting. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -60,8 +60,9 @@ int prte_ess_base_std_prolog(void) return PRTE_SUCCESS; error: - pmix_show_help("help-prte-runtime", "prte_init:startup:internal-failure", true, error, - PRTE_ERROR_NAME(ret), ret); + pmix_show_help("help-prte-runtime", + "prte_init:startup:internal-failure", true, + error, PRTE_ERROR_NAME(ret), ret); return ret; } diff --git a/src/mca/schizo/psched/Makefile.am b/src/mca/schizo/psched/Makefile.am new file mode 100644 index 0000000000..9ee72ed754 --- /dev/null +++ b/src/mca/schizo/psched/Makefile.am @@ -0,0 +1,44 @@ +# +# Copyright (c) 2015-2020 Intel, Inc. All rights reserved. +# Copyright (c) 2017 IBM Corporation. All rights reserved. +# Copyright (c) 2020 Cisco Systems, Inc. All rights reserved +# Copyright (c) 2022-2023 Nanook Consulting. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +AM_CFLAGS = \ + -DPRTE_GREEK_VERSION="\"@PRTE_GREEK_VERSION@\"" + +dist_prtedata_DATA = \ + help-schizo-psched.txt + +sources = \ + schizo_psched_component.c \ + schizo_psched.h \ + schizo_psched.c + +# Make the output library in this directory, and name it either +# mca__.la (for DSO builds) or libmca__.la +# (for static builds). + +if MCA_BUILD_prte_schizo_psched_DSO +component_noinst = +component_install = prte_mca_schizo_psched.la +else +component_noinst = libprtemca_schizo_psched.la +component_install = +endif + +mcacomponentdir = $(prtelibdir) +mcacomponent_LTLIBRARIES = $(component_install) +prte_mca_schizo_psched_la_SOURCES = $(sources) +prte_mca_schizo_psched_la_LDFLAGS = -module -avoid-version +prte_mca_schizo_psched_la_LIBADD = $(top_builddir)/src/libprrte.la + +noinst_LTLIBRARIES = $(component_noinst) +libprtemca_schizo_psched_la_SOURCES = $(sources) +libprtemca_schizo_psched_la_LDFLAGS = -module -avoid-version diff --git a/src/mca/schizo/psched/configure.m4 b/src/mca/schizo/psched/configure.m4 new file mode 100644 index 0000000000..9efa13e9df --- /dev/null +++ b/src/mca/schizo/psched/configure.m4 @@ -0,0 +1,37 @@ +# -*- shell-script -*- +# +# 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) 2009-2020 Cisco Systems, Inc. All rights reserved +# Copyright (c) 2011-2013 Los Alamos National Security, LLC. +# All rights reserved. +# Copyright (c) 2019 Intel, Inc. All rights reserved. +# Copyright (c) 2022-2023 Nanook Consulting. All rights reserved. +# Copyright (c) 2022 Amazon.com, Inc. or its affiliates. +# All Rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# + +# MCA_schizo_psched_CONFIG([action-if-found], [action-if-not-found]) +# ----------------------------------------------------------- +AC_DEFUN([MCA_prte_schizo_psched_CONFIG],[ + AC_CONFIG_FILES([src/mca/schizo/psched/Makefile]) + + AS_IF([test "yes" = "yes"], + [$1], [$2]) + + PRTE_SUMMARY_ADD([Personalities], [PRTE Scheduler], [], [yes]) + +])dnl diff --git a/src/mca/schizo/psched/help-schizo-psched.txt b/src/mca/schizo/psched/help-schizo-psched.txt new file mode 100644 index 0000000000..6bf2bc031a --- /dev/null +++ b/src/mca/schizo/psched/help-schizo-psched.txt @@ -0,0 +1,99 @@ +# -*- text -*- +# +# Copyright (c) 2021-2023 Nanook Consulting All rights reserved. +# Copyright (c) 2022 IBM Corporation. All rights reserved. +# $COPYRIGHT$ +# +# Additional copyrights may follow +# +# $HEADER$ +# +# +[usage] +%s (%s) %s + +Usage: %s [OPTION]... + +The following list of command line options are available. Note that +more detailed help for any option can be obtained by adding that +option to the help request as "--help