Skip to content

Commit

Permalink
Update the CI script check_symbols.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed Jan 2, 2025
1 parent 45b7332 commit 261a923
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 10 deletions.
37 changes: 29 additions & 8 deletions .github/julia/check_symbols.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Test

global n = 0

function exported_symbols(path::String)
symbols = String[]
str = read(path, String)
Expand Down Expand Up @@ -35,23 +37,42 @@ symbols_combinations = [(symbols_single_int32, symbols_double_int32, 32, 32, "li
(symbols_quadruple_int64, symbols_double_int32, 64, 32, "libgalahad_quadruple_64.so and libgalahad_double.so"),
(symbols_quadruple_int64, symbols_double_int64, 64, 64, "libgalahad_quadruple_64.so and libgalahad_double_64.so")]

single_double_modules = ["hash_MOD", "string_MOD", "clock_MOD", "copyright_MOD", "symbols_MOD", "tools_MOD",
"common_ciface_MOD", "hash_ciface_MOD", "hsl_kb22_long_integer_MOD", "hsl_mc68_integer_ciface_MOD",
"hsl_mc68_integer_MOD", "hsl_mc78_integer_MOD", "hsl_zb01_integer_MOD", "galahad_hsl_of01_integer_MOD_",
"mkl_pardiso_private_MOD", "pastixf_enums_MOD", "pastixf_interfaces_MOD", "spmf_enums_MOD"]
single_double_quadruple_modules = ["hash_MOD", "string_MOD", "string_64_MOD", "clock_MOD", "copyright_MOD", "symbols_MOD", "tools_MOD",
"common_ciface_MOD", "hash_ciface_MOD", "hash_64_MOD", "hash_ciface_64_MOD", "hsl_kb22_long_integer_MOD",
"hsl_mc68_integer_ciface_MOD", "hsl_mc68_integer_MOD", "hsl_mc78_integer_MOD", "hsl_mc78_integer_64_MOD", "hsl_zb01_integer_MOD",
"hsl_of01_integer_MOD", "hsl_of01_integer_64_MOD", "mkl_pardiso_private_MOD", "pastixf_enums_MOD", "pastixf_interfaces_MOD", "spmf_enums_MOD",
"spral_pgm_64_MOD", "pastixf_enums_64_MOD", "mkl_pardiso_private_64_MOD", "spmf_enums_64_MOD", "spral_hw_topology_64_MOD",
"spral_metis_wrapper_64_MOD", "tools_64_MOD", "galahad_symbols_64_MOD", "hsl_mc68_integer_64_ciface_MOD", "hsl_kb22_long_integer_64_MOD",
"common_ciface_64_MOD", "clock_64_MOD", "hsl_mc68_integer_64_MOD", "hsl_zb01_integer_64_MOD", "copyright_64_MOD",
"version_64_MOD", "spral_hw_topology_MOD", "spral_pgm_MOD", "spral_metis_wrapper_MOD", "spral_core_analyse_64_MOD",
"galahad_version_MOD", "spral_core_analyse_MOD"]

unknown_symbols = ["errexit", "getpathname", "gkfooo", "main", "PrintBackTrace", "spral_hw_topology_free", "spral_hw_topology_guess",
"Test_ND", "VerifyND", "xerbla2_"]

for (symbols1, symbols2, int1, int2, name) in symbols_combinations
intersect_symbols = intersect(symbols1, symbols2)
println("---------------------------------------------------------------------------------------------------------------------------")
println("The following symbols are exported by both the libraries $name:")
for symbol in intersect_symbols
flag1 = (startswith(symbol, "galahad_") || startswith(symbol, "cutest_")) && endswith(symbol, "_") && (int1 == int2 == 32)
flag2 = (startswith(symbol, "galahad_") || startswith(symbol, "cutest_")) && endswith(symbol, "64_") && (int1 == int2 == 64)
flag3 = mapreduce(x -> contains(symbol, x), |, single_double_modules) && (int1 == int2)
if !flag1 && !flag2 && !flag3
flag1 = startswith(symbol, "galahad_") && endswith(symbol, "_") && (int1 == int2 == 32)
flag2 = startswith(symbol, "galahad_") && endswith(symbol, "64_") && (int1 == int2 == 64)
flag3 = startswith(symbol, "cutest_") && endswith(symbol, "_")
flag4 = mapreduce(x -> contains(symbol, x), |, single_double_quadruple_modules) && (int1 == int2)
flag5 = startswith(symbol, "_Z") || startswith(symbol, "gk_") || startswith(symbol, "galmetis__") || startswith(symbol, "libmetis__")
flag6 = mapreduce(x -> startswith(symbol, x), |, ["galahad_pardiso", "galahad_pastix", "galahad_spm", "galahad_metis", "galahad_mpi", "galahad_wsmp", "galahad_mkl_pardiso", "galahad_ws"])
flag7 = mapreduce(x -> symbol == x, |, ["fun_", "grad_", "hprod_", "jprod_", "hess_"]) || mapreduce(x -> startswith(symbol, x), |, ["elfun", "group", "range"])
flag8 = mapreduce(x -> symbol == x, |, ["version_galahad", "METIS_Free", "METIS_NodeND", "METIS_SetDefaultOptions", "gal_kb07ai_"]) && (int1 == int2 == 32)
flag9 = mapreduce(x -> symbol == x, |, ["version_galahad_64", "METIS_Free_64", "METIS_NodeND_64", "METIS_SetDefaultOptions_64", "gal_kb07ai_64_"]) && (int1 == int2 == 64)
flag10 = mapreduce(x -> symbol == x, |, ["CoarsenGraphNlevels", "ComputeBFSOrdering", "Greedy_KWayEdgeCutOptimize", "Greedy_KWayEdgeStats", "GrowBisectionNode2"])
flag11 = mapreduce(x -> symbol == x, |, unknown_symbols)
if !flag1 && !flag2 && !flag3 && !flag4 && !flag5 && !flag6 && !flag7 && !flag8 && !flag9 && !flag10 && !flag11
println(symbol)
global n = n+1
end
end
println("---------------------------------------------------------------------------------------------------------------------------")
println()
end

@test n == 0
1 change: 1 addition & 0 deletions include/galahad_cfunctions.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#ifdef INTEGER_64
#define version_galahad version_galahad_64
#ifdef REAL_32
#define arc_initialize arc_initialize_s_64
#define arc_read_specfile arc_read_specfile_s_64
Expand Down
10 changes: 10 additions & 0 deletions include/galahad_modules.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@
#define PARDISO_SETENV GALAHAD_PARDISO_SETENV
#define PARDISO_SETENV_F GALAHAD_PARDISO_SETENV_F
#define MKL_PARDISO_PIVOT GALAHAD_MKL_PARDISO_PIVOT
#define PARDISO_EXPORT_Q GALAHAD_PARDISO_EXPORT_Q
#define PARDISO_EXPORT_X GALAHAD_PARDISO_EXPORT_X
#define PARDISO_Q GALAHAD_PARDISO_Q
#define PARDISO_Q_2D GALAHAD_PARDISO_Q_2D
#define PARDISO_Q_64 GALAHAD_PARDISO_Q_64
#define PARDISO_Q_64_2D GALAHAD_PARDISO_Q_64_2D
#define PARDISO_QC GALAHAD_PARDISO_QC
#define PARDISO_QC_2D GALAHAD_PARDISO_QC_2D
#define PARDISO_QC_64 GALAHAD_PARDISO_QC_64
#define PARDISO_QC_64_2D GALAHAD_PARDISO_QC_64_2D
#endif

#ifdef DUMMY_WSMP
Expand Down
2 changes: 2 additions & 0 deletions include/galahad_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#define GALAHAD_VERSION_H

#include "galahad_precision.h"
#include "galahad_cfunctions.h"

void version_galahad(ipc_ *major, ipc_ *minor, ipc_ *patch);

// end include guard
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ endif

extra_args_single = ['-DREAL_32']
extra_args_double = []
extra_args_quadruple = ['-DREAL_128', '-DGALAHAD_BLAS', '-DGALAHAD_LAPACK']
extra_args_quadruple = ['-DREAL_128', '-DGALAHAD_BLAS', '-DGALAHAD_LAPACK', '-DDUMMY_QMUMPS']

if not libblas.found()
extra_args_single += '-DGALAHAD_BLAS'
Expand Down
2 changes: 1 addition & 1 deletion src/version/C/version_ciface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

MODULE GALAHAD_VERSION_ciface
USE GALAHAD_KINDS
USE GALAHAD_VERSION, ONLY: f_version_galahad => version_galahad
USE GALAHAD_VERSION, ONLY: f_VERSION_galahad => VERSION_galahad

CONTAINS

Expand Down

0 comments on commit 261a923

Please sign in to comment.