-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/ralna/SIFDecode
- Loading branch information
Showing
6 changed files
with
150 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters