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

Unit test with Julienne #133

Draft
wants to merge 46 commits into
base: main
Choose a base branch
from
Draft

Unit test with Julienne #133

wants to merge 46 commits into from

Conversation

rouson
Copy link
Collaborator

@rouson rouson commented Sep 8, 2024

Because the Veggies unit testing framework exposes what appears to be an internal compiler error in LLVM Flang (flang-new), this PR refactors the Caffeine test suite to replace Veggies with Julienne, which provides similar functionality and supports Flang. This commit also removes the unused iso_varying_string dependency and renames all test/caf_* files to test/prif_*.

To Do

  • Update fpm.toml.template: replace veggies with julienne and remove the unused iso_varying_string dependency
  • Replace main test program
  • Refactor/rename prif_init test module
  • Refactor/rename prif_allocate test module
  • Refactor/rename prif_co_broadcast test module
  • Refactor/rename prif_co_max test module
  • Refactor/rename prif_co_min test module
  • Refactor/rename prif_co_reduce test module
  • Refactor/rename prif_co_sum test module
  • Refactor/rename prif_error_stop test module
  • Refactor/rename prif_image_index test module
  • Refactor/rename prif_num_images test module
  • Refactor/rename prif_rma test module
  • Refactor/rename prif_stop test module
  • Refactor/rename prif_teams test module
  • Refactor/rename prif_this_image test module

rouson and others added 10 commits September 6, 2024 13:52
This fixes a previously non-conformant way of
setting a character pointer length (a standard
constraint prohibits passing an actual argument
with a deferred length to c_f_pointer).
fix(co_reduce): rm unused variable

Co-authored-by: Dan Bonachea <dobonachea@lbl.gov>
In order to support testing with the LLVM compilers,
this commit begins the process of switching to the
Julienne unit testing framework. This commit also
removes the unsed iso_varying_string dependency and
renames all test/caf_* files to test/prif_*.

Status
------
6 of 6 tests refactored to use Julienne pass with
the LLVM compilers.

Done
----
-[X] Updated dependencies in fpm.toml.template
-[X] Replaced main test program
-[X] Refactored/renamed prif_init test using julienne
-[X] Refactored/renamed prif_allocate test using julienne

To Do
-----
-[ ] Refactor/rename caf_co_broadcast_test.f90
-[ ] Refactor/rename caf_co_max_test.f90
-[ ] Refactor/rename caf_co_min_test.f90
-[ ] Refactor/rename caf_co_reduce_test.f90
-[ ] Refactor/rename caf_co_sum_test.f90
-[ ] Refactor/rename caf_error_stop_test.f90
-[ ] Refactor/rename caf_image_index_test.f90
-[ ] Refactor/rename caf_num_images_test.f90
-[ ] Refactor/rename caf_rma_test.f90
-[ ] Refactor/rename caf_stop_test.f90
-[ ] Refactor/rename caf_teams_test.f90
-[ ] Refactor/rename caf_this_image_test.f90
This commit matches the test descriptions in the block
of code that exists to support building with gfortran.
Copy link
Member

@bonachea bonachea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize this is still Draft, but I provided a few suggestions on preprocessor style.

test/prif_init_test_m.F90 Outdated Show resolved Hide resolved
src/prif.f90 Outdated Show resolved Hide resolved
src/prif.f90 Outdated Show resolved Hide resolved
rouson and others added 17 commits September 8, 2024 12:04
build(preprocess): use HAVE_SELECTED_LOGICAL_KIND

Co-authored-by: Dan Bonachea <dobonachea@lbl.gov>
Co-authored-by: Dan Bonachea <dobonachea@lbl.gov>
Based on compiler pre-defined macros, this commit defines
the following macros in include/language-support.F90:

- HAVE_SELECTED_LOGICAL_KIND
- HAVE_PROCEDURE_ACTUAL_FOR_POINTER_DUMMY
- HAVE_PROCEDURE_ACTUAL_FOR_POINTER_DUMMY

and adds the line

 #include "language-support.F90"

to src/prif.f90 and each file in the test/ subdirectory.
This replaces the recently committed feature macros.
This commit removes the HAVE_MULTI_IMAGE_SUPPORT macro because
we'll call PRIF/Caffeine procedures for all multi-image support
inside Caffeine.
test/main.F90 Outdated Show resolved Hide resolved
test/main.F90 Outdated
Comment on lines 76 to 99
#ifdef __flang__
print *
print *,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
print *
print *,"LLVM Flang detected. Skipping tests that crash:"
print *," - prif_co_max_test"
print *," - prif_co_min_test"
print *," - prif_co_reduce_test"
print *," - prif_co_sum_test"
print *," - prif_error_stop_test"
print *," - prif_image_index_test"
print *," - prif_stop_test"
print *
print *,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
#else
call prif_co_max_test%report(passes, tests)
call prif_co_min_test%report(passes, tests)
call prif_co_reduce_test%report(passes, tests)
call prif_co_sum_test%report(passes, tests)
call prif_error_stop_test%report(passes, tests)
call prif_image_index_test%report(passes, tests)
call prif_rma_test%report(passes, tests)
call prif_stop_test%report(passes, tests)
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This evokes a somewhat philosophical question about how to proceed in the face of known failures.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@everythingfunctional that's a solid point. At this point, I'd like to understand and address the issues even if the only outcome is that Caffeine and/or Julienne improve whether or not we decide for Caffeine to use Julienne. So far, these issues have helped to identify problems in both packages that I'm working on addressing. Most of the above failures relate the handling of character stop codes in error termination (see issue #77). I'm making good progress with addressing the above failures and hope to have most or all fixed by the time of tomorrow's call.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like it doesn't belong in the main library. I'd suggest instead making another fpm project in this repo, i.e. fpm new --lib caffeine-test-helpers, putting this in there, and then specifying that just the tests and those examples depend on it. I.e.

[dev-dependencies]
caffeine-test-helpers = { path = "./caffeine-test-helpers" }

@rouson rouson changed the title Unit test with Julienne to support building with the LLVM compilers Unit test with Julienne Sep 17, 2024
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

Successfully merging this pull request may close these issues.

3 participants