Commit 033a33cc authored by lvs's avatar lvs
Browse files

added support for printing atom-based ie+ia grads

parent 33cc7dde
......@@ -778,6 +778,9 @@ void gpu_calc_gradient(
barrier(CLK_LOCAL_MEM_FENCE);
// Accumulating inter- and intramolecular gradients
for (uint atom_cnt = get_local_id(0);
atom_cnt < dockpars_num_of_atoms;
......@@ -792,6 +795,15 @@ void gpu_calc_gradient(
gradient_inter_y[atom_cnt] = native_divide(gradient_inter_y[atom_cnt], dockpars_grid_spacing);
gradient_inter_z[atom_cnt] = native_divide(gradient_inter_z[atom_cnt], dockpars_grid_spacing);
#if defined (DEBUG_GRAD_ROTATION_GENES)
if (atom_cnt == 0) {
printf("\n%s\n", "----------------------------------------------------------");
printf("%s\n", "Gradients: inter and intra");
printf("%-10s %-13s %-13s %-13s %-5s %-13s %-13s %-13s\n", "atom_id", "grad_intER.x", "grad_intER.y", "grad_intER.z", "|", "grad_intRA.x", "grad_intRA.y", "grad_intRA.z");
}
printf("%-10u %-13.6f %-13.6f %-13.6f %-5s %-13.6f %-13.6f %-13.6f\n", atom_cnt, gradient_inter_x[atom_cnt], gradient_inter_y[atom_cnt], gradient_inter_z[atom_cnt], "|", gradient_intra_x[atom_cnt], gradient_intra_y[atom_cnt], gradient_intra_z[atom_cnt]);
#endif
// Re-using "gradient_inter_*" for total gradient (inter+intra)
gradient_inter_x[atom_cnt] += gradient_intra_x[atom_cnt];
gradient_inter_y[atom_cnt] += gradient_intra_y[atom_cnt];
......@@ -800,10 +812,21 @@ void gpu_calc_gradient(
//printf("%-15s %-5u %-10.8f %-10.8f %-10.8f\n", "grad_grid", atom_cnt, gradient_inter_x[atom_cnt], gradient_inter_y[atom_cnt], gradient_inter_z[atom_cnt]);
//printf("%-15s %-5u %-10.8f %-10.8f %-10.8f\n", "grad_intra", atom_cnt, gradient_intra_x[atom_cnt], gradient_intra_y[atom_cnt], gradient_intra_z[atom_cnt]);
//printf("%-15s %-5u %-10.8f %-10.8f %-10.8f\n", "calc_coords", atom_cnt, calc_coords_x[atom_cnt], calc_coords_y[atom_cnt], calc_coords_z[atom_cnt]);
#if defined (DEBUG_GRAD_ROTATION_GENES)
if (atom_cnt == 0) {
printf("\n%s\n", "----------------------------------------------------------");
printf("%s\n", "Gradients: total = inter + intra");
printf("%-10s %-13s %-13s %-13s\n", "atom_id", "grad.x", "grad.y", "grad.z");
}
printf("%-10u %-13.6f %-13.6f %-13.6f \n", atom_cnt, gradient_inter_x[atom_cnt], gradient_inter_y[atom_cnt], gradient_inter_z[atom_cnt]);
#endif
}
barrier(CLK_LOCAL_MEM_FENCE);
// ------------------------------------------
// Obtaining translation-related gradients
// ------------------------------------------
......@@ -895,9 +918,10 @@ void gpu_calc_gradient(
// This printing is similar to autodockdevpy
if (lig_atom_id == 0) {
printf("\n%s\n", "----------------------------------------------------------");
printf("%-10s %-10s %-10s %-10s %-11s %-11s %-11s %-11s %-11s %-11s\n", "atom_id", "r.x", "r.y", "r.z", "force.x", "force.y", "force.z", "torque.x", "torque.y", "torque.z");
printf("%s\n", "Torque: atom-based accumulation of torque");
printf("%-10s %-10s %-10s %-10s %-5s %-12s %-12s %-12s %-5s %-11s %-11s %-11s\n", "atom_id", "r.x", "r.y", "r.z", "|", "force.x", "force.y", "force.z", "|", "torque.x", "torque.y", "torque.z");
}
printf("%-10u %-10.6f %-10.6f %-10.6f %-11.6f %-11.6f %-11.6f %-11.6f %-11.6f %-11.6f\n", lig_atom_id, r.x, r.y, r.z, force.x, force.y, force.z, torque_rot.x, torque_rot.y, torque_rot.z);
printf("%-10u %-10.6f %-10.6f %-10.6f %-5s %-12.6f %-12.6f %-12.6f %-5s %-12.6f %-12.6f %-12.6f\n", lig_atom_id, r.x, r.y, r.z, "|", force.x, force.y, force.z, "|", torque_rot.x, torque_rot.y, torque_rot.z);
//printf("%-10u %-10.6f %-10.6f %-10.6f %-10.6f %-10.6f %-10.6f\n", lig_atom_id, r.x, r.y, r.z, force.x, force.y, force.z);
#endif
......
......@@ -443,9 +443,9 @@ gradient_minimizer(
if (i == 0) {
printf("\n%s\n", "----------------------------------------------------------");
printf("%s\n", "Coordinates calculated by calcgradient.cl");
printf("%-10s %-10s %-10s %-10s\n", "atom_id", "coords.x", "coords.y", "coords.z");
printf("%-12s %-12s %-12s %-12s\n", "atom_id", "coords.x", "coords.y", "coords.z");
}
printf("%-10u %-10.6f %-10.6f %-10.6f\n", i, calc_coords_x[i], calc_coords_y[i], calc_coords_z[i]);
printf("%-12u %-12.6f %-12.6f %-12.6f\n", i, calc_coords_x[i], calc_coords_y[i], calc_coords_z[i]);
}
printf("\n");
}
......@@ -537,9 +537,9 @@ gradient_minimizer(
for(uint i = 0; i < dockpars_num_of_genes; i++) {
if (i == 0) {
printf("\n%s\n", "----------------------------------------------------------");
printf("%-10s %-10s %-10s\n", "gene_id", "gene.value", "gene.gradient");
printf("%-12s %-12s %-12s\n", "gene_id", "gene.value", "gene.gradient");
}
printf("%-10u %-10.6f %-10.6f\n", i, genotype[i], gradient[i]);
printf("%-12u %-12.6f %-12.6f\n", i, genotype[i], gradient[i]);
}
#if 0
......@@ -551,9 +551,9 @@ gradient_minimizer(
if (i == 0) {
printf("\n%s\n", "----------------------------------------------------------");
printf("%s\n", "Coordinates calculated by calcenergy.cl");
printf("%-10s %-10s %-10s %-10s\n", "atom_id", "coords.x", "coords.y", "coords.z");
printf("%-12s %-12s %-12s %-12s\n", "atom_id", "coords.x", "coords.y", "coords.z");
}
printf("%-10u %-10.6f %-10.6f %-10.6f\n", i, calc_coords_x[i], calc_coords_y[i], calc_coords_z[i]);
printf("%-12u %-12.6f %-12.6f %-12.6f\n", i, calc_coords_x[i], calc_coords_y[i], calc_coords_z[i]);
}
printf("\n");
}
......
Markdown is supported
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