Commit 8924a38a authored by Leonardo Solis's avatar Leonardo Solis
Browse files

#22, generation_cnt starts with 0 instead of 1

the update of conformation and energy values after every generation was updated too
parent 22da623d
...@@ -218,6 +218,7 @@ odock: check-env-all stringify $(SRC) ...@@ -218,6 +218,7 @@ odock: check-env-all stringify $(SRC)
PDB := 3ce3 PDB := 3ce3
NRUN := 100 NRUN := 100
NGEN := 27000
POPSIZE := 150 POPSIZE := 150
TESTNAME := test TESTNAME := test
TESTLS := sw TESTLS := sw
...@@ -227,6 +228,7 @@ test: odock ...@@ -227,6 +228,7 @@ test: odock
-ffile ./input/$(PDB)/derived/$(PDB)_protein.maps.fld \ -ffile ./input/$(PDB)/derived/$(PDB)_protein.maps.fld \
-lfile ./input/$(PDB)/derived/$(PDB)_ligand.pdbqt \ -lfile ./input/$(PDB)/derived/$(PDB)_ligand.pdbqt \
-nrun $(NRUN) \ -nrun $(NRUN) \
-ngen $(NGEN) \
-psize $(POPSIZE) \ -psize $(POPSIZE) \
-resnam $(TESTNAME) \ -resnam $(TESTNAME) \
-gfpop 0 \ -gfpop 0 \
......
...@@ -883,8 +883,10 @@ filled with clock() */ ...@@ -883,8 +883,10 @@ filled with clock() */
#endif #endif
// -------- Replacing with memory maps! ------------ // -------- Replacing with memory maps! ------------
#if 0
generation_cnt = 1; generation_cnt = 1;
#endif
generation_cnt = 0;
// -------- Replacing with memory maps! ------------ // -------- Replacing with memory maps! ------------
...@@ -1013,34 +1015,7 @@ filled with clock() */ ...@@ -1013,34 +1015,7 @@ filled with clock() */
// Kernel args exchange regions they point to // Kernel args exchange regions they point to
// But never two args point to the same region of dev memory // But never two args point to the same region of dev memory
// NO ALIASING -> use restrict in Kernel // NO ALIASING -> use restrict in Kernel
if (generation_cnt % 2 == 0) { if (generation_cnt % 2 == 0) { // In this configuration the program starts with generation_cnt = 0
// Kernel 4
setKernelArg(kernel4,13,sizeof(mem_dockpars_conformations_next), &mem_dockpars_conformations_next);
setKernelArg(kernel4,14,sizeof(mem_dockpars_energies_next), &mem_dockpars_energies_next);
setKernelArg(kernel4,15,sizeof(mem_dockpars_conformations_current), &mem_dockpars_conformations_current);
setKernelArg(kernel4,16,sizeof(mem_dockpars_energies_current), &mem_dockpars_energies_current);
if (dockpars.lsearch_rate != 0.0f) {
if (strcmp(mypars->ls_method, "sw") == 0) {
// Kernel 3
setKernelArg(kernel3,13,sizeof(mem_dockpars_conformations_current), &mem_dockpars_conformations_current);
setKernelArg(kernel3,14,sizeof(mem_dockpars_energies_current), &mem_dockpars_energies_current);
} else if (strcmp(mypars->ls_method, "sd") == 0) {
// Kernel 5
setKernelArg(kernel5,13,sizeof(mem_dockpars_conformations_current), &mem_dockpars_conformations_current);
setKernelArg(kernel5,14,sizeof(mem_dockpars_energies_current), &mem_dockpars_energies_current);
} else if (strcmp(mypars->ls_method, "fire") == 0) {
// Kernel 6
setKernelArg(kernel6,13,sizeof(mem_dockpars_conformations_current), &mem_dockpars_conformations_current);
setKernelArg(kernel6,14,sizeof(mem_dockpars_energies_current), &mem_dockpars_energies_current);
} else if (strcmp(mypars->ls_method, "ad") == 0) {
// Kernel 7
setKernelArg(kernel7,13,sizeof(mem_dockpars_conformations_current), &mem_dockpars_conformations_current);
setKernelArg(kernel7,14,sizeof(mem_dockpars_energies_current), &mem_dockpars_energies_current);
}
} // End if (dockpars.lsearch_rate != 0.0f)
}
else { // In this configuration, the program starts
// Kernel 4 // Kernel 4
setKernelArg(kernel4,13,sizeof(mem_dockpars_conformations_current), &mem_dockpars_conformations_current); setKernelArg(kernel4,13,sizeof(mem_dockpars_conformations_current), &mem_dockpars_conformations_current);
setKernelArg(kernel4,14,sizeof(mem_dockpars_energies_current), &mem_dockpars_energies_current); setKernelArg(kernel4,14,sizeof(mem_dockpars_energies_current), &mem_dockpars_energies_current);
...@@ -1067,6 +1042,33 @@ filled with clock() */ ...@@ -1067,6 +1042,33 @@ filled with clock() */
} }
} // End if (dockpars.lsearch_rate != 0.0f) } // End if (dockpars.lsearch_rate != 0.0f)
} }
else { // Program switches pointers the first time when generation_cnt becomes 1 (as it starts from 0)
// Kernel 4
setKernelArg(kernel4,13,sizeof(mem_dockpars_conformations_next), &mem_dockpars_conformations_next);
setKernelArg(kernel4,14,sizeof(mem_dockpars_energies_next), &mem_dockpars_energies_next);
setKernelArg(kernel4,15,sizeof(mem_dockpars_conformations_current), &mem_dockpars_conformations_current);
setKernelArg(kernel4,16,sizeof(mem_dockpars_energies_current), &mem_dockpars_energies_current);
if (dockpars.lsearch_rate != 0.0f) {
if (strcmp(mypars->ls_method, "sw") == 0) {
// Kernel 3
setKernelArg(kernel3,13,sizeof(mem_dockpars_conformations_current), &mem_dockpars_conformations_current);
setKernelArg(kernel3,14,sizeof(mem_dockpars_energies_current), &mem_dockpars_energies_current);
} else if (strcmp(mypars->ls_method, "sd") == 0) {
// Kernel 5
setKernelArg(kernel5,13,sizeof(mem_dockpars_conformations_current), &mem_dockpars_conformations_current);
setKernelArg(kernel5,14,sizeof(mem_dockpars_energies_current), &mem_dockpars_energies_current);
} else if (strcmp(mypars->ls_method, "fire") == 0) {
// Kernel 6
setKernelArg(kernel6,13,sizeof(mem_dockpars_conformations_current), &mem_dockpars_conformations_current);
setKernelArg(kernel6,14,sizeof(mem_dockpars_energies_current), &mem_dockpars_energies_current);
} else if (strcmp(mypars->ls_method, "ad") == 0) {
// Kernel 7
setKernelArg(kernel7,13,sizeof(mem_dockpars_conformations_current), &mem_dockpars_conformations_current);
setKernelArg(kernel7,14,sizeof(mem_dockpars_energies_current), &mem_dockpars_energies_current);
}
} // End if (dockpars.lsearch_rate != 0.0f)
}
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
#ifdef DOCK_DEBUG #ifdef DOCK_DEBUG
...@@ -1261,7 +1263,7 @@ double check_progress(int* evals_of_runs, int generation_cnt, int max_num_of_eva ...@@ -1261,7 +1263,7 @@ double check_progress(int* evals_of_runs, int generation_cnt, int max_num_of_eva
evals_progress = total_evals/((double) num_of_runs)/max_num_of_evals*100.0; evals_progress = total_evals/((double) num_of_runs)/max_num_of_evals*100.0;
//calculating progress according to number of generations //calculating progress according to number of generations
gens_progress = ((double) generation_cnt)/((double) max_num_of_gens)*100.0; gens_progress = ((double) generation_cnt)/((double) max_num_of_gens)*100.0; //std::cout<< "gens_progress: " << gens_progress <<std::endl;
if (evals_progress > gens_progress) if (evals_progress > gens_progress)
return evals_progress; return evals_progress;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment