From d3dfa5771b89cefffc0ff51d5229793b29c42f66 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 27 Sep 2003 23:20:40 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=2370 --- Makefile.in | 1 + api/Makefile.in | 1 + api/boinc_api.C | 4 +-- apps/Makefile.in | 1 + checkin_notes | 9 +++++ client/Makefile.in | 1 + configure | 2 +- db/Makefile.in | 1 + db/boinc_db.h | 6 ++-- db/db_base.h | 2 +- lib/Makefile.in | 1 + py/Boinc/Makefile.in | 1 + py/Makefile.in | 1 + sched/Makefile.am | 5 ++- sched/Makefile.in | 23 ++++++++++--- sched/wu_check.C | 81 ++++++++++++++++++++++++++++++++++++++++++++ test/Makefile.in | 1 + tools/Makefile.in | 1 + 18 files changed, 129 insertions(+), 13 deletions(-) create mode 100644 sched/wu_check.C diff --git a/Makefile.in b/Makefile.in index 103023689e..4c027740f0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -53,6 +53,7 @@ CLIENT_BIN_FILENAME = @CLIENT_BIN_FILENAME@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ +CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ diff --git a/api/Makefile.in b/api/Makefile.in index 1f7d6337f7..af82428793 100644 --- a/api/Makefile.in +++ b/api/Makefile.in @@ -55,6 +55,7 @@ CLIENT_BIN_FILENAME = @CLIENT_BIN_FILENAME@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ +CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ diff --git a/api/boinc_api.C b/api/boinc_api.C index 0aab01394d..777d772117 100644 --- a/api/boinc_api.C +++ b/api/boinc_api.C @@ -109,8 +109,8 @@ int boinc_init(bool standalone_ /* = false */) { if (!f) { if (standalone) { safe_strncpy(aid.app_preferences, "", sizeof(aid.app_preferences)); - safe_strncpy(aid.user_name, "John Smith", sizeof(aid.user_name)); - safe_strncpy(aid.team_name, "The A-Team", sizeof(aid.team_name)); + safe_strncpy(aid.user_name, "Unknown user", sizeof(aid.user_name)); + safe_strncpy(aid.team_name, "Unknown team", sizeof(aid.team_name)); aid.wu_cpu_time = 1000; aid.user_total_credit = 1000; aid.user_expavg_credit = 500; diff --git a/apps/Makefile.in b/apps/Makefile.in index ac7df22141..4c18155290 100644 --- a/apps/Makefile.in +++ b/apps/Makefile.in @@ -55,6 +55,7 @@ CLIENT_BIN_FILENAME = @CLIENT_BIN_FILENAME@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ +CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ diff --git a/checkin_notes b/checkin_notes index d78ed2ec9b..a3ac9c1bf7 100755 --- a/checkin_notes +++ b/checkin_notes @@ -6390,3 +6390,12 @@ David Sept 27 2003 app.C lib/ app_ipc.C,h + +David Sept 27 2003 + - added a program "wu_check" that sees whether input files + of unsent or in-progress results are actually on disk + + sched/ + Makefile.am + wu_check.C (new) + diff --git a/client/Makefile.in b/client/Makefile.in index 58fe1eacfe..8c3eb0bd0d 100644 --- a/client/Makefile.in +++ b/client/Makefile.in @@ -55,6 +55,7 @@ CLIENT_BIN_FILENAME = @CLIENT_BIN_FILENAME@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ +CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ diff --git a/configure b/configure index 1cc29b0d73..cac952fd61 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Revision: 1.45 . +# From configure.ac Revision: 1.46 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for BOINC 2.03. # diff --git a/db/Makefile.in b/db/Makefile.in index 3abbb4c0e6..9b966166a9 100644 --- a/db/Makefile.in +++ b/db/Makefile.in @@ -53,6 +53,7 @@ CLIENT_BIN_FILENAME = @CLIENT_BIN_FILENAME@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ +CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ diff --git a/db/boinc_db.h b/db/boinc_db.h index 4d48bbc050..a374802b71 100755 --- a/db/boinc_db.h +++ b/db/boinc_db.h @@ -313,9 +313,9 @@ struct WORKUNIT { void clear(); }; -// WARNING: be Very careful about changing any states, especially for a -// project already running - these values are entered into the database and -// must stay consistent. +// WARNING: be Very careful about changing any values, +// especially for a project already running - +// the database will become inconsistent #define RESULT_SERVER_STATE_INACTIVE 1 #define RESULT_SERVER_STATE_UNSENT 2 diff --git a/db/db_base.h b/db/db_base.h index 857020edc4..8f182168f1 100644 --- a/db/db_base.h +++ b/db/db_base.h @@ -29,7 +29,7 @@ struct CURSOR { // represents a connection to a database // -class DB_CONN{ +class DB_CONN { public: DB_CONN(); int open(char* name, char* passwd); diff --git a/lib/Makefile.in b/lib/Makefile.in index 52660a729a..3718a364e9 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -55,6 +55,7 @@ CLIENT_BIN_FILENAME = @CLIENT_BIN_FILENAME@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ +CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ diff --git a/py/Boinc/Makefile.in b/py/Boinc/Makefile.in index 5c4df72d52..cad64fe62c 100644 --- a/py/Boinc/Makefile.in +++ b/py/Boinc/Makefile.in @@ -55,6 +55,7 @@ CLIENT_BIN_FILENAME = @CLIENT_BIN_FILENAME@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ +CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ diff --git a/py/Makefile.in b/py/Makefile.in index 7c74580c8f..36cb119365 100644 --- a/py/Makefile.in +++ b/py/Makefile.in @@ -53,6 +53,7 @@ CLIENT_BIN_FILENAME = @CLIENT_BIN_FILENAME@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ +CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ diff --git a/sched/Makefile.am b/sched/Makefile.am index c8f400915d..2e521de3d6 100644 --- a/sched/Makefile.am +++ b/sched/Makefile.am @@ -5,7 +5,7 @@ include $(top_srcdir)/Makefile.incl noinst_PROGRAMS = \ cgi feeder show_shmem file_upload_handler \ validate_test validate_trivial make_work transitioner file_deleter \ - assimilator db_dump update_stats show_shmem + assimilator db_dump update_stats show_shmem wu_check noinst_LIBRARIES = libsched.a @@ -52,6 +52,9 @@ cgi_DEPEDENCIES = $(LIB_SCHED) feeder_SOURCES = feeder.C feeder_DEPENDENCIES = $(LIB_SCHED) +wu_check_SOURCES = wu_check.C +wu_check_DEPENDENCIES = $(LIB_SCHED) + show_shmem_SOURCES = show_shmem.C show_shmem_DEPENDENCIES = $(LIB_SCHED) diff --git a/sched/Makefile.in b/sched/Makefile.in index ed2ab0a12e..eb6ddf21c6 100644 --- a/sched/Makefile.in +++ b/sched/Makefile.in @@ -55,6 +55,7 @@ CLIENT_BIN_FILENAME = @CLIENT_BIN_FILENAME@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ +CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -171,7 +172,7 @@ LIBRSA = $(top_builddir)/RSAEuro/source/librsaeuro.a noinst_PROGRAMS = \ cgi feeder show_shmem file_upload_handler \ validate_test validate_trivial make_work transitioner file_deleter \ - assimilator db_dump update_stats show_shmem + assimilator db_dump update_stats show_shmem wu_check noinst_LIBRARIES = libsched.a @@ -221,6 +222,9 @@ cgi_DEPEDENCIES = $(LIB_SCHED) feeder_SOURCES = feeder.C feeder_DEPENDENCIES = $(LIB_SCHED) +wu_check_SOURCES = wu_check.C +wu_check_DEPENDENCIES = $(LIB_SCHED) + show_shmem_SOURCES = show_shmem.C show_shmem_DEPENDENCIES = $(LIB_SCHED) @@ -286,7 +290,7 @@ noinst_PROGRAMS = cgi$(EXEEXT) feeder$(EXEEXT) show_shmem$(EXEEXT) \ validate_trivial$(EXEEXT) make_work$(EXEEXT) \ transitioner$(EXEEXT) file_deleter$(EXEEXT) \ assimilator$(EXEEXT) db_dump$(EXEEXT) update_stats$(EXEEXT) \ - show_shmem$(EXEEXT) + show_shmem$(EXEEXT) wu_check$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) am_assimilator_OBJECTS = assimilator.$(OBJEXT) \ @@ -343,6 +347,10 @@ am_validate_trivial_OBJECTS = validate.$(OBJEXT) \ validate_trivial_OBJECTS = $(am_validate_trivial_OBJECTS) validate_trivial_LDADD = $(LDADD) validate_trivial_LDFLAGS = +am_wu_check_OBJECTS = wu_check.$(OBJEXT) +wu_check_OBJECTS = $(am_wu_check_OBJECTS) +wu_check_LDADD = $(LDADD) +wu_check_LDFLAGS = SCRIPTS = $(bin_SCRIPTS) @@ -375,7 +383,8 @@ am__depfiles_maybe = depfiles @AMDEP_TRUE@ ./$(DEPDIR)/validate.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/validate_test.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/validate_trivial.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/validate_util.Po +@AMDEP_TRUE@ ./$(DEPDIR)/validate_util.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/wu_check.Po CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) @@ -391,9 +400,9 @@ DIST_SOURCES = $(libsched_a_SOURCES) $(assimilator_SOURCES) \ $(file_upload_handler_SOURCES) $(make_work_SOURCES) \ $(show_shmem_SOURCES) $(transitioner_SOURCES) \ $(update_stats_SOURCES) $(validate_test_SOURCES) \ - $(validate_trivial_SOURCES) + $(validate_trivial_SOURCES) $(wu_check_SOURCES) DIST_COMMON = $(top_srcdir)/Makefile.incl Makefile.am Makefile.in -SOURCES = $(libsched_a_SOURCES) $(assimilator_SOURCES) $(cgi_SOURCES) $(db_dump_SOURCES) $(fcgi_SOURCES) $(feeder_SOURCES) $(file_deleter_SOURCES) $(file_upload_handler_SOURCES) $(make_work_SOURCES) $(show_shmem_SOURCES) $(transitioner_SOURCES) $(update_stats_SOURCES) $(validate_test_SOURCES) $(validate_trivial_SOURCES) +SOURCES = $(libsched_a_SOURCES) $(assimilator_SOURCES) $(cgi_SOURCES) $(db_dump_SOURCES) $(fcgi_SOURCES) $(feeder_SOURCES) $(file_deleter_SOURCES) $(file_upload_handler_SOURCES) $(make_work_SOURCES) $(show_shmem_SOURCES) $(transitioner_SOURCES) $(update_stats_SOURCES) $(validate_test_SOURCES) $(validate_trivial_SOURCES) $(wu_check_SOURCES) all: all-am @@ -471,6 +480,9 @@ validate_test$(EXEEXT): $(validate_test_OBJECTS) $(validate_test_DEPENDENCIES) validate_trivial$(EXEEXT): $(validate_trivial_OBJECTS) $(validate_trivial_DEPENDENCIES) @rm -f validate_trivial$(EXEEXT) $(CXXLINK) $(validate_trivial_LDFLAGS) $(validate_trivial_OBJECTS) $(validate_trivial_LDADD) $(LIBS) +wu_check$(EXEEXT): $(wu_check_OBJECTS) $(wu_check_DEPENDENCIES) + @rm -f wu_check$(EXEEXT) + $(CXXLINK) $(wu_check_LDFLAGS) $(wu_check_OBJECTS) $(wu_check_LDADD) $(LIBS) binSCRIPT_INSTALL = $(INSTALL_SCRIPT) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @@ -533,6 +545,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/validate_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/validate_trivial.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/validate_util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wu_check.Po@am__quote@ distclean-depend: -rm -rf ./$(DEPDIR) diff --git a/sched/wu_check.C b/sched/wu_check.C new file mode 100644 index 0000000000..28e76439f4 --- /dev/null +++ b/sched/wu_check.C @@ -0,0 +1,81 @@ +// The contents of this file are subject to the BOINC Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://boinc.berkeley.edu/license_1.0.txt +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// +// The Initial Developer of the Original Code is the SETI@home project. +// Portions created by the SETI@home project are Copyright (C) 2002 +// University of California at Berkeley. All Rights Reserved. +// +// Contributor(s): +// + +#include + +#include "parse.h" +#include "boinc_db.h" +#include "sched_config.h" + +// wu_checker +// See whether input files that should be present, are + +SCHED_CONFIG config; + +// get the path a WU's input file +// +int get_file_path(WORKUNIT& wu, char* path) { + char buf[256]; + bool flag; + flag = parse_str(wu.xml_doc, "", buf, sizeof(buf)); + if (!flag) return -1; + sprintf(path, "%s/%s", config.upload_dir, buf); + return 0; +} + +void handle_result(DB_RESULT& result) { + DB_WORKUNIT wu; + int retval; + char path[256]; + FILE* f; + + retval = wu.lookup_id(result.workunitid); + if (retval) { + printf( + "ERROR: can't find WU %d for result %d\n", + result.workunitid, result.id + ); + return; + } + get_file_path(wu, path); + f = fopen(path, "r"); + if (f) { + fclose(f); + } else { + printf("ERROR can't find file %s for result %d\n", + path, result.id + ); + } +} + +int main() { + DB_RESULT result; + char clause[256]; + + config.parse_file(); + + sprintf(clause, "where server_state=%d", RESULT_SERVER_STATE_UNSENT); + while (!result.enumerate(clause)) { + handle_result(result); + } + sprintf(clause, "where server_state=%d", RESULT_SERVER_STATE_IN_PROGRESS); + while (!result.enumerate(clause)) { + handle_result(result); + } +} diff --git a/test/Makefile.in b/test/Makefile.in index 238cc2a133..9b3b607869 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -55,6 +55,7 @@ CLIENT_BIN_FILENAME = @CLIENT_BIN_FILENAME@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ +CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ diff --git a/tools/Makefile.in b/tools/Makefile.in index dfb157bee9..6a6efbfeb2 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -55,6 +55,7 @@ CLIENT_BIN_FILENAME = @CLIENT_BIN_FILENAME@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ +CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@