Skip to content

Commit

Permalink
updated to generate quad precision output if required => version 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dalekopera committed Apr 8, 2024
1 parent d88115c commit 8f5691a
Show file tree
Hide file tree
Showing 5 changed files with 1,131 additions and 497 deletions.
85 changes: 44 additions & 41 deletions bin/sifdecoder
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# sifdecoder: script to decode a sif file
#
# N. Gould, D. Orban & Ph. Toint, November 7th, 2000
# This version October 24th, 2023
# This version April 6th, 2024

display_short_help() {
echo ' Use: sifdecoder [-A architecture] [-sp] [-h] [-c] [-f] [-b] [-a j]'
Expand All @@ -14,41 +14,42 @@ display_short_help() {
display_long_help() {
display_short_help
echo "where options:"
echo " -A : specify the architecture. (Default: use $MYARCH)"
echo " -h : print this help and stop execution"
echo " -o : 0 for silent mode, 1 for brief description"
echo " of the stages executed. (Default: -o 0)"
echo " -m : check for memory leaks using valgrind"
echo " -f : use automatic differentiation in Forward mode"
echo " -b : use automatic differentiation in Backward mode"
echo " -a : 1 use the older HSL automatic differentiation "
echo " package AD01"
echo " 2 use the newer HSL automatic differentiation "
echo " package AD02"
echo " (Default: -a 2)"
echo " -p : decode for a particular package"
echo " 1=LANCELOT, 2=BARIA, 3=CUTEst (default)"
echo " -c : check derivatives for errors using finite"
echo " differences (default: do not check)"
echo " -s : rough size of problem for array initialization"
echo " 0=debug, 1=small, 2=medium, 3=large (default)"
echo " -sp : decode problem in single precision (default: double)"
echo " -st : starting point vector to be used"
echo " (Default: -st 1)"
echo " -show : displays possible parameter settings for"
echo " probname[.SIF]. Other options are ignored"
echo " -param : cast probname[.SIF] against explicit parameter"
echo " settings. Several parameter settings may be"
echo " given as a comma-separated list following"
echo " -param or using several -param flags."
echo " Use -show to view possible settings."
echo " -force : forces setting of a parameter to the given value"
echo " even if this value is not specified in the file."
echo " This option should be used with care."
echo " (Default: do not enforce)."
echo " -A : specify the architecture. (Default: use $MYARCH)"
echo " -h : print this help and stop execution"
echo " -o : 0 for silent mode, 1 for brief description"
echo " of the stages executed. (Default: -o 0)"
echo " -m : check for memory leaks using valgrind"
echo " -f : use automatic differentiation in Forward mode"
echo " -b : use automatic differentiation in Backward mode"
echo " -a : 1 use the older HSL automatic differentiation "
echo " package AD01"
echo " 2 use the newer HSL automatic differentiation "
echo " package AD02"
echo " (Default: -a 2)"
echo " -p : decode for a particular package"
echo " 1=LANCELOT, 2=BARIA, 3=CUTEst (default)"
echo " -c : check derivatives for errors using finite"
echo " differences (default: do not check)"
echo " -s : rough size of problem for array initialization"
echo " 0=debug, 1=small, 2=medium, 3=large (default)"
echo " -sp : decode problem in single precision (default: double)"
echo " -qp : decode problem in quadruple precision (default: double)"
echo " -st : starting point vector to be used"
echo " (Default: -st 1)"
echo " -show : displays possible parameter settings for"
echo " probname[.SIF]. Other options are ignored"
echo " -param : cast probname[.SIF] against explicit parameter"
echo " settings. Several parameter settings may be"
echo " given as a comma-separated list following"
echo " -param or using several -param flags."
echo " Use -show to view possible settings."
echo " -force : forces setting of a parameter to the given value"
echo " even if this value is not specified in the file."
echo " This option should be used with care."
echo " (Default: do not enforce)."
echo ""
echo " probname probname.SIF is the name of the file containing"
echo " the SIF file for the problem of interest."
echo " probname probname.SIF is the name of the file containing"
echo " the SIF file for the problem of interest."
}

# Environment check
Expand Down Expand Up @@ -132,17 +133,17 @@ MEMCHECK=0

DERIVCHECK=0

# throwback to LANCELOT days (1 = LANCELOT, 2 = BARIA, 3 = CUTEst, other = 3)
# throwback to LANCELOT days (1=LANCELOT, 2=BARIA, 3=CUTEst, other=3)

let PACKAGE=3

# rough size of problem (0 = debug,1 = small, 2 = medium, 3 = large, other = 3)
# rough size of problem (0=debug,1=small, 2=medium, 3=large, other=3)

let size=2

# specify the precision of the output files (single = 0, double = 1)
# specify the precision of the output files (single=32,double=64,quadruple=128)

let double=1
let realpr=64

# starting point vector to be used; if st > # starting vectors, st = 1

Expand Down Expand Up @@ -178,7 +179,9 @@ while (( i <= last )); do
(( i++ ))
let size=${!i}
elif [[ "$opt" == '-sp' ]]; then
let double=0
let realpr=32
elif [[ "$opt" == '-qp' ]]; then
let realpr=128
elif [[ "$opt" == '-st' ]]; then
(( i++ ))
let st=${!i}
Expand Down Expand Up @@ -436,7 +439,7 @@ echo $OUTPUT >> $sdinput
echo $PROBNAME >> $sdinput
echo $automatic >> $sdinput
echo $ad0 >> $sdinput
echo $double >> $sdinput
echo $realpr >> $sdinput
echo $size >> $sdinput
echo $st >> $sdinput

Expand Down
17 changes: 8 additions & 9 deletions man/man1/sifdecoder.1
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
.SH NAME
sifdecoder \- SIF-decoding script.
.SH SYNOPSIS
\fBsifdecoder\fP [\-A \fIarch\fP] [\-sp] [\-h] [\-o \fI0|1\fP] [-m]
\fBsifdecoder\fP [\-A \fIarch\fP] [\-sp] [\-qp] [\-h] [\-o \fI0|1\fP] [-m]
[\-f] [\-b] [\-a \fI1|2\fP]
[\-p \fI1|2|3\fP]
[\-s \fI0|1|2|3\fP]
[\-sp]
[\-st \fI1|2|3\fP]
[\-show] [\-param
\fIname=value\fP[\fI,name=value...\fP]] [\-force]
Expand All @@ -32,9 +31,13 @@ directory $SIFDECODE/versions. If no \-A option is given, a valid
architecture given by the environment variable $MYARCH will be
used, but if $MYARCH is invalid or empty the decoder will terminate.
.TP
.B \-sp
Run sifdecoder in single-precision mode, if available.
Double precision is the default.
.BI \-sp
Decode the problem for use with the single precision tools. The default is to
decode the problem for use with the double precision tools.
.TP
.BI \-qp
Decode the problem for use with the quadruple precision tools. The default is to
decode the problem for use with the double precision tools.
.TP
.B \-h
Print a short help message.
Expand Down Expand Up @@ -78,10 +81,6 @@ of up to approximately 10000 variables and constraints, and
allocation errors on modest computers.
The default is for meedium-sized problems.
.TP
.BI \-sp
Decode the problem for use with the single precision tools. The default is to
decode the problem for use with the double precision tools.
.TP
.BI \-st " 1|2|3"
Specifies the starting point vector to be used if there is more than one.
Any value outside the actual number of starting vectors will be interpreted
Expand Down
38 changes: 37 additions & 1 deletion src/decode/makemaster
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,48 @@ test_unconstrained: $(SIFDECODES)

test_constrained: $(SIFDECODES)
echo ""
echo " Decode unconstrained SIF file"
echo " Decode constrained SIF file"
cd $(SIFDECODE)/sif/ ; \
$(SIFDECODE)/bin/sifdecoder -A $(VERSION) ALLINITC
echo ""
echo " Tests for constrained sifdecode complete"

test_single: test_unconstrained_single test_constrained_single

test_unconstrained_single: $(SIFDECODES)
echo ""
echo " Decode unconstrained SIF file"
cd $(SIFDECODE)/sif/ ; \
$(SIFDECODE)/bin/sifdecoder -A $(VERSION) -sp ALLINITU
echo ""
echo " Tests for unconstrained sifdecode complete"

test_constrained_single: $(SIFDECODES)
echo ""
echo " Decode constrained SIF file"
cd $(SIFDECODE)/sif/ ; \
$(SIFDECODE)/bin/sifdecoder -A $(VERSION) -sp ALLINITC
echo ""
echo " Tests for constrained sifdecode complete"

test_quadruple: test_unconstrained_quadruple test_constrained_quadruple

test_unconstrained_quadruple: $(SIFDECODES)
echo ""
echo " Decode unconstrained SIF file"
cd $(SIFDECODE)/sif/ ; \
$(SIFDECODE)/bin/sifdecoder -A $(VERSION) -qp ALLINITU
echo ""
echo " Tests for unconstrained sifdecode complete"

test_constrained_quadruple: $(SIFDECODES)
echo ""
echo " Decode constrained SIF file"
cd $(SIFDECODE)/sif/ ; \
$(SIFDECODE)/bin/sifdecoder -A $(VERSION) -qp ALLINITC
echo ""
echo " Tests for constrained sifdecode complete"

# individual compilations

sifdecode.o: $(LS)(sifdecode.o)
Expand Down
Loading

0 comments on commit 8f5691a

Please sign in to comment.