更新RS,第一个node和最后一个node初始排列为 1~n

This commit is contained in:
YuhangQ 2023-04-28 07:43:11 +00:00
parent 5effc89c11
commit de434abbfb
5 changed files with 34 additions and 28 deletions

View File

@ -1,17 +1,17 @@
all:
$(MAKE) -C "/home/chenzh/solvers/cloud-sat/kissat-inc/build"
$(MAKE) -C "/pub/netdisk1/qianyh/Light/kissat-inc/build"
kissat:
$(MAKE) -C "/home/chenzh/solvers/cloud-sat/kissat-inc/build" kissat
$(MAKE) -C "/pub/netdisk1/qianyh/Light/kissat-inc/build" kissat
tissat:
$(MAKE) -C "/home/chenzh/solvers/cloud-sat/kissat-inc/build" tissat
$(MAKE) -C "/pub/netdisk1/qianyh/Light/kissat-inc/build" tissat
clean:
rm -f "/home/chenzh/solvers/cloud-sat/kissat-inc"/makefile
-$(MAKE) -C "/home/chenzh/solvers/cloud-sat/kissat-inc/build" clean
rm -rf "/home/chenzh/solvers/cloud-sat/kissat-inc/build"
rm -f "/pub/netdisk1/qianyh/Light/kissat-inc"/makefile
-$(MAKE) -C "/pub/netdisk1/qianyh/Light/kissat-inc/build" clean
rm -rf "/pub/netdisk1/qianyh/Light/kissat-inc/build"
coverage:
$(MAKE) -C "/home/chenzh/solvers/cloud-sat/kissat-inc/build" coverage
$(MAKE) -C "/pub/netdisk1/qianyh/Light/kissat-inc/build" coverage
indent:
$(MAKE) -C "/home/chenzh/solvers/cloud-sat/kissat-inc/build" indent
$(MAKE) -C "/pub/netdisk1/qianyh/Light/kissat-inc/build" indent
test:
$(MAKE) -C "/home/chenzh/solvers/cloud-sat/kissat-inc/build" test
$(MAKE) -C "/pub/netdisk1/qianyh/Light/kissat-inc/build" test
.PHONY: all clean coverage indent kissat test tissat

View File

@ -67,6 +67,8 @@ void kissat_init_shuffle(kissat * solver, int maxvar) {
id = (int *)malloc(sizeof(int) * (maxvar + 1));
for (int i = 1; i <= maxvar; i++)
id[i] = i;
if(seed != 0) {
for (int i = 1; i <= maxvar; i++)
{
int j = (rand_r(&seed) % maxvar) + 1;
@ -74,6 +76,7 @@ void kissat_init_shuffle(kissat * solver, int maxvar) {
id[i] = id[j];
id[j] = x;
}
}
int block_size = maxvar / number;
int cursor = index * block_size + 1;

20
run.sh
View File

@ -1,27 +1,23 @@
#!/bin/bash
# cd kissat-inc
# make clean
# ./configure
# make -j 64
# cd ..
# make clean
cd kissat-inc
make clean
./configure
make -j 64
cd ..
make clean
# buglist
# - fe96b630b3e761821308b544368dd521-GP_100_950_34.cnf
# - 0d4970edf84353e5a5798bca3f7f270e-SAT_H_instances_childsnack_p10.hddl_2.cnf
# 这个存在问题
DIR=/pub/data/chenzh/data/sat2022
INSTANCE=0d4970edf84353e5a5798bca3f7f270e-SAT_H_instances_childsnack_p10.hddl_2.cnf
INSTANCE=30ca21da9753263cc8cda020802b58ce-GP_500_200_20.cnf
# make -j 16 && mpirun --bind-to none -np 9 --allow-run-as-root ./light -i $DIR/$INSTANCE --shuffle=1 --share=1 --threads=16 --times=3600 --share_method=1
make -j 16 && mpirun --bind-to none -np 9 --allow-run-as-root ./light -i $DIR/$INSTANCE --share=1 --threads=16 --times=3600 --share_method=0
make -j 16 && mpirun --bind-to none -np 9 --allow-run-as-root ./light -i data/class_1_easy_10_0.cnf --share=1 --threads=16 --times=3600 --share_method=0
#./light -i $DIR/$INSTANCE --share=1 --threads=16 --times=3600

View File

@ -47,6 +47,7 @@ public:
sharer* s;
std::vector<std::vector<int>> sharing_groups;
enum { SAT, UNSAT, DEFAULT } worker_type;
int worker_rs;
MPI_Request terminal_request;

View File

@ -54,13 +54,19 @@ void light::init_workers() {
}
void light::diversity_workers() {
for (int i = 0; i < OPT(threads); i++) {
if(worker_type == SAT) {
if (OPT(shuffle)) {
workers[i]->configure("worker_index", i);
workers[i]->configure("worker_number", OPT(threads));
if(rank == 1 || rank == num_procs - 1) {
workers[i]->configure("worker_seed", 0);
} else {
workers[i]->configure("worker_seed", rank);
}
// printf("r1: %d, r2: %d, r3: %d\n", r1, r2, r3);
}