Skip to content

Commit

Permalink
milk commands
Browse files Browse the repository at this point in the history
  • Loading branch information
oguyon committed Aug 15, 2024
1 parent 55eb6bf commit 5f9bf52
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 10 deletions.
24 changes: 23 additions & 1 deletion scripts/milk-all
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
#!/usr/bin/env bash

MILKCLI_APPNAME="milk-all" MILKCLI_ADD_LIBS="$MILKCLI_ADD_LIBS;milklinalgebra,milkfft,milkimagebasic,milkimagefilter,milkimageformat,milkimagegen,milkimgreduce,milkinfo,milkkdtree,milklinARfilterPred,milklinoptimtools,milkmoduleexample,milkpsf,milkstatistic,milkZernikePolyn" milk "$@"
MSdescr="milk with all installed modules"


modulelist="milklinalgebra,milkfft,milkimagebasic,milkimagefilter,milkimageformat,milkimagegen,milkimgreduce,milkinfo,milkkdtree,milklinARfilterPred,milklinoptimtools,milkmoduleexample,milkpsf,milkstatistic,milkZernikePolyn"

# Extended description
MSextdescr="Loads modules:
$modulelist
"

source milk-script-std-config



RequiredCommands=( milk )
RequiredFiles=()
RequiredDirs=()

source milk-argparse



MILKCLI_APPNAME="milk-all" MILKCLI_ADD_LIBS="${MILKCLI_ADD_LIBS-};${modulelist}" milk "$@"
24 changes: 22 additions & 2 deletions scripts/milk-commands
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#!/usr/bin/env bash

# This script uses milk-argparse
# See template milk-scriptexample in module milk_module_example for template and instructions


MSdescr="list milk- scripts"

MSextdescr="List milk scripts
Scan system for milk- commands
"

source milk-script-std-config
Expand Down Expand Up @@ -34,16 +37,33 @@ NC='\033[0m' # No Color

echo "LIST OF MILK COMMANDS :"

excludestring=("milk-argparse" "milk-check" "milk-cr2tofits" "milk-isio-scan" "milk-fpslist-addentry" "milk-logshim" "milk-logshimkill" "milk-logshimoff" "milk-logshimon" "milk-makecsetandrt" "milk-rmshmim" "milk-shm2FITSloop" "milk-shm2FITS" "milk-shmimmon" "milk-shmimpurge")

for cmd in $CMDLIST; do

EXCLUDE=0
for exclcmd in ${excludestring[@]}; do
if [ "${exclcmd}" = "${cmd}" ]; then
#pathstring="$(which ${cmd})"
#printf " ${GREEN}%-32s${NC} %s\n" "$cmd" "${pathstring}"
EXCLUDE=1
fi
done


if [ "${PRINTPATH}" = "1" ]; then
pathstring="$(which ${cmd})"
printf " ${GREEN}%-32s${NC} %s\n" "$cmd" "${pathstring}"
elif [ "${PRINTDATE}" = "1" ]; then
filename="$(which ${cmd})"
datestring="$(date -r $filename '+%Y-%m-%dT%H:%M:%SZ')"
CMDLISTOUT+="$(printf "%s %s;" "${datestring}" "$cmd")"
else
else
if [ "${EXCLUDE}" = "0" ]; then
helpline=$( $cmd -hs | head -n 1 )
else
helpline=""
fi
printf " ${GREEN}%-32s${NC} %s\n" "$cmd" "$helpline"
fi

Expand Down
5 changes: 2 additions & 3 deletions src/COREMOD_memory/scripts/milk-semloopspeed
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
MSdescr="measure semaphore latency"

# Extended description
MSdescr="creates 2 streams and 2 processes
MSextdescr="creates 2 streams and 2 processes
process AB waits on imA, pokes imB
process BA waits on imB, pokes imA
"
Expand Down Expand Up @@ -40,9 +40,8 @@ MSarg+=( "nbloop:int:number of loop interations" )

# parse arguments
source milk-argparse
NBLOOP="${inputMSargARRAY[0]}"


NBLOOP="${inputMSargARRAY[0]}"


SEMTRIG="3"
Expand Down
34 changes: 30 additions & 4 deletions src/milk_module_example/scripts/milk-semtestspeed
Original file line number Diff line number Diff line change
@@ -1,13 +1,39 @@
#!/usr/bin/env bash

# Test semaphore latency
# Sets up two streams, imA and imB
# This script uses milk-argparse
# See template milk-scriptexample in module milk_module_example for template and instructions

MSdescr="test semaphore latency"

MSextdescr="
Sets up two streams, imA and imB
"

source milk-script-std-config


# prerequisites
#
RequiredCommands=( milk tmux )
RequiredFiles=()
RequiredPipes=()
RequiredDirs=()

# SCRIPT MANDATORY ARGUMENTS
# syntax: "name:type(s)/test(s):description"
#
MSarg+=( "nbloop:integer:number of loop iterations" )
MSarg+=( "semtrig:integer:semaphore trigger" )


source milk-argparse

NBLOOP="${inputMSargARRAY[0]}"
SEMTRIG="${inputMSargARRAY[1]}"

echo "CTEST_FULL_OUTPUT"

SEMTRIG="$2"
NBLOOP="$1"


milk << EOF
mk2Dim "s>imA" 100 100
Expand Down

0 comments on commit 5f9bf52

Please sign in to comment.