Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with separately running and compiling in the Makefile #400

Open
colleeneb opened this issue Sep 28, 2021 · 0 comments
Open

Issue with separately running and compiling in the Makefile #400

colleeneb opened this issue Sep 28, 2021 · 0 comments
Assignees

Comments

@colleeneb
Copy link
Collaborator

Describe the bug
It looks like running SOLLVE VV with split compile and run results in incorrect results with C tests. That is, when I run the "split version"

# compile
make ... compile
# run
make ... run

vs. the "compile and run together version"

make ... all

I see 0% pass for the split version for the C tests. It looks like there's an issue with the makefile, see the Expected behavior section.

Test that it applies to

C tests, looks like an issue with the Makefile.

To Reproduce
Steps to reproduce the behavior:

# compile
$ make -j 1 CC="nvc" CXX="nvc++" FC="nvfortran" NVCC="nvcc" CFLAGS="-mp=gpu -gpu=cc80" CXXFLAGS="-mp=gpu -gpu=cc80" FCFLAGS="-mp-gpu -gpu=cc80" OMP_VERSION=4.5 VERBOSE_TESTS=1 VERBOSE=1 LOG=1 LOG_ALL=1 compile
# run
$ make -j 1 CC="nvc" CXX="nvc++" FC="nvfortran" NVCC="nvcc" CFLAGS="-mp=gpu -gpu=cc80" CXXFLAGS="-mp=gpu -gpu=cc80" FCFLAGS="-mp-gpu -gpu=cc80" OMP_VERSION=4.5 VERBOSE_TESTS=1 VERBOSE=1 LOG=1 LOG_ALL=1 run
$ make report_summary
...
Condensed Summary by file type:
  .cpp pass rate: 14/14 (100%) [ 0 build failures ]
  **.c pass rate: 0/114 (0%) [ 3 build failures ]**
  .f90 pass rate: 67/87 (77%) [ 0 build failures ]

and then compare to

$ make -j 1 CC="nvc" CXX="nvc++" FC="nvfortran" NVCC="nvcc" CFLAGS="-mp=gpu -gpu=cc80" CXXFLAGS="-mp=gpu -gpu=cc80" FCFLAGS="-mp-gpu -gpu=cc80" OMP_VERSION=4.5 VERBOSE_TESTS=1 VERBOSE=1 LOG=1 LOG_ALL=1 all
$ make report_summary
...
Condensed Summary by file type:
  .cpp pass rate: 14/14 (100%) [ 0 build failures ]
  **.c pass rate: 106/114 (92%) [ 3 build failures ]**
  .f90 pass rate: 67/87 (77%) [ 0 build failures ]

Expected behavior
We expect running the compile and run commands separately should work. We can get it to work if we make this change, but I'm not sure enough of the code to know if it effects other things:

diff --git a/Makefile b/Makefile
index e8f50b0..c6b2308 100644
--- a/Makefile
+++ b/Makefile
@@ -353,19 +353,9 @@ $(CURDIR)/tests/4.5/application_kernels/qmcpack_target_static_lib.c.o: $(CURDIR)
 %.c.runonly:
        $(call log_section_header,"RUN",$(SYSTEM),$(@:.runonly=),$(LOG_NOTE),$(OMP_VERSION),$(notdir $(@:.runonly=.log)))
        @echo -e $(TXTGRN)"\n\n" running previously compiled: $@ $(TXTNOC) $(if $(LOG), ${RECORD}$(notdir $(@:.runonly=.log)))
-# If .../test_<envname>_env_<value>...
-       $(if $(findstring _env_,$@), \
-         $(call loadModules,$(C_COMPILER_MODULE)) \
-                $(BSRUN)$(RUN_TEST) --env \
-                  $(shell echo "$@" | sed -e 's@.*/@@' -e 's@test_\(.*\)_env_.*@\1@' | tr 'a-z' 'A-Z') \
-                  $(shell echo "$@" | sed -e 's@.*/@@' -e 's@.*_env_\([^.]*\).*@\1@') \
-                  $(@:.runonly=.o) $(VERBOSE) $(if $(LOG),$(RECORD)$(notdir $(@:.runonly=.log))\
+       $(call loadModules,$(C_COMPILER_MODULE)) $(BSRUN)$(RUN_TEST) $(@:.runonly=.o) $(VERBOSE) $(if $(LOG),$(RECORD)$(notdir $(@:.runonly=.log))\
                 && echo "PASS" > $(LOGTEMPFILE) \
-                || echo "FAIL" > $(LOGTEMPFILE)) \
-         $(call loadModules,$(C_COMPILER_MODULE)) $(BSRUN)$(RUN_TEST) $(@:.runonly=.o) $(VERBOSE) $(if $(LOG),$(RECORD)$(notdir $(@:.runonly=.log))\
-                && echo "PASS" > $(LOGTEMPFILE) \
-                || echo "FAIL" > $(LOGTEMPFILE)) \
-       )
+                || echo "FAIL" > $(LOGTEMPFILE))
        -$(call log_section_footer,"RUN",$(SYSTEM),$$(cat $(LOGTEMPFILE)),$(LOG_NOTE),$(notdir $(@:.runonly=.log)))
        -@$(if $(LOG), rm $(LOGTEMPFILE))

Compiler

Nvidia SDK 21.9

Accelerator hardware

Nvidia A100

h/t to Brian Homerding (https://github.com/homerdin)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants