memory-mapped DB in sched server

svn path=/trunk/boinc/; revision=52
This commit is contained in:
David Anderson 2002-05-24 04:29:10 +00:00
parent e3d7c1b980
commit a5cc5f66f2
41 changed files with 665 additions and 441 deletions

3
TODO
View File

@ -14,9 +14,6 @@ HIGH-PRIORITY (must be done to support SETI@home)
- proxy support
- add country, postal code to user
collect on login
- implement scheme for distributing scheduling server addresses
each project provides a URL for file with list of scheduler address,
and email address of "problems" contact

View File

@ -32,7 +32,7 @@ uc_slow: uc_slow.o
$(CC) 1sec.o $(LIBS) -o 1sec
clean:
rm -f *.o $(APPS)
rm -f *.o $(APPS) dependencies
dependencies: *.C
$(CC) -M *.C > dependencies

View File

@ -1,27 +0,0 @@
1sec.o: 1sec.C /usr/include/stdio.h /usr/include/sys/feature_tests.h \
/usr/include/sys/isa_defs.h /usr/include/sys/va_list.h \
/usr/include/stdio_tag.h /usr/include/stdio_impl.h \
/usr/include/time.h /usr/include/sys/types.h \
/usr/include/sys/machtypes.h /usr/include/sys/int_types.h \
/usr/include/sys/select.h /usr/include/sys/time.h \
/usr/include/sys/time_impl.h
concat.o: concat.C /usr/include/stdio.h \
/usr/include/sys/feature_tests.h /usr/include/sys/isa_defs.h \
/usr/include/sys/va_list.h /usr/include/stdio_tag.h \
/usr/include/stdio_impl.h
error.o: error.C /usr/include/stdio.h /usr/include/sys/feature_tests.h \
/usr/include/sys/isa_defs.h /usr/include/sys/va_list.h \
/usr/include/stdio_tag.h /usr/include/stdio_impl.h
uc_slow.o: uc_slow.C /usr/include/stdio.h \
/usr/include/sys/feature_tests.h /usr/include/sys/isa_defs.h \
/usr/include/sys/va_list.h /usr/include/stdio_tag.h \
/usr/include/stdio_impl.h /usr/include/unistd.h \
/usr/include/sys/types.h /usr/include/sys/machtypes.h \
/usr/include/sys/int_types.h /usr/include/sys/select.h \
/usr/include/sys/time.h /usr/include/time.h \
/usr/include/sys/time_impl.h /usr/include/sys/unistd.h \
/usr/include/ctype.h ../api/api.h
upper_case.o: upper_case.C /usr/include/stdio.h \
/usr/include/sys/feature_tests.h /usr/include/sys/isa_defs.h \
/usr/include/sys/va_list.h /usr/include/stdio_tag.h \
/usr/include/stdio_impl.h /usr/include/ctype.h

View File

@ -55,3 +55,58 @@ David A. May 15 2002
init.inc
tools
add.C
David A. May 23 2002
- Change the scheduling server to reduce database accesses.
There's now a shared-memory segment that contains
1) the platform, app, and app_version tables in their entirety;
2) a fixed-size set of results ready to be sent,
and their corresponding workunit.
This segment is initialized and maintained by a new program
called the "feeder" (sched/feeder.C) that should run
whenever the scheduling server is up.
Note: the scheduler still needs to be converted to fast CGI
- Added handy interfaces for dealing with shared memory and semaphores.
- Changed to utilities and scripts used for testing so that all
server-specific names (paths and URLs) come from environment
variables instead of being hardwired in the code.
You'll want to add these to your .tcshrc or whatever.
See the doc/install.html for details.
Files:
TODO
apps/
Makefile.in
client/
app.C
db/
db.h
doc/
index.html
install.html
intro.html
tools.html (removed)
tools_other.html
tools_work.html
work.html
lib/
Makefile.in
md5_file.C
shmem.C,h (new)
shmem_test.C (new)
synch.C,h (new)
synch_test.C (new)
sched/
feeder.C (new)
Makefile.in
handle_request.C,h
main.C
sched_shmem.C,h (new)
server_types.C,h
test/
account.xml (deleted)
account1.xml
init.inc
test_uc.php
tools/
add.C
create_work.C

View File

