-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix add-hostfile and add-host operations
When in a managed allocation, allow addition of nodes provided that either (a) all the nodes in the managed portion of the allocation have the same #slots in them so we can infer how many are in the new nodes, or (b) the user specifies the #slots for the new nodes. Check node names as well as aliases for match. Add a new ras component to simulate a managed allocation. Signed-off-by: Ralph Castain <rhc@pmix.org>
- Loading branch information
Showing
7 changed files
with
318 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# | ||
# Copyright (c) 2011-2020 Cisco Systems, Inc. All rights reserved | ||
# Copyright (c) 2017 IBM Corporation. All rights reserved. | ||
# Copyright (c) 2017-2020 Intel, Inc. All rights reserved. | ||
# Copyright (c) 2022-2023 Nanook Consulting. All rights reserved. | ||
# $COPYRIGHT$ | ||
# | ||
# Additional copyrights may follow | ||
# | ||
# $HEADER$ | ||
# | ||
|
||
sources = \ | ||
ras_testrm.h \ | ||
ras_testrm_component.c \ | ||
ras_testrm.c | ||
|
||
# Make the output library in this directory, and name it either | ||
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la | ||
# (for static builds). | ||
|
||
if MCA_BUILD_prte_ras_testrm_DSO | ||
lib = | ||
lib_sources = | ||
component = prte_mca_ras_testrm.la | ||
component_sources = $(sources) | ||
else | ||
lib = libprtemca_ras_testrm.la | ||
lib_sources = $(sources) | ||
component = | ||
component_sources = | ||
endif | ||
|
||
mcacomponentdir = $(prtelibdir) | ||
mcacomponent_LTLIBRARIES = $(component) | ||
prte_mca_ras_testrm_la_SOURCES = $(component_sources) | ||
prte_mca_ras_testrm_la_LDFLAGS = -module -avoid-version | ||
prte_mca_ras_testrm_la_LIBADD = $(top_builddir)/src/libprrte.la | ||
|
||
noinst_LTLIBRARIES = $(lib) | ||
libprtemca_ras_testrm_la_SOURCES = $(lib_sources) | ||
libprtemca_ras_testrm_la_LDFLAGS = -module -avoid-version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright (c) 2011-2020 Cisco Systems, Inc. All rights reserved | ||
* Copyright (c) 2012 Los Alamos National Security, LLC. All rights reserved | ||
* Copyright (c) 2015-2019 Research Organization for Information Science | ||
* and Technology (RIST). All rights reserved. | ||
* Copyright (c) 2015-2020 Intel, Inc. All rights reserved. | ||
* | ||
* Copyright (c) 2021-2023 Nanook Consulting. All rights reserved. | ||
* $COPYRIGHT$ | ||
* | ||
* Additional copyrights may follow | ||
* | ||
* $HEADER$ | ||
*/ | ||
#include "prte_config.h" | ||
#include "constants.h" | ||
#include "types.h" | ||
|
||
#include "src/class/pmix_list.h" | ||
#include "src/runtime/prte_globals.h" | ||
#include "src/util/hostfile/hostfile.h" | ||
#include "ras_testrm.h" | ||
|
||
/* | ||
* Local functions | ||
*/ | ||
static int allocate(prte_job_t *jdata, pmix_list_t *nodes); | ||
static int finalize(void); | ||
|
||
/* | ||
* Global variable | ||
*/ | ||
prte_ras_base_module_t prte_ras_testrm_module = { | ||
.init = NULL, | ||
.allocate = allocate, | ||
.deallocate = NULL, | ||
.finalize = finalize | ||
}; | ||
|
||
static int allocate(prte_job_t *jdata, pmix_list_t *nodes) | ||
{ | ||
int rc; | ||
|
||
rc = prte_util_add_hostfile_nodes(nodes, prte_mca_ras_testrm_component.hostfile); | ||
return rc; | ||
} | ||
|
||
/* | ||
* There's really nothing to do here | ||
*/ | ||
static int finalize(void) | ||
{ | ||
return PRTE_SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) 2011-2020 Cisco Systems, Inc. All rights reserved | ||
* Copyright (c) 2015-2019 Intel, Inc. All rights reserved. | ||
* Copyright (c) 2019 Research Organization for Information Science | ||
* and Technology (RIST). All rights reserved. | ||
* Copyright (c) 2021-2023 Nanook Consulting. All rights reserved. | ||
* $COPYRIGHT$ | ||
* | ||
* Additional copyrights may follow | ||
* | ||
* $HEADER$ | ||
*/ | ||
|
||
#ifndef PRTE_RAS_TESTRM_H | ||
#define PRTE_RAS_TESTRM_H | ||
|
||
#include "prte_config.h" | ||
#include "src/mca/ras/base/base.h" | ||
#include "src/mca/ras/ras.h" | ||
|
||
BEGIN_C_DECLS | ||
|
||
struct prte_ras_testrm_component_t { | ||
prte_ras_base_component_t super; | ||
char *hostfile; | ||
}; | ||
typedef struct prte_ras_testrm_component_t prte_ras_testrm_component_t; | ||
|
||
PRTE_EXPORT extern prte_ras_testrm_component_t prte_mca_ras_testrm_component; | ||
PRTE_EXPORT extern prte_ras_base_module_t prte_ras_testrm_module; | ||
|
||
END_C_DECLS | ||
|
||
#endif |
Oops, something went wrong.