Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ralna/SIFDecode
Browse files Browse the repository at this point in the history
  • Loading branch information
dalekopera committed Sep 9, 2024
2 parents b49507a + 8c251b7 commit edeb4a9
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .github/julia/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ platforms = expand_gfortran_versions(platforms)

# The products that we will ensure are always built
products = [
LibraryProduct("libsifdecode", :libsifdecode),
ExecutableProduct("sifdecoder_standalone", :sifdecoder_standalone),
ExecutableProduct("sifdecoder_standalone", :sifdecoder_standalone),
]

# Dependencies that must be installed before this package can be built
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/meson.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.os }}_${{ matrix.compiler }}-v${{ matrix.version }}_Int${{ matrix.int }}_meson-log.txt
name: ${{ matrix.os }}_${{ matrix.compiler }}-v${{ matrix.version }}_meson-log.txt
path: builddir/meson-logs/meson-log.txt

- name: Install SIFDecode
Expand All @@ -71,5 +71,5 @@ jobs:
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.os }}_${{ matrix.compiler }}-v${{ matrix.version }}_Int${{ matrix.int }}_install-log.txt
name: ${{ matrix.os }}_${{ matrix.compiler }}-v${{ matrix.version }}_install-log.txt
path: builddir/meson-logs/install-log.txt
58 changes: 58 additions & 0 deletions .github/workflows/sif_database.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CLASS.DB
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Verify SIF files and CLASSF.DB consistency
runs-on: ubuntu-latest
steps:
- name: Checkout SIFDecode
uses: actions/checkout@v4

- name: Download the CUTEst NLP test set
shell: bash
run: |
cd $GITHUB_WORKSPACE/../
git clone https://bitbucket.org/optrove/sif
- name: Check entries in CLASSF.DB and SIF files
shell: bash
run: |
cd $GITHUB_WORKSPACE/../sif
# Read the CLASSF.DB file and store the problem names in an array
mapfile -t db_problems < <(awk '{print $1}' CLASSF.DB)
# Initialize counters for missing files and missing DB entries
missing_sif_count=0
missing_db_count=0
# Check if each SIF file has an entry in CLASSF.DB
for file in *.SIF; do
problem_name="${file%.SIF}"
if [[ " ${db_problems[*]} " != *" ${problem_name} "* ]]; then
echo "${problem_name} is ABSENT from CLASSF.DB"
missing_db_count=$((missing_db_count + 1))
fi
done
# Check if each entry in CLASSF.DB has a corresponding SIF file
for problem in "${db_problems[@]}"; do
if [[ ! -f "${problem}.SIF" ]]; then
echo "SIF file for ${problem} is MISSING"
missing_sif_count=$((missing_sif_count + 1))
fi
done
echo "Total number of SIF files without DB entries: ${missing_db_count}"
echo "Total number of DB entries without SIF files: ${missing_sif_count}"
# Exit with error if any issues were found
if [ "${missing_db_count}" -ne 0 ] || [ "${missing_sif_count}" -ne 0 ]; then
echo "Error: Mismatch between CLASSF.DB entries and SIF files"
exit 1
fi
86 changes: 86 additions & 0 deletions .github/workflows/sifdecoder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: sifdecoder
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: ${{ matrix.os }} -- ${{ matrix.problems }} -- ${{ matrix.precision }} precision
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
version: ['12']
problems: ['sifcollection', 'maros-meszaros', 'netlib-lp']
precision: ['single', 'double', 'quadruple']
runs-on: ${{ matrix.os }}
steps:
- name: Check out SIFDecode
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install Meson and Ninja
run: pip install meson ninja

- name: Install compilers
uses: fortran-lang/setup-fortran@main
with:
compiler: ${{ matrix.compiler }}
version: ${{ matrix.version }}

# Uncomment this section to obtain ssh access to VM
# - name: Setup tmate session
# if: matrix.os == 'windows-latest'
# uses: mxschmitt/action-tmate@v3

- name: Download ${{ matrix.problems }}
shell: bash
run: |
cd $GITHUB_WORKSPACE/../
if [[ "${{ matrix.problems }}" == "sifcollection" ]]; then
git clone https://bitbucket.org/optrove/sif
fi
if [[ "${{ matrix.problems }}" == "maros-meszaros" ]]; then
git clone https://bitbucket.org/optrove/maros-meszaros
mv maros-meszaros sif
fi
if [[ "${{ matrix.problems }}" == "netlib-lp" ]]; then
git clone https://bitbucket.org/optrove/netlib-lp
mv netlib-lp sif
fi
- name: SIFDecode
shell: bash
run: |
meson setup builddir -Ddefault_library=static
meson compile -C builddir
cp builddir/sifdecoder_standalone $GITHUB_WORKSPACE/../sif
- name: Decode the SIF files
shell: bash
run: |
cd $GITHUB_WORKSPACE/../sif
for file in *.SIF; do
if [ -f "$file" ]; then
echo "Processing $file"
rm -f *.f *.o *.d
if [[ "${{ matrix.precision }}" == "single" ]]; then
./sifdecoder_standalone -sp "$file"
gfortran -shared -fPIC *.f
fi
if [[ "${{ matrix.precision }}" == "double" ]]; then
./sifdecoder_standalone -dp "$file"
gfortran -shared -fPIC *.f
fi
if [[ "${{ matrix.precision }}" == "quadruple" ]]; then
./sifdecoder_standalone -qp "$file"
gfortran -shared -fPIC *.f
fi
fi
done
4 changes: 2 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
project(
'SIFDecode',
'fortran',
version: '2.5.1',
version: '2.6.0',
meson_version: '>= 0.61.0',
default_options: [
'buildtype=release',
'libdir=lib',
'default_library=shared',
'default_library=static',
'warning_level=0',
],
)
Expand Down
2 changes: 1 addition & 1 deletion src/decode/sifdecode.f90
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ MODULE SIFDECODE
! V e r s i o n
!---------------

CHARACTER ( LEN = 6 ) :: version = '2.5.1 '
CHARACTER ( LEN = 6 ) :: version = '2.6.0 '

!--------------------
! P r e c i s i o n
Expand Down

0 comments on commit edeb4a9

Please sign in to comment.