Browse Source

Rework the last-initialised time displayed.

nfactor-troky
Con Kolivas 13 years ago
parent
commit
4e48561a13
  1. 11
      main.c
  2. 1
      miner.h

11
main.c

@ -1972,6 +1972,7 @@ retry:
gpu, cgpu->rolling, cgpu->total_mhashes / total_secs, gpu, cgpu->rolling, cgpu->total_mhashes / total_secs,
cgpu->getworks, cgpu->accepted, cgpu->rejected, cgpu->hw_errors, cgpu->getworks, cgpu->accepted, cgpu->rejected, cgpu->hw_errors,
cgpu->efficiency, cgpu->utility); cgpu->efficiency, cgpu->utility);
wlog("Last initialised: %s\n", cgpu->init);
for (i = 0; i < mining_threads; i++) { for (i = 0; i < mining_threads; i++) {
thr = &thr_info[i]; thr = &thr_info[i];
if (thr->cgpu != cgpu) if (thr->cgpu != cgpu)
@ -3384,6 +3385,7 @@ static void *reinit_gpu(void *userdata)
struct thr_info *mythr = userdata; struct thr_info *mythr = userdata;
struct cgpu_info *cgpu; struct cgpu_info *cgpu;
struct thr_info *thr; struct thr_info *thr;
struct timeval now;
char name[256]; char name[256];
int thr_id; int thr_id;
int gpu; int gpu;
@ -3446,6 +3448,9 @@ select_cgpu:
applog(LOG_WARNING, "Thread %d restarted", thr_id); applog(LOG_WARNING, "Thread %d restarted", thr_id);
} }
gettimeofday(&now, NULL);
get_datestamp(cgpu->init, &now);
gpu_devices[gpu] = true; gpu_devices[gpu] = true;
for (thr_id = 0; thr_id < gpu_threads; thr_id ++) { for (thr_id = 0; thr_id < gpu_threads; thr_id ++) {
if (dev_from_id(thr_id) != gpu) if (dev_from_id(thr_id) != gpu)
@ -4069,13 +4074,15 @@ int main (int argc, char *argv[])
/* start GPU mining threads */ /* start GPU mining threads */
for (i = 0; i < nDevs * opt_g_threads; i++) { for (i = 0; i < nDevs * opt_g_threads; i++) {
int gpu = i % nDevs; int gpu = i % nDevs;
struct cgpu_info *cgpu;
struct timeval now;
gpus[gpu].is_gpu = 1; gpus[gpu].is_gpu = 1;
gpus[gpu].cpu_gpu = gpu; gpus[gpu].cpu_gpu = gpu;
thr = &thr_info[i]; thr = &thr_info[i];
thr->id = i; thr->id = i;
thr->cgpu = &gpus[gpu]; cgpu = thr->cgpu = &gpus[gpu];
thr->q = tq_new(); thr->q = tq_new();
if (!thr->q) if (!thr->q)
@ -4098,6 +4105,8 @@ int main (int argc, char *argv[])
continue; continue;
} }
applog(LOG_INFO, "initCl() finished. Found %s", name); applog(LOG_INFO, "initCl() finished. Found %s", name);
gettimeofday(&now, NULL);
get_datestamp(cgpu->init, &now);
if (unlikely(thr_info_create(thr, NULL, gpuminer_thread, thr))) if (unlikely(thr_info_create(thr, NULL, gpuminer_thread, thr)))
quit(1, "thread %d create failed", i); quit(1, "thread %d create failed", i);

1
miner.h

@ -152,6 +152,7 @@ struct cgpu_info {
double efficiency; double efficiency;
double utility; double utility;
enum alive status; enum alive status;
char init[40];
}; };
struct thr_info { struct thr_info {

Loading…
Cancel
Save