From 44e500d9714dcf98474568bb2bd1c0e3b6a00c0b Mon Sep 17 00:00:00 2001 From: JordiManyer Date: Thu, 9 May 2024 11:19:40 +1000 Subject: [PATCH] Fixed tests for artifacts --- .gitignore | 3 ++- test/.gitignore | 3 +++ test/example_1.jl | 2 +- test/example_2.jl | 2 +- test/example_3.jl | 2 +- test/example_lnodes_2d+1d.jl | 2 +- test/example_lnodes_2d.jl | 2 +- test/example_lnodes_3d.jl | 2 +- test/runtests.jl | 4 ++-- test/test_p4est_bindings.jl | 2 +- test/test_p8est_bindings.jl | 2 +- test/test_sc_bindings.jl | 2 +- 12 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 test/.gitignore diff --git a/.gitignore b/.gitignore index 54794fb..3308b8d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,10 +3,11 @@ *.jl.mem .DS_Store /Manifest.toml +/LocalPreferences.toml /deps/build.log /deps/deps.jl /dev/ /docs/build/ /docs/site/ /gen/Manifest.toml - +/gen/LocalPreferences.toml diff --git a/test/.gitignore b/test/.gitignore new file mode 100644 index 0000000..301e4a1 --- /dev/null +++ b/test/.gitignore @@ -0,0 +1,3 @@ +*.vtu +*.pvtu +*.visit \ No newline at end of file diff --git a/test/example_1.jl b/test/example_1.jl index bd5d326..2807337 100644 --- a/test/example_1.jl +++ b/test/example_1.jl @@ -38,7 +38,7 @@ const search_point_fn_c = @cfunction(search_point_fn, Cint, (Ptr{p4est_t}, p4est # Main program ############################################################################# -mpicomm = P4est_wrapper.P4EST_ENABLE_MPI ? MPI.COMM_WORLD : Cint(0) +mpicomm = MPI.COMM_WORLD # Create a connectivity structure for the unit square. unitsquare_connectivity = p4est_connectivity_new_unitsquare() diff --git a/test/example_2.jl b/test/example_2.jl index d31cc88..b6cb3d5 100644 --- a/test/example_2.jl +++ b/test/example_2.jl @@ -26,7 +26,7 @@ const my_refine_c = @cfunction(my_refine, Cint, (Ptr{p4est_t}, p4est_topidx_t, P # Main program ############################################################################# -mpicomm = P4est_wrapper.P4EST_ENABLE_MPI ? MPI.COMM_WORLD : Cint(0) +mpicomm = MPI.COMM_WORLD # Create a connectivity structure for the unit square. unitsquare_connectivity = p4est_connectivity_new_unitsquare() diff --git a/test/example_3.jl b/test/example_3.jl index 2a9b9cd..d561a2c 100644 --- a/test/example_3.jl +++ b/test/example_3.jl @@ -119,7 +119,7 @@ end # Main program ############################################################################# -mpicomm = P4est_wrapper.P4EST_ENABLE_MPI ? MPI.COMM_WORLD : Cint(0) +mpicomm = MPI.COMM_WORLD sc_init(mpicomm, Cint(true), Cint(true), C_NULL, P4est_wrapper.SC_LP_DEFAULT) p4est_init(C_NULL, P4est_wrapper.SC_LP_DEFAULT) diff --git a/test/example_lnodes_2d+1d.jl b/test/example_lnodes_2d+1d.jl index 2331b70..1a1b532 100644 --- a/test/example_lnodes_2d+1d.jl +++ b/test/example_lnodes_2d+1d.jl @@ -355,7 +355,7 @@ end # # Main program # ############################################################################# -mpicomm = P4est_wrapper.P4EST_ENABLE_MPI ? MPI.COMM_WORLD : Cint(0) +mpicomm = MPI.COMM_WORLD sc_init(mpicomm, Cint(true), Cint(true), C_NULL, P4est_wrapper.SC_LP_VERBOSE) p4est_init(C_NULL, P4est_wrapper.SC_LP_VERBOSE) diff --git a/test/example_lnodes_2d.jl b/test/example_lnodes_2d.jl index 151de3e..52854f4 100644 --- a/test/example_lnodes_2d.jl +++ b/test/example_lnodes_2d.jl @@ -73,7 +73,7 @@ end # Main program ############################################################################# -mpicomm = P4est_wrapper.P4EST_ENABLE_MPI ? MPI.COMM_WORLD : Cint(0) +mpicomm = MPI.COMM_WORLD sc_init(mpicomm, Cint(true), Cint(true), C_NULL, P4est_wrapper.SC_LP_DEFAULT) p4est_init(C_NULL, P4est_wrapper.SC_LP_DEFAULT) diff --git a/test/example_lnodes_3d.jl b/test/example_lnodes_3d.jl index 72d6085..d9b947a 100644 --- a/test/example_lnodes_3d.jl +++ b/test/example_lnodes_3d.jl @@ -332,7 +332,7 @@ end # Main program ############################################################################# -mpicomm = P4est_wrapper.P4EST_ENABLE_MPI ? MPI.COMM_WORLD : Cint(0) +mpicomm = MPI.COMM_WORLD sc_init(mpicomm, Cint(true), Cint(true), C_NULL, P4est_wrapper.SC_LP_DEFAULT) p4est_init(C_NULL, P4est_wrapper.SC_LP_DEFAULT) diff --git a/test/runtests.jl b/test/runtests.jl index 3e4622c..aa2aa7d 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -6,7 +6,7 @@ using Test # Skip tests if library was not properly loaded if P4est_wrapper.P4EST_FOUND repodir = normpath(joinpath(@__DIR__,"..")) - nprocs = min(Sys.CPU_THREADS, 2) + nprocs = P4est_wrapper.P4EST_ENABLE_MPI ? min(Sys.CPU_THREADS, 2) : 1 dir = dirname(@__FILE__) julia = Base.julia_cmd() mpiexec = MPI.mpiexec() @@ -16,7 +16,7 @@ if P4est_wrapper.P4EST_FOUND extra_args = `` end @testset "Test SC bindings" begin - cmd = `$mpiexec -n $nprocs $(extra_args) $(julia) --project=$repodir $(joinpath(dir, "test_sc_bindings.jl"))` + cmd = `$mpiexec -n $nprocs $(extra_args) $(julia) --project=$repodir $(joinpath(dir, "test_sc_bindings.jl"))` @show cmd run(cmd) end diff --git a/test/test_p4est_bindings.jl b/test/test_p4est_bindings.jl index 379804a..30963c1 100644 --- a/test/test_p4est_bindings.jl +++ b/test/test_p4est_bindings.jl @@ -11,7 +11,7 @@ end # Definition of data structures and function callbacks ############################################################################# -mpicomm = P4est_wrapper.P4EST_ENABLE_MPI ? MPI.COMM_WORLD : Cint(0) +mpicomm = MPI.COMM_WORLD # Dummy callback dummy_callback( ::Ptr{p4est_t}, which_tree::p4est_topidx_t, quadrant::Ptr{p4est_quadrant_t}) = Cint(0) diff --git a/test/test_p8est_bindings.jl b/test/test_p8est_bindings.jl index 749aca8..31aae6e 100644 --- a/test/test_p8est_bindings.jl +++ b/test/test_p8est_bindings.jl @@ -10,7 +10,7 @@ end ############################################################################# # Definition of data structures and function callbacks ############################################################################# -mpicomm = P4est_wrapper.P4EST_ENABLE_MPI ? MPI.COMM_WORLD : Cint(0) +mpicomm = MPI.COMM_WORLD # Dummy callback dummy_callback( ::Ptr{p8est_t}, which_tree::p4est_topidx_t, quadrant::Ptr{p8est_quadrant_t}) = Cint(0) diff --git a/test/test_sc_bindings.jl b/test/test_sc_bindings.jl index 8c287a3..c16a957 100644 --- a/test/test_sc_bindings.jl +++ b/test/test_sc_bindings.jl @@ -10,7 +10,7 @@ if !MPI.Initialized() MPI.Init() end -mpicomm = P4est_wrapper.P4EST_ENABLE_MPI ? MPI.COMM_WORLD : Cint(0) +mpicomm = MPI.COMM_WORLD # SC library initialization sc_init(mpicomm, Cint(true), Cint(true), C_NULL, P4est_wrapper.SC_LP_DEFAULT)