should be it

This commit is contained in:
2025-10-24 19:21:19 -05:00
parent a4b23fc57c
commit f09560c7b1
14047 changed files with 3161551 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
#include "skip_days.h"
#include "date.h"
#include "constants.h"
#include "scaling.h"
#include "parallel.h"
ds_key_t skipDays(int nTable, ds_key_t *pRemainder) {
static date_t BaseDate;
ds_key_t jDate;
ds_key_t kRowCount, kFirstRow, kDayCount, index = 1;
if (!InitConstants::skipDays_init) {
strtodt(&BaseDate, DATA_START_DATE);
InitConstants::skipDays_init = 1;
*pRemainder = 0;
}
// set initial conditions
jDate = BaseDate.julian;
*pRemainder = dateScaling(nTable, jDate) + index;
// now check to see if we need to move to the
// the next piece of a parallel build
// move forward one day at a time
split_work(nTable, &kFirstRow, &kRowCount);
while (index < kFirstRow) {
kDayCount = dateScaling(nTable, jDate);
index += kDayCount;
jDate += 1;
*pRemainder = index;
}
if (index > kFirstRow) {
jDate -= 1;
}
return (jDate);
}