diff options
author | lioux <lioux@FreeBSD.org> | 2002-10-07 11:07:13 +0800 |
---|---|---|
committer | lioux <lioux@FreeBSD.org> | 2002-10-07 11:07:13 +0800 |
commit | 42ae63942cf45d976af718fd7d990b4afa1cbb13 (patch) | |
tree | 518acf28372976ddd1c049f4abbb2ac794ba89c0 /biology/distribfold/files | |
parent | 6228763969966b54776b3cb286d2c6b46b34a059 (diff) | |
download | freebsd-ports-gnome-42ae63942cf45d976af718fd7d990b4afa1cbb13.tar.gz freebsd-ports-gnome-42ae63942cf45d976af718fd7d990b4afa1cbb13.tar.zst freebsd-ports-gnome-42ae63942cf45d976af718fd7d990b4afa1cbb13.zip |
o New port distribfold version 0.1: distribfold.org distributed protein
folding project
o One can start multiple instances of this port. Just install it
using WITH_NCPU
Diffstat (limited to 'biology/distribfold/files')
-rw-r--r-- | biology/distribfold/files/distribfold.sh | 61 | ||||
-rw-r--r-- | biology/distribfold/files/number_of_dirs.sh | 16 | ||||
-rw-r--r-- | biology/distribfold/files/patch-foldit | 16 |
3 files changed, 93 insertions, 0 deletions
diff --git a/biology/distribfold/files/distribfold.sh b/biology/distribfold/files/distribfold.sh new file mode 100644 index 000000000000..fc6c75095c6a --- /dev/null +++ b/biology/distribfold/files/distribfold.sh @@ -0,0 +1,61 @@ +#!/bin/sh +# taken from misc/dnetc by dbaker@distributed.net + +prefix="%%DESTINATION_DIR%%" +ncpu=%%NCPU%% + +case "$1" in +start) + while [ ${ncpu} -gt 0 ]; + do + # update cpu count + ncpu=$((${ncpu} - 1)) + + # dir for current cpu + dir="${prefix}/cpu${ncpu}" + + if [ ! -d $dir ]; then + logger -i "distribfold client directory doesn't exist. ($dir)." + exit + fi + + if [ ! -f $dir/foldtrajlite ]; then + logger -i "distribfold client doesn't exist. ($dir/dfoldtrajlite)." + exit + fi + + if [ ! -f $dir/handle.txt ]; then + logger -i "distribfold client is not configured. 'su -m %%DNETFOLD_USER%% -c $dir/foldit' to configure it." + echo "distribfold client is not configured. 'su -m %%DNETFOLD_USER%% -c $dir/foldit' to configure it." + exit + fi + + # start client for current cpu + su -m %%DNETFOLD_USER%% -c "cd $dir && ./foldit" 2>/dev/null >/dev/null & + done + + echo -n " distribfold" + ;; +stop) + while [ ${ncpu} -gt 0 ]; + do + # update cpu count + ncpu=$((${ncpu} - 1)) + + # dir for current cpu + dir="${prefix}/cpu${ncpu}" + + rm $dir/foldtrajlite.lock + done + + # give clients enough time to shutdown + # 5 seconds minimum + 5 seconds per number of clients + sleep $((5 + $((5 * ${ncpu})))) && echo -n " distribfold" + ;; +*) + echo "Usage: `basename $0` {start|stop}" >&2 + exit 64 + ;; +esac + +exit 0 diff --git a/biology/distribfold/files/number_of_dirs.sh b/biology/distribfold/files/number_of_dirs.sh new file mode 100644 index 000000000000..bdb3b87cc56b --- /dev/null +++ b/biology/distribfold/files/number_of_dirs.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +ncpu=${1} +current_list="" + +while [ ${ncpu} -gt 0 ]; +do + # update cpu count + ncpu=$((${ncpu} - 1)) + + current_list="${current_list} ${ncpu}" +done + +echo ${current_list} + +exit 0 diff --git a/biology/distribfold/files/patch-foldit b/biology/distribfold/files/patch-foldit new file mode 100644 index 000000000000..3543505e05e8 --- /dev/null +++ b/biology/distribfold/files/patch-foldit @@ -0,0 +1,16 @@ +--- foldit.orig Sun Sep 29 16:49:55 2002 ++++ foldit Sun Sep 29 16:50:42 2002 +@@ -1,4 +1,7 @@ + #!/bin/sh ++ ++cd %%DESTINATION_DIR%% ++ + if [ -f donename.dat ] + then + rm -f tmpfoldit.bat +@@ -23,4 +26,4 @@ + fi + fi + fi +-./foldtrajlite -f protein -n native ++exec ./foldtrajlite -f protein -n native |