Skip to content

Commit 8909c26

Browse files
committed
Move prte function into library
Take the "main" function in the "prte" tool and move it into libprte so that it can be called by external tools. Cover it with a splash shield so that debuggers see the splash when starting "prte" or "prterun". Signed-off-by: Ralph Castain <[email protected]>
1 parent a63791f commit 8909c26

File tree

5 files changed

+59
-8
lines changed

5 files changed

+59
-8
lines changed

include/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Copyright (c) 2015-2020 Intel, Inc. All rights reserved.
33
#
4-
# Copyright (c) 2021 Nanook Consulting All rights reserved.
4+
# Copyright (c) 2021-2025 Nanook Consulting All rights reserved.
55
# $COPYRIGHT$
66
#
77
# Additional copyrights may follow

src/prted/Makefile.am

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# Copyright (c) 2014-2020 Cisco Systems, Inc. All rights reserved
1414
# Copyright (c) 2015-2020 Intel, Inc. All rights reserved.
1515
# Copyright (c) 2018 IBM Corporation. All rights reserved.
16-
# Copyright (c) 2021-2022 Nanook Consulting. All rights reserved.
16+
# Copyright (c) 2021-2025 Nanook Consulting All rights reserved.
1717
# Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
1818
# $COPYRIGHT$
1919
#
@@ -26,10 +26,11 @@
2626

2727
headers += \
2828
prted/prted.h
29-
29+
3030
libprrte_la_SOURCES += \
3131
prted/prted_comm.c \
3232
prted/prte_app_parse.c \
33-
prted/prun_common.c
33+
prted/prun_common.c \
34+
prted/prte.c
3435

3536
include prted/pmix/Makefile.am

src/tools/prte/prte.c renamed to src/prted/prte.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@
104104
#include "src/runtime/prte_wait.h"
105105
#include "src/runtime/runtime.h"
106106

107-
#include "include/prte.h"
108107
#include "src/prted/pmix/pmix_server.h"
109108
#include "src/prted/pmix/pmix_server_internal.h"
110109
#include "src/prted/prted.h"
110+
#include "include/prte.h"
111111

112112
typedef struct {
113113
prte_pmix_lock_t lock;
@@ -256,7 +256,7 @@ static char *pmix_getline(FILE *fp)
256256
}
257257
#endif
258258

259-
int main(int argc, char *argv[])
259+
int prte(int argc, char *argv[])
260260
{
261261
int rc = 1, i;
262262
char *param, *tpath, *cptr;

src/tools/prte/Makefile.am

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ AM_CFLAGS = \
3939

4040
bin_PROGRAMS = prte
4141

42-
prte_SOURCES = \
43-
prte.c
42+
prte_SOURCES = \
43+
main.c
4444

4545
prte_LDADD = \
4646
$(prte_libevent_LIBS) \
@@ -53,3 +53,4 @@ install-exec-hook:
5353

5454
uninstall-local:
5555
rm -f $(DESTDIR)$(bindir)/prterun$(EXEEXT)
56+
rm -f $(DESTDIR)$(bindir)/prte$(EXEEXT)

src/tools/prte/main.c

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/***************************************************************************
2+
* *
3+
* PRTE: PMIx Reference RunTime Environment (PRTE) *
4+
* *
5+
* https://github.com/openpmix/prte *
6+
* *
7+
***************************************************************************/
8+
9+
#include "include/prte.h"
10+
11+
int main(int argc, char *argv[])
12+
{
13+
return prte(argc, argv);
14+
}
15+
16+
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
17+
/*
18+
* Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
19+
* University Research and Technology
20+
* Corporation. All rights reserved.
21+
* Copyright (c) 2004-2021 The University of Tennessee and The University
22+
* of Tennessee Research Foundation. All rights
23+
* reserved.
24+
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
25+
* University of Stuttgart. All rights reserved.
26+
* Copyright (c) 2004-2005 The Regents of the University of California.
27+
* All rights reserved.
28+
* Copyright (c) 2006-2020 Cisco Systems, Inc. All rights reserved
29+
* Copyright (c) 2007-2009 Sun Microsystems, Inc. All rights reserved.
30+
* Copyright (c) 2007-2017 Los Alamos National Security, LLC. All rights
31+
* reserved.
32+
* Copyright (c) 2013-2020 Intel, Inc. All rights reserved.
33+
* Copyright (c) 2015-2019 Research Organization for Information Science
34+
* and Technology (RIST). All rights reserved.
35+
* Copyright (c) 2020 Geoffroy Vallee. All rights reserved.
36+
* Copyright (c) 2020 IBM Corporation. All rights reserved.
37+
* Copyright (c) 2021-2025 Nanook Consulting All rights reserved.
38+
* Copyright (c) 2021 Amazon.com, Inc. or its affiliates. All Rights
39+
* reserved.
40+
* Copyright (c) 2022-2023 Triad National Security, LLC. All rights
41+
* reserved.
42+
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
43+
* $COPYRIGHT$
44+
*
45+
* Additional copyrights may follow
46+
*
47+
* $HEADER$
48+
*/
49+

0 commit comments

Comments
 (0)