@ -9,99 +9,33 @@ configure:750: checking whether the C compiler (gcc ) works
configure:766: gcc -o conftest conftest.c 1>&5
configure:792: checking whether the C compiler (gcc ) is a cross-compiler
configure:797: checking whether we are using GNU C
configure:806: gcc -E conftest.c
configure:825: checking whether gcc accepts -g
configure:857: checking how to run the C preprocessor
configure:878: gcc -E conftest.c >/dev/null 2>conftest.out
configure:939: checking for ranlib
configure:987: checking for sin in -lm
configure:1006: gcc -o conftest -g -O2 conftest.c -lm 1>&5
configure:999: warning: conflicting types for built-in function `sin'
configure:1034: checking for gethostbyaddr in -lnsl
configure:1053: gcc -o conftest -g -O2 conftest.c -lnsl -lm 1>&5
configure:1081: checking for setservent in -lsocket
configure:1100: gcc -o conftest -g -O2 conftest.c -lsocket -lnsl -lm 1>&5
configure:1128: checking for strfind in -lgen
configure:1147: gcc -o conftest -g -O2 conftest.c -lgen -lsocket -lnsl -lm 1>&5
configure:1175: checking for strfind in -lgen
configure:1218: checking for cerr in -lstdc++
configure:1237: gcc -o conftest -g -O2 conftest.c -lstdc++ -lgen -lsocket -lnsl -lm 1>&5
configure:1270: checking for dirent.h that defines DIR
configure:1283: gcc -c -g -O2 conftest.c 1>&5
configure:1308: checking for opendir in -ldir
configure:1327: gcc -o conftest -g -O2 conftest.c -ldir -lstdc++ -lgen -lsocket -lnsl -lm 1>&5
/disks/asimov/a/lang/gnu/H-sparc-sun-solaris2/lib/gcc-lib/sparc-sun-solaris2/2.7-96q3/../../../../sparc-sun-solaris2/bin/ld: cannot open -ldir: No such file or directory
collect2: ld returned 1 exit status
configure: failed program was:
#line 1316 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char opendir();
int main() {
opendir()
; return 0; }
configure:1391: checking for ANSI C header files
configure:1404: gcc -E conftest.c >/dev/null 2>conftest.out
configure:1471: gcc -o conftest -g -O2 conftest.c -lstdc++ -lgen -lsocket -lnsl -lm 1>&5
configure:1498: checking for fcntl.h
configure:1508: gcc -E conftest.c >/dev/null 2>conftest.out
configure:1498: checking for sys/time.h
configure:1508: gcc -E conftest.c >/dev/null 2>conftest.out
configure:1498: checking for unistd.h
configure:1508: gcc -E conftest.c >/dev/null 2>conftest.out
configure:1498: checking for sys/select.h
configure:1508: gcc -E conftest.c >/dev/null 2>conftest.out
configure:1498: checking for sys/statvfs.h
configure:1508: gcc -E conftest.c >/dev/null 2>conftest.out
configure:1498: checking for sys/swap.h
configure:1508: gcc -E conftest.c >/dev/null 2>conftest.out
configure:1536: checking for working const
configure:1590: gcc -c -g -O2 conftest.c 1>&5
configure:1611: checking for size_t
configure:1644: checking whether time.h and sys/time.h may both be included
configure:1658: gcc -c -g -O2 conftest.c 1>&5
configure:1679: checking whether struct tm is in sys/time.h or time.h
configure:1692: gcc -c -g -O2 conftest.c 1>&5
configure:1716: checking for select
configure:1744: gcc -o conftest -g -O2 conftest.c -lstdc++ -lgen -lsocket -lnsl -lm 1>&5
configure:1716: checking for socket
configure:1744: gcc -o conftest -g -O2 conftest.c -lstdc++ -lgen -lsocket -lnsl -lm 1>&5
configure:1716: checking for strstr
configure:1744: gcc -o conftest -g -O2 conftest.c -lstdc++ -lgen -lsocket -lnsl -lm 1>&5
configure:1716: checking for lockf
configure:1744: gcc -o conftest -g -O2 conftest.c -lstdc++ -lgen -lsocket -lnsl -lm 1>&5
configure:1716: checking for flock
configure:1744: gcc -o conftest -g -O2 conftest.c -lstdc++ -lgen -lsocket -lnsl -lm 1>&5
/var/tmp/ccEZaiYq1.o: In function `main':
/var/tmp/ccEZaiYq1.o(.text+0x4): undefined reference to `flock'
collect2: ld returned 1 exit status
configure: failed program was:
#line 1721 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char flock(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char flock();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_flock) || defined (__stub___flock)
choke me
#else
flock();
#endif
; return 0; }
configure:1716: checking for strftime
configure:1744: gcc -o conftest -g -O2 conftest.c -lstdc++ -lgen -lsocket -lnsl -lm 1>&5
configure:1772: checking for sendmail
configure:1808: checking for sendmail

View File

@ -2,9 +2,9 @@
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
# on host jill:
# on host localhost.localdomain:
#
# ./configure
# configure
#
# Compiler output produced by configure, useful for debugging
# configure, is in ./config.log if it exists.
@ -14,8 +14,8 @@ for ac_option
do
case "$ac_option" in
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
echo "running ${CONFIG_SHELL-/bin/sh} ./configure --no-create --no-recursion"
exec ${CONFIG_SHELL-/bin/sh} ./configure --no-create --no-recursion ;;
echo "running ${CONFIG_SHELL-/bin/sh} configure --no-create --no-recursion"
exec ${CONFIG_SHELL-/bin/sh} configure --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
echo "./config.status generated by autoconf version 2.13"
exit 0 ;;
@ -39,9 +39,9 @@ s%@CFLAGS@%-g -O2%g
s%@CPPFLAGS@%%g
s%@CXXFLAGS@%%g
s%@FFLAGS@%%g
s%@DEFS@% -DHAVE_LIBM=1 -DHAVE_LIBNSL=1 -DHAVE_LIBSOCKET=1 -DHAVE_LIBGEN=1 -DHAVE_STRFIND=1 -DHAVE_LIBSTDC__=1 -DHAVE_DIRENT_H=1 -DSTDC_HEADERS=1 -DHAVE_FCNTL_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_SELECT_H=1 -DHAVE_SYS_STATVFS_H=1 -DHAVE_SYS_SWAP_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_SELECT=1 -DHAVE_SOCKET=1 -DHAVE_STRSTR=1 -DHAVE_LOCKF=1 -DHAVE_STRFTIME=1 -DHAVE_LIB_SENDMAIL=1 %g
s%@DEFS@% -DHAVE_LIBM=1 -DHAVE_LIBNSL=1 -DHAVE_LIBSTDC__=1 -DHAVE_DIRENT_H=1 -DSTDC_HEADERS=1 -DHAVE_FCNTL_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_SELECT_H=1 -DHAVE_SYS_STATVFS_H=1 -DHAVE_SYS_SWAP_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_SELECT=1 -DHAVE_SOCKET=1 -DHAVE_STRSTR=1 -DHAVE_LOCKF=1 -DHAVE_FLOCK=1 -DHAVE_STRFTIME=1 -DHAVE_SBIN_SENDMAIL=1 -DHAVE_LIB_SENDMAIL=1 %g
s%@LDFLAGS@%%g
s%@LIBS@%-lstdc++ -lgen -lsocket -lnsl -lm %g
s%@LIBS@%-lstdc++ -lnsl -lm %g
s%@exec_prefix@%${prefix}%g
s%@prefix@%/usr/local%g
s%@program_transform_name@%s,x,x,%g
@ -57,25 +57,25 @@ s%@includedir@%${prefix}/include%g
s%@oldincludedir@%/usr/include%g
s%@infodir@%${prefix}/info%g
s%@mandir@%${prefix}/man%g
s%@host@%sparc-sun-solaris2.7%g
s%@host_alias@%sparc-sun-solaris2.7%g
s%@host_cpu@%sparc%g
s%@host_vendor@%sun%g
s%@host_os@%solaris2.7%g
s%@target@%sparc-sun-solaris2.7%g
s%@target_alias@%sparc-sun-solaris2.7%g
s%@target_cpu@%sparc%g
s%@target_vendor@%sun%g
s%@target_os@%solaris2.7%g
s%@build@%sparc-sun-solaris2.7%g
s%@build_alias@%sparc-sun-solaris2.7%g
s%@build_cpu@%sparc%g
s%@build_vendor@%sun%g
s%@build_os@%solaris2.7%g
s%@host@%i686-pc-linux-gnu%g
s%@host_alias@%i686-pc-linux-gnu%g
s%@host_cpu@%i686%g
s%@host_vendor@%pc%g
s%@host_os@%linux-gnu%g
s%@target@%i686-pc-linux-gnu%g
s%@target_alias@%i686-pc-linux-gnu%g
s%@target_cpu@%i686%g
s%@target_vendor@%pc%g
s%@target_os@%linux-gnu%g
s%@build@%i686-pc-linux-gnu%g
s%@build_alias@%i686-pc-linux-gnu%g
s%@build_cpu@%i686%g
s%@build_vendor@%pc%g
s%@build_os@%linux-gnu%g
s%@CC@%gcc%g
s%@CPP@%gcc -E%g
s%@RANLIB@%ranlib%g
s%@HAVE_SBIN_SENDMAIL@%0%g
s%@HAVE_SBIN_SENDMAIL@%/usr/sbin/sendmail%g
s%@HAVE_LIB_SENDMAIL@%/usr/lib/sendmail%g
CEOF

View File

@ -6,115 +6,32 @@ configure:642: checking whether the C compiler (gcc ) works
configure:658: gcc -o conftest conftest.c 1>&5
configure:684: checking whether the C compiler (gcc ) is a cross-compiler
configure:689: checking whether we are using GNU C
configure:698: gcc -E conftest.c
configure:717: checking whether gcc accepts -g
configure:749: checking whether make sets ${MAKE}
configure:777: checking for main in -lgen
configure:792: gcc -o conftest -g -O2 conftest.c -lgen 1>&5
configure:820: checking for main in -lm
configure:835: gcc -o conftest -g -O2 conftest.c -lm -lgen 1>&5
configure:863: checking for main in -lnsl
configure:878: gcc -o conftest -g -O2 conftest.c -lnsl -lm -lgen 1>&5
configure:906: checking for main in -lsocket
configure:921: gcc -o conftest -g -O2 conftest.c -lsocket -lnsl -lm -lgen 1>&5
configure:949: checking for main in -lstdc
configure:964: gcc -o conftest -g -O2 conftest.c -lstdc -lsocket -lnsl -lm -lgen 1>&5
ld: fatal: library -lstdc: not found
ld: fatal: File processing errors. No output written to conftest
collect2: ld returned 1 exit status
configure: failed program was:
#line 957 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
configure:992: checking for main in -lz
configure:1007: gcc -o conftest -g -O2 conftest.c -lz -lsocket -lnsl -lm -lgen 1>&5
configure:1040: checking for dirent.h that defines DIR
configure:1053: gcc -c -g -O2 conftest.c 1>&5
configure:1078: checking for opendir in -ldir
configure:1097: gcc -o conftest -g -O2 conftest.c -ldir -lz -lsocket -lnsl -lm -lgen 1>&5
ld: fatal: library -ldir: not found
ld: fatal: File processing errors. No output written to conftest
collect2: ld returned 1 exit status
configure: failed program was:
#line 1086 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char opendir();
int main() {
opendir()
; return 0; }
configure:1161: checking how to run the C preprocessor
configure:1182: gcc -E conftest.c >/dev/null 2>conftest.out
configure:1241: checking for ANSI C header files
configure:1254: gcc -E conftest.c >/dev/null 2>conftest.out
configure:1321: gcc -o conftest -g -O2 conftest.c -lz -lsocket -lnsl -lm -lgen 1>&5
configure:1345: checking for sys/wait.h that is POSIX.1 compatible
configure:1366: gcc -c -g -O2 conftest.c 1>&5
configure:1390: checking for fcntl.h
configure:1400: gcc -E conftest.c >/dev/null 2>conftest.out
configure:1390: checking for strings.h
configure:1400: gcc -E conftest.c >/dev/null 2>conftest.out
configure:1390: checking for sys/time.h
configure:1400: gcc -E conftest.c >/dev/null 2>conftest.out
configure:1390: checking for unistd.h
configure:1400: gcc -E conftest.c >/dev/null 2>conftest.out
configure:1428: checking for working const
configure:1482: gcc -c -g -O2 conftest.c 1>&5
configure:1503: checking whether time.h and sys/time.h may both be included
configure:1517: gcc -c -g -O2 conftest.c 1>&5
configure:1540: checking whether gcc needs -traditional
configure:1586: checking for vprintf
configure:1614: gcc -o conftest -g -O2 conftest.c -lz -lsocket -lnsl -lm -lgen 1>&5
configure:1691: checking for wait3 that fills in rusage
configure:1730: gcc -o conftest -g -O2 conftest.c -lz -lsocket -lnsl -lm -lgen 1>&5
configure: failed program was:
#line 1699 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <stdio.h>
/* HP-UX has wait3 but does not fill in rusage at all. */
main() {
struct rusage r;
int i;
/* Use a field that we can force nonzero --
voluntary context switches.
For systems like NeXT and OSF/1 that don't set it,
also use the system CPU time. And page faults (I/O) for Linux. */
r.ru_nvcsw = 0;
r.ru_stime.tv_sec = 0;
r.ru_stime.tv_usec = 0;
r.ru_majflt = r.ru_minflt = 0;
switch (fork()) {
case 0: /* Child. */
sleep(1); /* Give up the CPU. */
_exit(0);
case -1: _exit(0); /* What can we do? */
default: /* Parent. */
wait3(&i, 0, &r);
sleep(2); /* Avoid "text file busy" from rm on fast HP-UX machines. */
exit(r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0
&& r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
}
}
configure:1755: checking for gethostname
configure:1783: gcc -o conftest -g -O2 conftest.c -lz -lsocket -lnsl -lm -lgen 1>&5
configure:1755: checking for gettimeofday
configure:1783: gcc -o conftest -g -O2 conftest.c -lz -lsocket -lnsl -lm -lgen 1>&5
configure:1755: checking for mkdir
configure:1783: gcc -o conftest -g -O2 conftest.c -lz -lsocket -lnsl -lm -lgen 1>&5
configure:1755: checking for select
configure:1783: gcc -o conftest -g -O2 conftest.c -lz -lsocket -lnsl -lm -lgen 1>&5
configure:1755: checking for socket
configure:1783: gcc -o conftest -g -O2 conftest.c -lz -lsocket -lnsl -lm -lgen 1>&5
configure:1755: checking for strstr
configure:1783: gcc -o conftest -g -O2 conftest.c -lz -lsocket -lnsl -lm -lgen 1>&5
configure:1755: checking for uname
configure:1783: gcc -o conftest -g -O2 conftest.c -lz -lsocket -lnsl -lm -lgen 1>&5

View File

@ -2,7 +2,7 @@
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
# on host jill:
# on host localhost.localdomain:
#
# configure
#
@ -39,9 +39,9 @@ s%@CFLAGS@%-g -O2%g
s%@CPPFLAGS@%%g
s%@CXXFLAGS@%%g
s%@FFLAGS@%%g
s%@DEFS@% -DHAVE_LIBGEN=1 -DHAVE_LIBM=1 -DHAVE_LIBNSL=1 -DHAVE_LIBSOCKET=1 -DHAVE_LIBZ=1 -DHAVE_DIRENT_H=1 -DSTDC_HEADERS=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_FCNTL_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_UNISTD_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_VPRINTF=1 -DHAVE_GETHOSTNAME=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_MKDIR=1 -DHAVE_SELECT=1 -DHAVE_SOCKET=1 -DHAVE_STRSTR=1 -DHAVE_UNAME=1 %g
s%@DEFS@% -DHAVE_LIBM=1 -DHAVE_LIBNSL=1 -DHAVE_LIBZ=1 -DHAVE_DIRENT_H=1 -DSTDC_HEADERS=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_FCNTL_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_UNISTD_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_VPRINTF=1 -DHAVE_WAIT3=1 -DHAVE_GETHOSTNAME=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_MKDIR=1 -DHAVE_SELECT=1 -DHAVE_SOCKET=1 -DHAVE_STRSTR=1 -DHAVE_UNAME=1 %g
s%@LDFLAGS@%%g
s%@LIBS@%-lz -lsocket -lnsl -lm -lgen %g
s%@LIBS@%-lz -lnsl -lm %g
s%@exec_prefix@%${prefix}%g
s%@prefix@%/usr/local%g
s%@program_transform_name@%s,x,x,%g

View File

@ -29,7 +29,7 @@
#include <stdio.h>
#define MAX_BLOB_SIZE 32767
#define MAX_BLOB_SIZE 4096
// A compilation target, i.e. a architecture/OS combination.
// Currently the core client will be given only applications

View File

@ -1,18 +1,26 @@
db_mysql.o: db_mysql.C /usr/include/stdio.h \
/usr/include/sys/feature_tests.h /usr/include/sys/isa_defs.h \
/usr/include/sys/va_list.h /usr/include/stdio_tag.h \
/usr/include/stdio_impl.h /usr/include/stdlib.h /usr/include/string.h \
mysql_util.h mysql.h /usr/include/sys/types.h \
/usr/include/sys/machtypes.h /usr/include/sys/int_types.h \
/usr/include/sys/select.h /usr/include/sys/time.h /usr/include/time.h \
/usr/include/sys/time_impl.h /usr/local/mysql/include/mysql_com.h \
db_mysql.o: db_mysql.C /usr/include/stdio.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/include/stddef.h \
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \
/usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/alloca.h /usr/include/string.h mysql_util.h mysql.h \
/usr/local/mysql/include/mysql_com.h \
/usr/local/mysql/include/mysql_version.h db.h
mysql_util.o: mysql_util.C /usr/include/stdio.h \
/usr/include/sys/feature_tests.h /usr/include/sys/isa_defs.h \
/usr/include/sys/va_list.h /usr/include/stdio_tag.h \
/usr/include/stdio_impl.h /usr/include/string.h /usr/include/stdlib.h \
mysql.h /usr/include/sys/types.h /usr/include/sys/machtypes.h \
/usr/include/sys/int_types.h /usr/include/sys/select.h \
/usr/include/sys/time.h /usr/include/time.h \
/usr/include/sys/time_impl.h /usr/local/mysql/include/mysql_com.h \
/usr/include/features.h /usr/include/sys/cdefs.h \
/usr/include/gnu/stubs.h \
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/include/stddef.h \
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/include/stdarg.h \
/usr/include/bits/types.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/bits/stdio_lim.h \
/usr/include/string.h /usr/include/stdlib.h /usr/include/sys/types.h \
/usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/alloca.h mysql.h /usr/local/mysql/include/mysql_com.h \
/usr/local/mysql/include/mysql_version.h mysql_util.h

View File

@ -17,18 +17,22 @@
<li><a href=file_access.html>Compute model: remote file access</a>
<li><a href=validation.html>Accounting and result validation</a>
<li><a href=back_end.html>Back end examples</a>
<li><a href=security.html>Security</a>
<li><a href=version.html>Versioning</a>
<li><a href=api.html>The BOINC application library</a>
<li><a href=graphics.html>Graphics</a>
<li><a href=tools.html>BOINC server-side tools</a>
<li><a href=install.html>Installing BOINC</a>
<li><a href=project_startup.html>Project startup</a>
<li><a href=dev.html>Application development</a>
</ul>
<h3>Operating a BOINC project</h3>
<ul>
<li><a href=install.html>Installing BOINC</a>
<li><a href=project_startup.html>Project startup</a>
<li><a href=database.html>The BOINC database</a>
<li><a href=sched_server.html>The BOINC scheduling server</a>
<li><a href=tools_other.html>Operational tools: applications and versions</a>
<li><a href=tools_work.html>Operational tools: work and results</a>
<li><a href=web.html>The project web site</a>
<li><a href=security.html>Security</a>
</ul>
<h3>Participating in BOINC projects</h3>
@ -44,8 +48,6 @@
<li><a href=protocol.html>The BOINC client/server protocol</a>
<li><a href=database.html>The BOINC database</a>
<li><a href=sched_policy.html>Scheduling server: policy</a>
<li><a href=sched_impl.html>Scheduling server: implementation</a>
<li><a href=sched_impl.html>Scheduling server: debugging</a>

View File

@ -16,6 +16,15 @@ by typing "configure" and "make".
Edit your Apache configuration file (httpd.conf) to
set the "boinc/sched" directory as CGI,
and to allow uploads to to the upload directory.
<p>
Add the following (with appropriate changes) to your .tcshrc
<pre>
setenv BOINC_DOWNLOAD_DIR /home/david/html/download
setenv BOINC_UPLOAD_DIR /home/david/html/upload
setenv BOINC_PLATFORM i686-pc-linux-gnu
setenv BOINC_EMAIL david@localhost.localdomain
setenv BOINC_URL_BASE http://localhost.localdomain/download
</pre>
<p>
Go into the boinc/test directory, and type

View File

@ -4,7 +4,6 @@
Berkeley Open Infrastructure for Distributed Computing (BOINC)
is a software platform for public-participation
distributed computing projects like distributed.net and SETI@home.
BOINC is distributed under the Mozilla license.
BOINC supports applications that can be divided into large parallel parts
with few data dependencies;
it is not intended for fine-grained parallel applications.
@ -25,10 +24,9 @@ and it allows participant hosts to do large data transfers unobtrusively.
<li> BOINC supports applications with extreme requirements for
memory or other resources.
Work units are dispatched only to hosts able to handle them.
Work is dispatched only to hosts able to handle it.
<li> BOINC applications can be developed in any language
(C++, Fortran, Perl).
<li> BOINC applications can be developed in any language (C++, Fortran, Perl).
An application can consist of several files
(e.g. several programs and a coordinating script).
New versions of applications can be released without participant download.
@ -36,6 +34,8 @@ Separate alpha, beta, and production versions
are distributed to the appropriate set of hosts.
<li> The BOINC core client can run on almost any platform
(Mac, Windows, Linux and other Unix-type systems).
(Mac, Windows, Linux and other Unix systems).
<li> BOINC is distributed under the Mozilla license.
</ul>

View File

@ -1,97 +0,0 @@
<h2>BOINC operational tools</h2>
<p>
BOINC provides various tools for creating and operating projects.
These tools are accessed in several ways:
<ul>
<li> Via a web interface.
These scripts are in the html_ops directory.
They are accessable only by users with the "manager" rights.
<li> Application programs.
These can be invoked from scripting languages.
<li> C++ functions.
</ul>
<hr>
The C++ library (backend_lib.C,h) provides the following function:
<pre>
int create_work(
int appid,
char* wu_name,
char* wu_template,
char* result_template,
int nresults,
char* infile_dir,
char** infiles,
int ninfiles
);
</pre>
<p>
This creates a workunit and one or more results.
<p>
"appid" is the database ID of the application.
<p>
"wu_name" is the name of the workunit.
<p>
"wu_name" is the filename of a template for the
workunit XML document.
This template is macro-substituted as follows:
<ul>
<li> INFILE_n is replaced with the name of the nth input file.
<li> MD5_n is replaced with the MD5 checksum of the nth input file.
<li> WU_NAME is replaced with the workunit name.
</ul>
<p>
"result_template" is the filename of a template for the
result XML document.
This template is macro-substituted as follows:
<ul>
<li> OUTFILE_n is replaced with a string of the form
"wuname_resultnum_n" where wuname is the workunit name and
resultnum is the ordinal number of the result (0, 1, ...).
<li> WU_NAME is replaced with the workunit name.
<li> RESULT_NAME is replaced with a string of the form "wuname_resultnum".
</ul>
<p>
"nresults" is the number of results to be created.
<p>
"infile_dir" is the path of the directory where the input files are.
<p>
"infiles" is an array of names of the input files,
of length "ninfiles".
<hr>
The program
<pre>
create_work -appname file -wu_name file -wu_template file -result_template file -nresults n infile1 infile2 ...
</pre>
is a command-line equivalent of the create_work() function.
<p>
The program "add" performs various types of initialization:
<dl>
<dt>
add app name
<dd>
Create an application record.
<dt>
add platform name
<dd>
Create a platform record
<dt>
add app_version app-name platform-name version-num exec-dir exec-filename
<dd>
Create an app_version record.
<dt>
add user email_addr name web_password authenticator
<dd>
Create a user record.
<dt>
add prefs email_addr file
<dd>
Create a preference set, and make it the default
preferences for the given user.
</dl>

49
doc/tools_other.html Normal file
View File

@ -0,0 +1,49 @@
<h2>Operational tools: applications and versions</h2>
<p>
BOINC provides a few tools for creating and operating projects:
<ul>
<li> Utility programs (such as <b>add</b> and <b>create_work</b>).
These can be run manually or invoked from scripts.
<li> C++ functions (such as <b>create_work()</b>).
<li> Web interfaces (currently these provide only read access).
</ul>
Projects can create their own tools, either at a low
level (e.g. directly accessing the BOINC DB from PHP or Perl scripts)
or by using the BOINC DB C++ API (db/db.h).
<h3>The Add utility program</h3>
<p>
The program <b>add</b> performs various types of initialization:
<dl>
<dt>
add app -app_name name
<dd>
Create a new application (just creates a DB record).
<dt>
add platform name -platform_name name
<dd>
Create a platform record (just creates a DB record);
<dt>
add app_version -app_name x -platform_name y -version a -exec_dir b -exec_file c -download_dir d -url_base e
<dd>
Create an app_version record.
Copy the executable file from the compilation directory
(-exec_dir) to the download directory.
Compute its MD5 checksum, fill in the DB record.
<dt>
add user -email_addr x -name y -web_password z -authenticator a
<dd>
Create a user record.
<dt>
add prefs -email_addr x -prefs_file y
<dd>
Create a preference set, and make it the default
preferences for the given user.
</dl>
<h3>Web Interfaces</h3>
<p>
The file <b>show_db.php</b> in the operational web site directory
displays the contents of the BOINC DB.

70
doc/tools_work.html Normal file
View File

@ -0,0 +1,70 @@
<h2>Operational tools: work and results</h2>
<p>
Workunits and results can be created using either
a utility program or a C++ function.
<p>
The program
<pre>
create_work
-appname name
-wu_name name
-wu_template file
-result_template file
-nresults n
infile_1 ... infile_m
</pre>
<p>
<b>-appname</b> specifies the name of the application
<p>
<b>-wu_name</b> gives the name of the workunit.
<p>
<b>-wu_template</b> gives the filename of a template for the
workunit XML document.
This template is macro-substituted as follows:
<ul>
<li> &lt;INFILE_n/> is replaced with the name of the nth input file.
<li> &lt;MD5_n/> is replaced with the MD5 checksum of the nth input file.
<li> &lt;WU_NAME/> is replaced with the workunit name.
</ul>
<p>
<b>-result_template</b> gives the filename of a template for the
result XML document.
This template is macro-substituted as follows:
<ul>
<li> &lt;OUTFILE_n> is replaced with a string of the form
"wuname_resultnum_n" where wuname is the workunit name and
resultnum is the ordinal number of the result (0, 1, ...).
<li> &lt;WU_NAME> is replaced with the workunit name.
<li> &lt;RESULT_NAME> is replaced with a string of the form "wuname_resultnum".
</ul>
<p>
<b>-nresults</b> gives the number of results to be created.
<p>
<b>infile_1 ... infile_m</b> are the names of the input files.
<hr>
<p>
The C++ library (backend_lib.C,h) provides the function:
<pre>
int create_work(
int appid,
char* wu_name,
char* wu_template,
char* result_template,
int nresults,
char* infile_dir,
char** infiles,
int ninfiles
);
</pre>
<p>
This creates a workunit and one or more results.
The arguments are the same as for the utility program,
except that the application is identified by its database ID.
<p>
"infile_dir" is the path of the directory containing the input files.
<p>
"infiles" is an array of names of the input files,
of length "ninfiles".

View File

@ -17,7 +17,7 @@ how many times it has been dispatched, how many results have
been returned, and how many failures have occurred.
</ul>
<p>
The inputs of a workunit are described by an XML document of the form
The inputs to a workunit are described by an XML document of the form
<pre>
[ &lt;file_info>...&lt;/file_info> ]
[ ... ]

View File

@ -5,7 +5,7 @@ CFLAGS = -g
CC = gcc $(CFLAGS)
PROGS = md5_test
PROGS = md5_test shmem_test synch_test
MD5_OBJS = \
md5.o \
@ -24,6 +24,12 @@ all: $(PROGS) $(MD5_OBJS)
md5_test: md5_test.o $(MD5_OBJS)
$(CC) md5_test.o $(MD5_OBJS) -o md5_test
shmem_test: shmem_test.o shmem.o
$(CC) shmem_test.o shmem.o -o shmem_test
synch_test: synch_test.o synch.o
$(CC) synch_test.o synch.o -o synch_test
clean:
rm -f *.o $(PROGS) core dependencies

View File

@ -4,7 +4,7 @@ CFLAGS = -g
CC = @CC@ $(CFLAGS)
PROGS = md5_test
PROGS = md5_test shmem_test synch_test
MD5_OBJS = \
md5.o \
@ -23,6 +23,12 @@ all: $(PROGS) $(MD5_OBJS)
md5_test: md5_test.o $(MD5_OBJS)
$(CC) md5_test.o $(MD5_OBJS) -o md5_test
shmem_test: shmem_test.o shmem.o
$(CC) shmem_test.o shmem.o -o shmem_test
synch_test: synch_test.o synch.o
$(CC) synch_test.o synch.o -o synch_test
clean:
rm -f *.o $(PROGS) core dependencies

View File

@ -12,7 +12,11 @@ int md5_file(char* path, char* output, double& nbytes) {
nbytes = 0;
f = fopen(path, "r");
if (!f) return -1;
if (!f) {
fprintf(stderr, "md5_file: can't open %s\n", path);
perror("md5_file");
return -1;
}
md5_init(&state);
while (1) {
n = fread(buf, 1, 4096, f);

68
lib/shmem.C Executable file
View File

@ -0,0 +1,68 @@
#include <stdio.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include "shmem.h"
int create_shmem(key_t key, int size, void** pp){
int id;
id = shmget(key, size, IPC_CREAT|0777);
if (id < 0) {
perror("create_shmem: shmget");
return -1;
}
return attach_shmem(key, pp);
}
int destroy_shmem(key_t key){
struct shmid_ds buf;
int id, retval;
id = shmget(key, 0, 0);
if (id < 0) return 0; // assume it doesn't exist
retval = shmctl(id, IPC_STAT, &buf);
if (retval) return -1;
if (buf.shm_nattch > 0) {
fprintf(stderr,
"destroy_shmem: can't destroy segment; %d attachments\n",
buf.shm_nattch
);
return -1;
}
retval = shmctl(id, IPC_RMID, 0);
if (retval) {
fprintf(stderr, "destroy_shmem: remove failed %d\n", retval);
return -1;
}
return 0;
}
int attach_shmem(key_t key, void** pp){
void* p;
int id;
id = shmget(key, 0, 0);
if (id < 0) {
perror("attach_shmem: shmget");
return -1;
}
p = shmat(id, 0, 0);
if ((int)p == -1) {
perror("attach_shmem: shmat");
return -1;
}
*pp = p;
return 0;
}
int detach_shmem(key_t key) {
int retval;
void* p;
retval = attach_shmem(key, &p);
if (retval) return retval;
retval = shmdt(p);
if (retval) perror("detach_shmem: shmdt");
return retval;
}

21
lib/shmem.h Executable file
View File

@ -0,0 +1,21 @@
// platform-independent interface to shared memory
#include <sys/shm.h>
// create a shared-memory segment of the given size.
//
extern int create_shmem(key_t, int size, void**);
// Destroy a shared-memory segment.
// If there are attachments to it,
// print a message in a loop until the attachments are gone
//
extern int destroy_shmem(key_t);
// attach to a shared-memory segment
//
extern int attach_shmem(key_t, void**);
// detach from a shared-mem segment
//
extern int detach_shmem(key_t);

27
lib/shmem_test.C Normal file
View File

@ -0,0 +1,27 @@
// test program for shmem functions
// -a attach and sleep
// -d destroy
// -c create
#define KEY 0xbeefcafe
#include <string.h>
#include <stdio.h>
#include <sys/wait.h>
#include "shmem.h"
main(int argc, char** argv) {
void* p;
int retval;
if (!strcmp(argv[1], "-a")) {
retval = attach_shmem(KEY, &p);
sleep(60);
} else if (!strcmp(argv[1], "-d")) {
destroy_shmem(KEY);
} else if (!strcmp(argv[1], "-c")) {
create_shmem(KEY, 100, &p);
}
}

86
lib/synch.C Normal file
View File

@ -0,0 +1,86 @@
#include <stdio.h>
#include <string.h>
#include "synch.h"
union semun {
int val;
struct semid_ds *buf;
unsigned short int *arra;
struct seminfo *__buf;
};
int create_semaphore(key_t key){
int id, retval;
semun s;
id = semget(key, 1, IPC_CREAT|IPC_EXCL|0777);
if (id < 0) {
perror("create_semaphore: semget");
return -1;
}
memset(&s, 0, sizeof(s));
s.val = 1;
retval = semctl(id, 0, SETVAL, s);
if (retval) {
perror("create_semaphore: semctl");
return -1;
}
return 0;
}
int destroy_semaphore(key_t key){
int id, retval;
id = semget(key, 0, 0);
if (id < 0) {
perror("destroy_semaphore: semget");
return -1;
}
retval = semctl(id, 1, IPC_RMID, 0);
if (retval) {
perror("destroy_semaphore: semctl");
return -1;
}
return 0;
}
int lock_semaphore(key_t key) {
struct sembuf s;
int id, retval;
id = semget(key, 0, 0);
if (id < 0) {
perror("lock_semaphore: semget");
return -1;
}
s.sem_num = 0;
s.sem_op = -1;
s.sem_flg = SEM_UNDO;
retval = semop(id, &s, 1);
if (retval) {
perror("lock_semaphore: semctl");
return -1;
}
return 0;
}
int unlock_semaphore(key_t key) {
struct sembuf s;
int id, retval;
id = semget(key, 0, 0);
if (id < 0) {
perror("unlock_semaphore: semget");
return -1;
}
s.sem_num = 0;
s.sem_op = 1;
s.sem_flg = SEM_UNDO;
retval = semop(id, &s, 1);
if (retval) {
perror("unlock_semaphore: semctl");
return -1;
}
return 0;
}

6
lib/synch.h Normal file
View File

@ -0,0 +1,6 @@
#include <sys/sem.h>
extern int create_semaphore(key_t);
extern int destroy_semaphore(key_t);
extern int lock_semaphore(key_t);
extern int unlock_semaphore(key_t);

21
lib/synch_test.C Normal file
View File

@ -0,0 +1,21 @@
// -c create semaphore
// -d destroy semaphore
// -l lock semaphore, sleep 10 secs, unlock
#include <unistd.h>
#include "synch.h"
#define KEY 0xdeadbeef
main(int argc, char** argv) {
if (!strcmp(argv[1], "-c")) {
create_semaphore(KEY);
} else if (!strcmp(argv[1], "-d")) {
destroy_semaphore(KEY);
} else if (!strcmp(argv[1], "-l")) {
lock_semaphore(KEY);
sleep(10);
unlock_semaphore(KEY);
}
}

View File

@ -1,38 +0,0 @@
# Generated automatically from Makefile.in by configure.
all: cgi
CFLAGS = -g -Wall -I ../db -I ../lib -I ../tools
CC = g++ $(CFLAGS)
CLIBS = -lz -lsocket -lnsl -lm -lgen
CGI_OBJS = \
handle_request.o \
main.o \
parse.o \
server_types.o \
../db/db_mysql.o \
../db/mysql_util.o \
../tools/process_result_template.o
MYSQL_DIR = /usr/local/mysql/lib
MYSQL_LIBS = \
-L$(MYSQL_DIR) \
-lmysqlclient -lz \
-lm $(NETLIBS)
.C.o:
$(CC) -c -o $*.o $<
.c.o:
$(CC) -c -o $*.o $<
cgi: $(CGI_OBJS)
$(CC) $(CGI_OBJS) $(MYSQL_LIBS) $(CLIBS) -o cgi
dependencies: *.C
$(CC) -M *.C > dependencies
include dependencies
clean:
rm -f cgi *.o core dependencies config.cache

View File

@ -5,15 +5,28 @@ CC = g++ $(CFLAGS)
CLIBS = @LIBS@
PROGS = cgi feeder
all: $(PROGS)
CGI_OBJS = \
handle_request.o \
main.o \
parse.o \
sched_shmem.o \
server_types.o \
../db/db_mysql.o \
../db/mysql_util.o \
../lib/shmem.o \
../tools/process_result_template.o
FEEDER_OBJS = \
feeder.o \
sched_shmem.o \
../db/db_mysql.o \
../db/mysql_util.o \
../lib/shmem.o
MYSQL_DIR = /usr/local/mysql/lib
MYSQL_LIBS = \
-L$(MYSQL_DIR) \
@ -28,10 +41,13 @@ MYSQL_LIBS = \
cgi: $(CGI_OBJS)
$(CC) $(CGI_OBJS) $(MYSQL_LIBS) $(CLIBS) -o cgi
feeder: $(FEEDER_OBJS)
$(CC) $(FEEDER_OBJS) $(MYSQL_LIBS) $(CLIBS) -o feeder
dependencies: *.C
$(CC) -M *.C > dependencies
include dependencies
clean:
rm -f cgi *.o core dependencies config.cache
rm -f $(PROGS) *.o core dependencies config.cache

View File

@ -46,14 +46,14 @@ double estimate_duration(WORKUNIT& wu, HOST& host) {
// Add the app and app_version to the reply also.
//
int add_wu_to_reply(
WORKUNIT& wu, SCHEDULER_REPLY& reply, PLATFORM& platform, DB_CACHE& db
WORKUNIT& wu, SCHEDULER_REPLY& reply, PLATFORM& platform, SCHED_SHMEM& ss
) {
APP* app;
APP_VERSION* app_version;
app = db.lookup_app(wu.appid);
app = ss.lookup_app(wu.appid);
if (!app) return -1;
app_version = db.lookup_app_version(app->id, platform.id, app->prod_vers);
app_version = ss.lookup_app_version(app->id, platform.id, app->prod_vers);
if (!app_version) return -1;
// add the app, app_version, and workunit to the reply,
@ -248,22 +248,28 @@ int handle_results(
return 0;
}
// KLUDGE - query database for WUs.
// this must replaced for efficiency.
//
int send_work(
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform,
HOST& host, DB_CACHE& db
HOST& host, SCHED_SHMEM& ss
) {
int retval, nresults = 0;
int i, retval, nresults = 0;
WORKUNIT wu;
RESULT result;
#if 0
APP* app;
char prefix [256];
#endif
while (!db_result_enum_to_send(result, 1)) {
db_workunit(result.workunitid, wu);
retval = add_wu_to_reply(wu, reply, platform, db);
for (i=0; i<ss.nwu_results; i++) {
// the following should be a critical section
//
if (!ss.wu_results[i].present) continue;
wu = ss.wu_results[i].workunit;
result = ss.wu_results[i].result;
ss.wu_results[i].present = false;
retval = add_wu_to_reply(wu, reply, platform, ss);
if (retval) continue;
reply.insert_result(result);
nresults++;
@ -277,6 +283,7 @@ int send_work(
db_workunit_update(wu);
}
#if 0
while (!db_workunit_enum_dynamic_to_send(wu, 1)) {
retval = add_wu_to_reply(wu, reply, platform, db);
if (retval) continue;
@ -306,6 +313,7 @@ int send_work(
reply.insert_result(result);
nresults++;
}
#endif
if (nresults == 0) {
strcpy(reply.message, "no work available");
@ -316,7 +324,7 @@ int send_work(
}
void process_request(
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, DB_CACHE& db
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, SCHED_SHMEM& ss
) {
HOST host;
USER user;
@ -332,7 +340,7 @@ void process_request(
// look up the client's platform in the DB
// the following should be replaced with in-memory equivalents
//
platform = db.lookup_platform(sreq.platform_name);
platform = ss.lookup_platform(sreq.platform_name);
if (!platform) {
sprintf(buf, "platform %s not found", sreq.platform_name);
strcpy(reply.message, buf);
@ -344,17 +352,17 @@ void process_request(
handle_results(sreq, reply, host);
send_work(sreq, reply, *platform, host, db);
send_work(sreq, reply, *platform, host, ss);
}
void handle_request(FILE* fin, FILE* fout, DB_CACHE& db) {
void handle_request(FILE* fin, FILE* fout, SCHED_SHMEM& ss) {
SCHEDULER_REQUEST sreq;
SCHEDULER_REPLY sreply;
memset(&sreq, 0, sizeof(sreq));
sreq.parse(fin);
process_request(sreq, sreply, db);
process_request(sreq, sreply, ss);
sreply.write(fout);
}

View File

@ -19,6 +19,7 @@
#include <stdio.h>
#include "sched_shmem.h"
#include "server_types.h"
extern void handle_request(FILE* fin, FILE* fout, DB_CACHE&);
extern void handle_request(FILE* fin, FILE* fout, SCHED_SHMEM&);

View File

@ -22,6 +22,7 @@
#include "db.h"
#include "parse.h"
#include "shmem.h"
#include "server_types.h"
#include "handle_request.h"
@ -44,8 +45,20 @@ int main() {
FILE* fin, *fout;
int retval, pid;
char req_path[256], reply_path[256];
DB_CACHE db;
SCHED_SHMEM* ssp;
void* p;
retval = attach_shmem(BOINC_KEY, &p);
if (retval) {
printf("can't attach shmem\n");
exit(1);
}
ssp = (SCHED_SHMEM*)p;
retval = ssp->verify();
if (retval) {
printf("shmem has wrong struct sizes - recompile\n");
exit(1);
}
pid = getpid();
sprintf(req_path, "%s%d", REQ_FILE_PREFIX, pid);
sprintf(reply_path, "%s%d", REPLY_FILE_PREFIX, pid);
@ -71,8 +84,7 @@ int main() {
if (retval) {
exit(return_error("can't open database"));
}
db.read_db();
handle_request(fin, fout, db);
handle_request(fin, fout, *ssp);
db_close();
fclose(fin);

View File

@ -47,6 +47,7 @@ int SCHEDULER_REQUEST::parse(FILE* fin) {
else if (parse_int(buf, "<hostid>", hostid)) continue;
else if (parse_int(buf, "<rpc_seqno>", rpc_seqno)) continue;
else if (parse_str(buf, "<platform_name>", platform_name)) continue;
else if (parse_int(buf, "<core_client_version>", core_client_version)) continue;
else if (parse_int(buf, "<work_req_seconds>", work_req_seconds)) continue;
else if (parse_int(buf, "<prefs_mod_time>", (int)prefs_mod_time)) {
want_prefs = true;
@ -291,6 +292,7 @@ int HOST::parse_net_stats(FILE* fin) {
return 1;
}
#if 0
DB_CACHE::DB_CACHE() {
}
@ -347,3 +349,4 @@ APP_VERSION* DB_CACHE::lookup_app_version(
}
return 0;
}
#endif

View File

@ -29,6 +29,7 @@ struct SCHEDULER_REQUEST {
char authenticator[256];
char platform_name[256];
int hostid; // zero if first RPC
int core_client_version;
int rpc_seqno;
int work_req_seconds;
bool want_prefs;
@ -65,6 +66,7 @@ struct SCHEDULER_REPLY {
void insert_result(RESULT&);
};
#if 0
// stores the DB tables that don't change much
//
class DB_CACHE {
@ -78,5 +80,6 @@ public:
APP* lookup_app(int id);
APP_VERSION* lookup_app_version(int appid, int platformid, int version);
};
#endif
#endif

View File

@ -1,17 +0,0 @@
<accounts>
<project>
<home_project/>
<domain>localhost</domain>
<scheduler_url>http://localhost/cgi-bin/boinc-cgi/cgi</scheduler_url>
<email_addr>david@localhost</email_addr>
<authenticator>3f7b90793a0175ad0bda68684e8bd136</authenticator>
<resource_share>2</resource_share>
</project>
<project>
<domain>zoot</domain>
<scheduler_url>http://zoot/cgi-bin/boinc-cgi/cgi</scheduler_url>
<email_addr>david@localhost</email_addr>
<authenticator>3f7b90793a0175ad0bda68684e8bd136</authenticator>
<resource_share>10</resource_share>
</project>
</accounts>

View File

@ -2,7 +2,7 @@
<project>
<home_project/>
<domain>localhost</domain>
<scheduler_url>http://localhost/cgi-bin/boinc-cgi/cgi</scheduler_url>
<scheduler_url>http://localhost/boinc-cgi/cgi</scheduler_url>
<email_addr>david@localhost</email_addr>
<authenticator>3f7b90793a0175ad0bda68684e8bd136</authenticator>
</project>

View File

@ -1,15 +1,15 @@
<?php
define("HOME", "home/david");
define("DOWNLOAD_DIR", "$HOME/html/download");
define("UPLOAD_DIR", "$HOME/html/upload");
define("PLATFORM_NAME", "i686-pc-linux-gnu");
//define("HOME", "home/david");
//define("DOWNLOAD_DIR", "$HOME/html/download");
//define("UPLOAD_DIR", "$HOME/html/upload");
//define("PLATFORM_NAME", "i686-pc-linux-gnu");
define("VERSION", "1");
define("CORE_CLIENT", "boinc_".VERSION."_".PLATFORM_NAME);
define("CORE_CLIENT", "boinc_".VERSION."_$BOINC_PLATFORM");
define("PROJECTS", "localhost.localdomain zoot");
// directories to empty
define("EMAIL_ADDR", "david@localhost.localdomain");
define("URL_BASE", "http://localhost.localdomain/download");
//define("EMAIL_ADDR", "david@localhost.localdomain");
//define("URL_BASE", "http://localhost.localdomain/download");
// data server URL root
include_once("../html_user/db.inc");
@ -18,9 +18,53 @@ function clear_db() {
PassThru("cd ../db; init_db");
}
$BOINC_DOWNLOAD_DIR = null;
$BOINC_UPLOAD_DIR = null;
$BOINC_PLATFORM = null;
$BOINC_EMAIL = null;
$BOINC_URL_BASE = null;
function check_env_vars() {
global $BOINC_DOWNLOAD_DIR;
global $BOINC_UPLOAD_DIR;
global $BOINC_PLATFORM;
global $BOINC_EMAIL;
global $BOINC_URL_BASE;
$bad = false;
$BOINC_DOWNLOAD_DIR = getenv("BOINC_DOWNLOAD_DIR");
if ($BOINC_DOWNLOAD_DIR == null) {
echo "Must define BOINC_DOWNLOAD_DIR\n";
$bad = true;
}
$BOINC_UPLOAD_DIR = getenv("BOINC_UPLOAD_DIR");
if ($BOINC_UPLOAD_DIR == null) {
echo "Must define BOINC_UPLOAD_DIR\n";
$bad = true;
}
$BOINC_PLATFORM = getenv("BOINC_PLATFORM");
if ($BOINC_PLATFORM == null) {
echo "Must define BOINC_PLATFORM\n";
$bad = true;
}
$BOINC_EMAIL = getenv("BOINC_EMAIL");
if ($BOINC_EMAIL == null) {
echo "Must define BOINC_EMAIL\n";
$bad = true;
}
$BOINC_URL_BASE = getenv("BOINC_URL_BASE");
if ($BOINC_URL_BASE == null) {
echo "Must define BOINC_URL_BASE\n";
$bad = true;
}
if ($bad) exit();
}
function clear_data_dirs() {
PassThru("rm -f ".DOWNLOAD_DIR."/*");
PassThru("rm -f ".UPLOAD_DIR."/*");
global $BOINC_DOWNLOAD_DIR;
global $BOINC_UPLOAD_DIR;
PassThru("rm -f $BOINC_DOWNLOAD_DIR/*");
PassThru("rm -f $BOINC_UPLOAD_DIR/*");
}
function init_client_dirs($account_file) {
@ -31,25 +75,37 @@ function init_client_dirs($account_file) {
}
function copy_to_download_dir($f) {
PassThru("cp $f ".DOWNLOAD_DIR);
global $BOINC_DOWNLOAD_DIR;
PassThru("cp $f $BOINC_DOWNLOAD_DIR");
}
function add_user() {
PassThru("../tools/add user -email_addr ".EMAIL_ADDR." -user_name David -web_password foobar -authenticator 3f7b90793a0175ad0bda68684e8bd136");
global $BOINC_EMAIL;
PassThru("../tools/add user -email_addr $BOINC_EMAIL -user_name David -web_password foobar -authenticator 3f7b90793a0175ad0bda68684e8bd136");
}
function add_prefs($file) {
PassThru("../tools/add prefs -email_addr ".EMAIL_ADDR." -prefs_file $file");
global $BOINC_EMAIL;
PassThru("../tools/add prefs -email_addr $BOINC_EMAIL -prefs_file $file");
}
function add_platform() {
PassThru("../tools/add platform -platform_name ".PLATFORM_NAME);
global $BOINC_PLATFORM;
PassThru("../tools/add platform -platform_name $BOINC_PLATFORM");
}
function add_core_client_message($message, $priority) {
global $BOINC_DOWNLOAD_DIR;
global $BOINC_UPLOAD_DIR;
global $BOINC_PLATFORM;
PassThru("../tools/add app -app_name core_client -version ".VERSION);
PassThru("../tools/add app_version -app_name core_client -platform_name ".PLATFORM_NAME." -version ".VERSION." -exec_dir ../client -exec_file ".CORE_CLIENT." -download_dir ".DOWNLOAD_DIR." -url_base ".URL_BASE." -message '$message' -message_priority '$priority'");
PassThru("cp ../client/".CORE_CLIENT." ".DOWNLOAD_DIR);
PassThru("../tools/add app_version -app_name core_client -platform_name $BOINC_PLATFORM -version ".VERSION." -exec_dir ../client -exec_file ".CORE_CLIENT." -download_dir $BOINC_DOWNLOAD_DIR -url_base $BOINC_URL_BASE -message '$message' -message_priority '$priority'");
PassThru("cp ../client/".CORE_CLIENT." $BOINC_DOWNLOAD_DIR");
}
function add_core_client() {
@ -57,9 +113,13 @@ function add_core_client() {
}
function add_app($name) {
global $BOINC_DOWNLOAD_DIR;
global $BOINC_PLATFORM;
global $BOINC_URL_BASE;
PassThru("../tools/add app -app_name $name -version ".VERSION);
PassThru("../tools/add app_version -app_name $name -platform_name ".PLATFORM_NAME." -version ".VERSION." -exec_dir ../apps -exec_file $name -download_dir ".DOWNLOAD_DIR." -url_base ".URL_BASE);
PassThru("cp ../apps/$name ".DOWNLOAD_DIR);
PassThru("../tools/add app_version -app_name $name -platform_name $BOINC_PLATFORM -version ".VERSION." -exec_dir ../apps -exec_file $name -download_dir $BOINC_DOWNLOAD_DIR -url_base $BOINC_URL_BASE");
PassThru("cp ../apps/$name $BOINC_DOWNLOAD_DIR");
}
function create_work($x) {
@ -70,8 +130,15 @@ function run_client() {
PassThru("../client/".CORE_CLIENT." -exit_when_idle");
}
// TODO: make this work
function start_feeder() {
PassThru("../sched/feeder &");
}
function compare_file($out, $correct) {
PassThru("diff ".UPLOAD_DIR."/$out $correct", $retval);
global $BOINC_UPLOAD_DIR;
PassThru("diff $BOINC_UPLOAD_DIR/$out $correct", $retval);
if ($retval) {
echo "File mismatch: $out $correct\n";
} else {

View File

@ -1,6 +1,6 @@
<scheduler_reply>
<request_delay>10</request_delay>
<error_message>no work available</error_message>
<message priority="low">no work available</message>
<result_ack>
<name>uc_wu_1</name>
</result_ack>

View File

@ -1,8 +1,9 @@
<scheduler_request>
<authenticator>3f7b90793a0175ad0bda68684e8bd136</authenticator>
<hostid>1</hostid>
<rpc_seqno>2</rpc_seqno>
<platform_name>linux-intel</platform_name>
<rpc_seqno>1</rpc_seqno>
<platform_name>i686-pc-linux-gnu</platform_name>
<core_client_version>1</core_client_version>
<work_req_seconds>1000</work_req_seconds>
<prefs_mod_time>0</prefs_mod_time>
<time_stats>
@ -11,8 +12,8 @@
<active_frac>1.000000</active_frac>
</time_stats>
<net_stats>
<bwup>44251.516532</bwup>
<bwdown>7238011.518940</bwdown>
<bwup>53220.549288</bwup>
<bwdown>6888091.886915</bwdown>
</net_stats>
<host_info>
<timezone>28800</timezone>
@ -30,7 +31,7 @@
<m_cache>131072.000000</m_cache>
<m_swap>178012160.000000</m_swap>
<d_total>22108344320.000000</d_total>
<d_free>18234867712.000000</d_free>
<d_free>18171138048.000000</d_free>
</host_info>
<result>
<name>uc_wu_1</name>
@ -42,7 +43,7 @@ APP: upper_case ending, wrote 54691 chars
</stderr_out>
<file_info>
<name>uc_wu_1_0</name>
<url>http://localhost.localdomain/upload/uc_wu_1_0</url>
<url>http://localhost/upload/uc_wu_1_0</url>
<md5_cksum>b0036fed2e472c34aae8ed05704c42e7</md5_cksum>
<nbytes>54691.000000</nbytes>
</file_info>

View File

@ -6,6 +6,7 @@
include_once("init.inc");
check_env_vars();
clear_db();
clear_data_dirs();
init_client_dirs("account1.xml");

View File

@ -129,6 +129,7 @@ int main(int argc, char** argv) {
strcpy(app.name, app_name);
retval = db_app_lookup_name(app);
if (retval) {
fprintf(stderr, "can't find app %s\n", app_name);
db_print_error("db_app_lookup_name");
goto done;
}
@ -136,6 +137,7 @@ int main(int argc, char** argv) {
strcpy(platform.name, platform_name);
retval = db_platform_lookup_name(platform);
if (retval) {
fprintf(stderr, "can't find platform %s\n", platform_name);
db_print_error("db_platform_lookup_name");
goto done;
}

View File

@ -44,8 +44,6 @@
#include "db.h"
#include "backend_lib.h"
#define INFILE_DIR "/disks/jill/a/inet_services/boinc_www/share/htdocs/download"
int main(int argc, char** argv) {
APP app;
WORKUNIT wu;
@ -55,7 +53,12 @@ int main(int argc, char** argv) {
char wu_template_file[256], result_template_file[256];
char** infiles;
int i, ninfiles, nresults;
char* boinc_download_dir = getenv("BOINC_DOWNLOAD_DIR");
if (!boinc_download_dir) {
printf("must define BOINC_DOWNLOAD_DIR");
exit(1);
}
if( db_open("boinc") ) {
printf( "Error opening database.\n" );
exit(0);
@ -131,7 +134,7 @@ int main(int argc, char** argv) {
wu_template,
result_template,
nresults,
INFILE_DIR,
boinc_download_dir,
infiles,
ninfiles
);