h48

A prototype for an optimal Rubik's cube solver, work in progress.
git clone https://git.tronto.net/h48
Download | Log | Files | Refs | README | LICENSE

commit 47fe842ee3375ad63cc96550e345d18f3af0885b
parent 3cb66440de97a787a974eed87a5fd876b46cef92
Author: enricotenuti <tenutz_27@outlook.it>
Date:   Fri, 27 Sep 2024 15:47:03 +0200

format fix thread.h

Diffstat:
Msrc/nissy.c | 4++--
Msrc/solvers/h48/thread.h | 12++----------
2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/src/nissy.c b/src/nissy.c @@ -333,8 +333,8 @@ nissy_solve( ret = -1; } else { ret = THREADS > 1 ? - solve_h48_parent(c, minmoves, maxmoves, maxsolutions, data, solutions) : - solve_h48(c, minmoves, maxmoves, maxsolutions, data, solutions); + solve_h48_parent(c, minmoves, maxmoves, maxsolutions, data, solutions) : + solve_h48(c, minmoves, maxmoves, maxsolutions, data, solutions); } } else if (!strcmp(solver, "h48stats")) { ret = solve_h48stats(c, maxmoves, data, solutions); diff --git a/src/solvers/h48/thread.h b/src/solvers/h48/thread.h @@ -1,13 +1,8 @@ -#include <pthread.h> #include <stdatomic.h> -#include <stdbool.h> -#include <stdio.h> -#include <stdlib.h> #define MAX_QUEUE_SIZE 244 #define BFS_DEPTH 2 -typedef struct -{ +typedef struct { dfsarg_solveh48_t *tasks[MAX_QUEUE_SIZE]; int front; int rear; @@ -95,12 +90,10 @@ copy_queue(task_queue_t *src, task_queue_t *dest, int depth, int64_t *nsols) dest->front = src->front; dest->rear = src->rear; dest->tasks_count = src->tasks_count; - // atomic_init(&dest->active, &src->active); pthread_cond_broadcast(&dest->cond); pthread_mutex_unlock(&dest->mutex); } - STATIC void * start_thread(void *arg) { @@ -253,8 +246,7 @@ solve_h48_parent( tableinfo_t info; pthread_t threads[THREADS]; - if (!readtableinfo_n(data, 2, &info)) - { + if (!readtableinfo_n(data, 2, &info)){ LOG("solve_h48: error reading table\n"); return 0; }