From c2e214b1e0fd4737c7fc5c9d58d81b9f36748654 Mon Sep 17 00:00:00 2001 From: Evan Ramos Date: Thu, 25 Apr 2019 15:19:42 -0500 Subject: [PATCH] Avoid building user-driven-interop example on non-LRTS layers Change-Id: I6112c85fd92ece9a7e556f23029c4ff381961e1c --- examples/charm++/user-driven-interop/Makefile | 10 +++++++++- src/arch/gni/conv-common.sh | 1 + src/arch/mpi/conv-common.sh | 1 + src/arch/netlrts/conv-common.sh | 1 + src/arch/ofi/conv-common.sh | 1 + src/arch/pamilrts/conv-common.sh | 1 + src/arch/verbs/conv-common.sh | 1 + src/ck-core/mpi-interoperate.C | 6 ++++-- src/scripts/configure.ac | 1 + 9 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 src/arch/netlrts/conv-common.sh create mode 100644 src/arch/verbs/conv-common.sh diff --git a/examples/charm++/user-driven-interop/Makefile b/examples/charm++/user-driven-interop/Makefile index 494193d00b..09d167539d 100644 --- a/examples/charm++/user-driven-interop/Makefile +++ b/examples/charm++/user-driven-interop/Makefile @@ -2,7 +2,13 @@ -include ../../../include/conv-mach-opt.mak CHARMC=../../../bin/charmc $(OPTS) -all: hello_user hello_user_with_main +ifeq ($(CMK_USE_LRTS), 1) + TARGETS := hello_user hello_user_with_main +else + TARGETS := +endif + +all: $(TARGETS) hello_user.decl.h: hello_user.ci $(CHARMC) $< @@ -26,6 +32,7 @@ clean: rm -f hello_user hello_user_with_main *.o charmrun *.decl.h *.def.h test: all +ifeq ($(CMK_USE_LRTS), 1) $(call run, +p2 ./hello_user 8 ) $(call run, +p2 ./hello_user_with_main 8 ) ifeq ($(CMK_SMP), 1) @@ -34,3 +41,4 @@ ifneq ($(CMK_MULTICORE), 1) $(call run, +p4 ./hello_user_with_main 8 ++ppn 2 ) endif endif +endif diff --git a/src/arch/gni/conv-common.sh b/src/arch/gni/conv-common.sh index 5dd13cd683..455743d34b 100644 --- a/src/arch/gni/conv-common.sh +++ b/src/arch/gni/conv-common.sh @@ -1,3 +1,4 @@ CMK_BUILD_CRAY=1 +CMK_USE_LRTS=1 diff --git a/src/arch/mpi/conv-common.sh b/src/arch/mpi/conv-common.sh index 687140df42..d09496bd7d 100644 --- a/src/arch/mpi/conv-common.sh +++ b/src/arch/mpi/conv-common.sh @@ -1,2 +1,3 @@ CMK_BUILD_MPI=1 +CMK_USE_LRTS=1 diff --git a/src/arch/netlrts/conv-common.sh b/src/arch/netlrts/conv-common.sh new file mode 100644 index 0000000000..04584c9d60 --- /dev/null +++ b/src/arch/netlrts/conv-common.sh @@ -0,0 +1 @@ +CMK_USE_LRTS=1 diff --git a/src/arch/ofi/conv-common.sh b/src/arch/ofi/conv-common.sh index 35e45622c7..07326cf965 100644 --- a/src/arch/ofi/conv-common.sh +++ b/src/arch/ofi/conv-common.sh @@ -1,2 +1,3 @@ CMK_BUILD_OFI=1 +CMK_USE_LRTS=1 diff --git a/src/arch/pamilrts/conv-common.sh b/src/arch/pamilrts/conv-common.sh index e69de29bb2..04584c9d60 100644 --- a/src/arch/pamilrts/conv-common.sh +++ b/src/arch/pamilrts/conv-common.sh @@ -0,0 +1 @@ +CMK_USE_LRTS=1 diff --git a/src/arch/verbs/conv-common.sh b/src/arch/verbs/conv-common.sh new file mode 100644 index 0000000000..04584c9d60 --- /dev/null +++ b/src/arch/verbs/conv-common.sh @@ -0,0 +1 @@ +CMK_USE_LRTS=1 diff --git a/src/ck-core/mpi-interoperate.C b/src/ck-core/mpi-interoperate.C index 16412d5496..25cfbac703 100644 --- a/src/ck-core/mpi-interoperate.C +++ b/src/ck-core/mpi-interoperate.C @@ -109,12 +109,15 @@ void _libExitHandler(envelope *env) } } -#if CMK_USE_LRTS // CharmBeginInit calls sets interop flags then calls ConverseInit. This // initializes the runtime, but does not start the scheduler or send readonlies. // It returns control the main after main chares have been created. extern "C" void CharmBeginInit(int argc, char** argv) { +#if !defined CMK_USE_LRTS || !CMK_USE_LRTS + CmiAbort("Interop is not supported in non-LRTS machine layers."); +#endif + userDrivenMode = 1; CharmLibInterOperate = true; ConverseInit(argc, argv, (CmiStartFn)_initCharm, 1, 0); @@ -142,7 +145,6 @@ void CharmInit(int argc, char** argv) { CharmBeginInit(argc, argv); CharmFinishInit(); } -#endif // CharmLibInit is specifically for MPI interop, where MPI applications want // to call Charm as a library. It does full initialization and starts the diff --git a/src/scripts/configure.ac b/src/scripts/configure.ac index ed912e445e..d0099c38fe 100644 --- a/src/scripts/configure.ac +++ b/src/scripts/configure.ac @@ -115,6 +115,7 @@ add_make_flag "CMK_SHARED_SUF:=$CMK_SHARED_SUF" 'basic setup' add_make_flag "CMK_NO_PARTITIONS:=$CMK_NO_PARTITIONS" 'basic setup' add_make_flag "CMK_BLUEGENEQ:=$CMK_BLUEGENEQ" 'basic setup' add_make_flag "CMK_MULTICORE:=$CMK_MULTICORE" 'basic setup' +add_make_flag "CMK_USE_LRTS:=$CMK_USE_LRTS" 'basic setup' add_make_flag "BUILD_CUDA:=$BUILD_CUDA" 'basic setup' # enable/disable error checking -- 2.11.4.GIT