From a33e3c4f14ede08585910bd18f0c528e42004d11 Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Fri, 6 Sep 2024 21:52:09 -0700 Subject: [PATCH] refac(macros): def macros by feature, not compiler --- src/julienne/julienne_test_result_s.F90 | 6 +++++- src/julienne/julienne_test_s.F90 | 14 +++++++++----- .../julienne_user_defined_collectives_s.F90 | 5 ++++- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/julienne/julienne_test_result_s.F90 b/src/julienne/julienne_test_result_s.F90 index 248b284..c97cae8 100644 --- a/src/julienne/julienne_test_result_s.F90 +++ b/src/julienne/julienne_test_result_s.F90 @@ -4,6 +4,10 @@ use julienne_user_defined_collectives_m, only : co_all implicit none +#ifdef __flang__ + #define NO_MULTI_IMAGE_SUPPORT +#endif + contains module procedure construct_from_character @@ -22,7 +26,7 @@ module procedure passed test_passed = self%passed_ -#ifndef __flang__ +#ifndef NO_MULTI_IMAGE_SUPPORT call co_all(test_passed) #endif end procedure diff --git a/src/julienne/julienne_test_s.F90 b/src/julienne/julienne_test_s.F90 index d72512e..f0f28f7 100644 --- a/src/julienne/julienne_test_s.F90 +++ b/src/julienne/julienne_test_s.F90 @@ -5,14 +5,18 @@ use julienne_command_line_m, only : command_line_t implicit none +#if defined(__flang__) + #define NO_MULTI_IMAGE_SUPPORT +#endif + contains module procedure report -#ifndef __flang__ - associate(me => this_image()) -#else +#ifdef NO_MULTI_IMAGE_SUPPORT integer me me = 1 +#else + associate(me => this_image()) #endif @@ -36,7 +40,7 @@ end if -#ifndef __flang__ +#ifndef NO_MULTI_IMAGE_SUPPORT call co_broadcast(test_description_substring, source_image=1) #endif @@ -55,7 +59,7 @@ block logical, allocatable :: passing_tests(:) passing_tests = test_results%passed() -#ifndef __flang__ +#ifndef NO_MULTI_IMAGE_SUPPORT call co_all(passing_tests) #endif associate(num_passes => count(passing_tests)) diff --git a/src/julienne/julienne_user_defined_collectives_s.F90 b/src/julienne/julienne_user_defined_collectives_s.F90 index 12c12da..d63fd64 100644 --- a/src/julienne/julienne_user_defined_collectives_s.F90 +++ b/src/julienne/julienne_user_defined_collectives_s.F90 @@ -4,13 +4,16 @@ ! "Multi-Dimensional Physics Implementation into Fuel Analysis under Steady-state and Transients (FAST)", ! contract # NRC-HQ-60-17-C-0007 ! +#ifdef __flang__ + #define NO_MULTI_IMAGE_SUPPORT +#endif submodule(julienne_user_defined_collectives_m) julienne_user_defined_collectives_s implicit none contains module procedure co_all -#ifndef __flang__ +#ifndef NO_MULTI_IMAGE_SUPPORT call co_reduce(boolean, both) #endif contains