diff --git a/sched/Makefile.am b/sched/Makefile.am index 8e8241632a..02b882af59 100644 --- a/sched/Makefile.am +++ b/sched/Makefile.am @@ -179,19 +179,34 @@ show_shmem_LDADD = $(SERVERLIBS) file_deleter_SOURCES = file_deleter.cpp file_deleter_LDADD = $(SERVERLIBS) -sample_bitwise_validator_SOURCES = validator.cpp sample_bitwise_validator.cpp validate_util.cpp validate_util.h validate_util2.cpp +VALIDATOR_SOURCES = \ + credit.cpp \ + validator.cpp \ + validate_util.cpp \ + validate_util2.cpp + +sample_bitwise_validator_SOURCES = $(VALIDATOR_SOURCES) \ + sample_bitwise_validator.cpp sample_bitwise_validator_LDADD = $(SERVERLIBS) -sample_trivial_validator_SOURCES = validator.cpp sample_trivial_validator.cpp validate_util.cpp validate_util.h validate_util2.cpp +sample_trivial_validator_SOURCES = $(VALIDATOR_SOURCES) \ + sample_trivial_validator.cpp sample_trivial_validator_LDADD = $(SERVERLIBS) -sample_dummy_assimilator_SOURCES = assimilator.cpp sample_dummy_assimilator.cpp validate_util.cpp validate_util.h +ASSIMILATOR_SOURCES = \ + assimilator.cpp \ + validate_util.cpp + +sample_dummy_assimilator_SOURCES = $(ASSIMILATOR_SOURCES) \ + sample_dummy_assimilator.cpp sample_dummy_assimilator_LDADD = $(SERVERLIBS) -sample_assimilator_SOURCES = assimilator.cpp sample_assimilator.cpp validate_util.cpp validate_util.h +sample_assimilator_SOURCES = $(ASSIMILATOR_SOURCES) \ + sample_assimilator.cpp sample_assimilator_LDADD = $(SERVERLIBS) -single_job_assimilator_SOURCES = assimilator.cpp single_job_assimilator.cpp validate_util.cpp validate_util.h +single_job_assimilator_SOURCES = $(ASSIMILATOR_SOURCES) \ + single_job_assimilator.cpp single_job_assimilator_LDADD = $(SERVERLIBS) sample_work_generator_SOURCES = sample_work_generator.cpp diff --git a/sched/credit.h b/sched/credit.h index 92ced8f5ad..38b5b6b741 100644 --- a/sched/credit.h +++ b/sched/credit.h @@ -30,5 +30,5 @@ extern int update_credit_per_cpu_sec( double credit, double cpu_time, double& credit_per_cpu_sec ); extern int grant_credit( - HOST& host, double start_time, double cpu_time, double credit + DB_HOST& host, double start_time, double cpu_time, double credit ); diff --git a/sched/validator.cpp b/sched/validator.cpp index 98f7b55736..d2e124b31f 100644 --- a/sched/validator.cpp +++ b/sched/validator.cpp @@ -46,6 +46,7 @@ #include "str_util.h" #include "error_numbers.h" +#include "credit.h" #include "sched_config.h" #include "sched_util.h" #include "sched_msgs.h" @@ -150,18 +151,18 @@ int is_valid(RESULT& result, WORKUNIT& wu) { ); if (update_credited_job) { - credited_job.userid = user.id; + credited_job.userid = host.userid; credited_job.workunitid = long(wu.opaque); retval = credited_job.insert(); if (retval) { log_messages.printf(MSG_CRITICAL, "[RESULT#%d] Warning: credited_job insert failed (userid: %d workunit: %f err: %d)\n", - result.id, user.id, wu.opaque, retval + result.id, host.userid, wu.opaque, retval ); } else { log_messages.printf(MSG_DEBUG, "[RESULT#%d %s] added credited_job record [WU#%d OPAQUE#%f USER#%d]\n", - result.id, result.name, wu.id, wu.opaque, user.id + result.id, result.name, wu.id, wu.opaque, host.userid ); } }