diff options
Diffstat (limited to 'src/solvers/h48')
| -rw-r--r-- | src/solvers/h48/gendata_h48.h | 67 |
1 files changed, 2 insertions, 65 deletions
diff --git a/src/solvers/h48/gendata_h48.h b/src/solvers/h48/gendata_h48.h index 0ff8df5..68484f1 100644 --- a/src/solvers/h48/gendata_h48.h +++ b/src/solvers/h48/gendata_h48.h | |||
| @@ -657,77 +657,14 @@ gendata_h48k2_dfs_stop(cube_t cube, int8_t depth, h48k2_dfs_arg_t *arg) | |||
| 657 | STATIC size_t | 657 | STATIC size_t |
| 658 | gendata_h48k2_realcoord(gendata_h48_arg_t *arg) | 658 | gendata_h48k2_realcoord(gendata_h48_arg_t *arg) |
| 659 | { | 659 | { |
| 660 | #if 1 | 660 | /* TODO */ |
| 661 | return gendata_h48k2(arg); | 661 | return gendata_h48k2(arg); |
| 662 | #else | ||
| 663 | uint8_t t, selectedbase, *table; | ||
| 664 | uint64_t i, ii, count; | ||
| 665 | int64_t j; | ||
| 666 | h48k2_dfs_arg_t dfsarg[THREADS]; | ||
| 667 | pthread_t thread[THREADS]; | ||
| 668 | pthread_mutex_t count_mutex, table_mutex[CHUNKS]; | ||
| 669 | |||
| 670 | if (arg->buf == NULL) | ||
| 671 | goto gendata_h48k2_realcoord_return_size; | ||
| 672 | |||
| 673 | table = (uint8_t *)arg->h48buf + INFOSIZE; | ||
| 674 | if (arg->buf != NULL) | ||
| 675 | memset(table, 0xFF, H48_TABLESIZE(arg->h, arg->k)); | ||
| 676 | |||
| 677 | selectedbase = arg->base < 20 ? arg->base : (arg->h == 0 ? 8 : 10); | ||
| 678 | arg->info = makeinfo_h48k2(arg, selectedbase); | ||
| 679 | |||
| 680 | count = 0; | ||
| 681 | for (i = 0; i < CHUNKS; i++) | ||
| 682 | pthread_mutex_init(&table_mutex[i], NULL); | ||
| 683 | |||
| 684 | /* TODO | ||
| 685 | for (i = 0; i < THREADS; i++) { | ||
| 686 | dfsarg[i] = (h48k2_dfs_arg_t){ | ||
| 687 | .h = arg->h, | ||
| 688 | .k = arg->k, | ||
| 689 | .base = selectedbase, | ||
| 690 | .cocsepdata = arg->cocsepdata, | ||
| 691 | .table = table, | ||
| 692 | .selfsim = arg->selfsim, | ||
| 693 | .crep = arg->crep, | ||
| 694 | .shortcubes_mutex = &count_mutex, | ||
| 695 | .count = &count, | ||
| 696 | }; | ||
| 697 | for (ii = 0; ii < CHUNKS; ii++) | ||
| 698 | dfsarg[i].table_mutex[ii] = &table_mutex[ii]; | ||
| 699 | |||
| 700 | pthread_create(&thread[i], NULL, | ||
| 701 | gendata_h48k2_realcoord_runthread, &dfsarg[i]); | ||
| 702 | } | ||
| 703 | |||
| 704 | for (i = 0; i < THREADS; i++) | ||
| 705 | pthread_join(thread[i], NULL); | ||
| 706 | */ | ||
| 707 | |||
| 708 | /* TODO: inline into mark */ | ||
| 709 | for (j = 0; j < H48_COORDMAX(arg->h); j++) { | ||
| 710 | t = get_h48_pval(table, j, 2); | ||
| 711 | arg->info.distribution[t]++; | ||
| 712 | } | ||
| 713 | |||
| 714 | writetableinfo(&arg->info, arg->h48buf); | ||
| 715 | |||
| 716 | gendata_h48k2_realcoord_return_size: | ||
| 717 | return H48_TABLESIZE(arg->h, 2) + INFOSIZE; | ||
| 718 | #endif | ||
| 719 | } | 662 | } |
| 720 | 663 | ||
| 721 | STATIC void * | 664 | STATIC void * |
| 722 | gendata_h48k2_realcoord_runthread(void *arg) | 665 | gendata_h48k2_realcoord_runthread(void *arg) |
| 723 | { | 666 | { |
| 724 | /* TODO | 667 | /* TODO */ |
| 725 | uint64_t count, coord, mutex; | ||
| 726 | h48k2_dfs_arg_t *dfsarg; | ||
| 727 | |||
| 728 | dfsarg = (h48k2_dfs_arg_t *)arg; | ||
| 729 | |||
| 730 | */ | ||
| 731 | return NULL; | 668 | return NULL; |
| 732 | } | 669 | } |
| 733 | 670 | ||
