Commit 809fc997 authored by Leonardo Solis's avatar Leonardo Solis

removed unneeded kernels files

parent fc53c03e
channel bool chan_IGL_active;
channel char chan_IGL_mode;
channel float chan_IGL_genotype __attribute__((depth(ACTUAL_GENOTYPE_LENGTH)));
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
__kernel __attribute__ ((max_global_work_dim(0)))
void Krnl_Conf_Arbiter(unsigned int DockConst_num_of_genes) {
__local float genotype[ACTUAL_GENOTYPE_LENGTH];
bool active = true;
while(active) {
//printf("BEFORE In Conf_Arbiter CHANNEL\n");
// --------------------------------------------------------------
// Wait for genotypes in channel
// --------------------------------------------------------------
bool IC_valid = false;
bool GG_valid = false;
bool LS_valid = false;
bool Off_valid = false;
float IC_active;
float GG_active;
float LS_active;
bool Off_active;
uchar pipe_cnt = 0;
while (
(Off_valid == false) && (pipe_cnt < DockConst_num_of_genes)
) {
IC_active = read_channel_nb_altera(chan_IC2Conf_genotype, &IC_valid);
GG_active = read_channel_nb_altera(chan_GG2Conf_genotype, &GG_valid);
LS_active = read_channel_nb_altera(chan_LS2Conf_genotype, &LS_valid);
Off_active = read_channel_nb_altera(chan_Off2Conf_active, &Off_valid);
if (IC_valid || GG_valid || LS_valid) {
genotype[pipe_cnt] = (IC_valid) ? IC_active :
(GG_valid) ? GG_active :
(LS_valid) ? LS_active :
(Off_valid) ? 0.0f:
0.0f; // last case should never occur, otherwise above while would be still running
if (pipe_cnt > 2) {
genotype [pipe_cnt] = genotype [pipe_cnt]*DEG_TO_RAD;
}
pipe_cnt++;
}
}
char mode;
/*
active = (IC_valid) ? true :
(GG_valid) ? true :
(LS_valid) ? true :
(Off_valid) ? Off_active :
false; // last case should never occur, otherwise above while would be still running
*/
active = (Off_valid) ? Off_active : true;
/*
mode = (IC_valid) ? 0x01 :
(GG_valid) ? 0x02 :
(LS_valid) ? 0x03 :
(Off_valid) ? 0x05 :
0x05; // last case should never occur, otherwise above while would be still running
*/
mode = (Off_valid) ? 0x05 : (IC_valid) ? 0x01 : (GG_valid) ? 0x02 : 0x03 ; // last case is LS (0x03)
// --------------------------------------------------------------
//printf("AFTER In Conf_Arbiter CHANNEL\n");
// communicate to Krnl_Conform
for (uchar i=0; i<DockConst_num_of_genes; i++) {
if (i == 0) {
write_channel_altera(chan_IGL_active, active);
mem_fence(CLK_CHANNEL_MEM_FENCE);
write_channel_altera(chan_IGL_mode, mode);
mem_fence(CLK_CHANNEL_MEM_FENCE);
}
write_channel_altera(chan_IGL_genotype, genotype[i]);
}
} // End of while (active)
}
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
//channel bool chan_Conf2LS_LS2_token;
//channel bool chan_Conf2LS_LS3_token;
channel bool chan_LS23_active;
channel char chan_LS23_mode;
channel float chan_LS23_genotype __attribute__((depth(ACTUAL_GENOTYPE_LENGTH)));
//channel bool chan_LS2Arbiter_LS2_end;
//channel bool chan_LS2Arbiter_LS3_end;
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
__kernel __attribute__ ((max_global_work_dim(0)))
void Krnl_Conf_Arbiter2(unsigned int DockConst_num_of_genes) {
__local float genotype2 [ACTUAL_GENOTYPE_LENGTH];
__local float genotype3 [ACTUAL_GENOTYPE_LENGTH];
__local float genotype_if_bound_1 [ACTUAL_GENOTYPE_LENGTH];
__local float genotype [2][ACTUAL_GENOTYPE_LENGTH];
bool active = true;
bool LS2_last_geno = false;
bool LS3_last_geno = false;
bool bothLS_last_geno = false;
uint LS2_eval = 0;
uint LS3_eval = 0;
while(active) {
bool Off_valid = false;
bool LS2_end_valid = false;
bool LS3_end_valid = false;
bool Off_active;
bool LS2_end_active;
bool LS3_end_active;
while (
(Off_valid == false) && (LS2_end_valid == false) && (LS3_end_valid == false)
){
Off_active = read_channel_nb_altera(chan_ConfArbiter_Off, &Off_valid);
LS2_end_active = read_channel_nb_altera(chan_LS2Arbiter_LS2_end, &LS2_end_valid);
LS3_end_active = read_channel_nb_altera(chan_LS2Arbiter_LS3_end, &LS3_end_valid);
/*
printf("%-15s %5s", "Off_valid: ", Off_valid?"true":"false");
printf("%-15s %5s ", "LS2_end_valid: ", LS2_end_valid?"true":"false");
printf("%-15s %5s\n", "LS3_end_valid: ", LS3_end_valid?"true":"false");
*/
}
/*
if ((LS2_end_valid == true) && (LS3_end_valid == true)){
printf("BOTH LS WANT TO PROCESS DATA!!!!!!\n");
}
*/
uchar bound_tmp = 0;
/*
active = Off_valid?Off_active:
LS2_end_valid?true:
LS3_end_valid?true:
false; // last case should never occur, otherwise above while would be still running
*/
active = Off_valid ? Off_active : true;
// get genos from LS2 and LS3
/*
if (active == true) {
// if LS2 sent geno
if (LS2_end_valid == true) {
bound_tmp++;
for (uchar i=0; i<DockConst_num_of_genes; i++) {
genotype2 [i] = read_channel_altera(chan_LS2Conf_LS2_genotype);
}
LS2_eval++;
#if defined (DEBUG_KRNL_CONF_ARBITER)
printf("LS2 genotype: %u\n", LS2_eval);
#endif
}
// if LS3 sent geno
if (LS3_end_valid == true) {
bound_tmp++;
for (uchar i=0; i<DockConst_num_of_genes; i++) {
genotype3 [i] = read_channel_altera(chan_LS2Conf_LS3_genotype);
}
LS3_eval++;
#if defined (DEBUG_KRNL_CONF_ARBITER)
printf("LS3 genotype: %u\n", LS3_eval);
#endif
}
} // End if (active == true)
*/
if (active == true) {
for (uchar i=0; i<DockConst_num_of_genes; i++) {
// if LS2 sent geno
if (LS2_end_valid == true) {
genotype2 [i] = read_channel_altera(chan_LS2Conf_LS2_genotype);
}
// if LS3 sent geno
if (LS3_end_valid == true) {
genotype3 [i] = read_channel_altera(chan_LS2Conf_LS3_genotype);
}
}
// if LS2 sent geno
if (LS2_end_valid == true) {
bound_tmp++;
LS2_eval++;
}
// if LS3 sent geno
if (LS3_end_valid == true) {
bound_tmp++;
LS3_eval++;
}
} // End if (active == true)
uchar bound = (active)?bound_tmp:1;
// mode for both LS
char mode [2];
mode [0] = (LS2_end_valid)? 0x02: 0x00;
mode [1] = (LS3_end_valid)? 0x03: 0x00;
char mode_if_bound_1 = LS2_end_valid?0x02:(LS3_end_valid?0x03:0x00);
// genotype for both LS
#pragma ivdep
for (uchar i=0; i<DockConst_num_of_genes; i++) {
genotype[0][i & 0x3F] = (LS2_end_valid)?genotype2[i]:0.0f;
genotype[1][i & 0x3F] = (LS3_end_valid)?genotype3[i]:0.0f;
genotype_if_bound_1[i] = LS2_end_valid?genotype2[i]:(LS3_end_valid?genotype3[i]:0.0f);
}
// Send data to Krnl_Conform2
for (uchar j=0; j<bound; j++) {
write_channel_altera(chan_LS23_active, active);
mem_fence(CLK_CHANNEL_MEM_FENCE);
write_channel_altera(chan_LS23_mode,(bound==1)?mode_if_bound_1:mode[j]);
mem_fence(CLK_CHANNEL_MEM_FENCE);
/*
for (uchar i=0; i<DockConst_num_of_genes; i++) {
write_channel_altera(chan_LS23_genotype, (bound==1)?genotype_if_bound_1[i]:genotype[j][i & 0x3F]);
}
*/
for (uchar i=0; i<DockConst_num_of_genes; i++) {
/*
float tmp;
if (i > 2) {
tmp = ((bound==1)?genotype_if_bound_1[i]:genotype[j][i & 0x3F]) * DEG_TO_RAD;
}
*/
float tmp = (bound==1)?genotype_if_bound_1[i]:genotype[j][i & 0x3F];
if (i > 2) {
tmp = tmp * DEG_TO_RAD;
}
write_channel_altera(chan_LS23_genotype, tmp);
}
#if defined (DEBUG_KRNL_CONF_ARBITER)
printf("bound: %u, mode: %u\n", bound, (bound==1)?mode_if_bound_1:mode[j]);
#endif
}
if (LS2_end_active == true) {
LS2_eval = 0;
}
if (LS3_end_active == true) {
LS3_eval = 0;
}
} // End of while (active)
}
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// --------------------------------------------------------------------------
// Perform Genetic Generation (GG)
// --------------------------------------------------------------------------
__kernel __attribute__ ((max_global_work_dim(0)))
void Krnl_GG(__global const float* restrict GlobPopulationCurrent,
__global const float* restrict GlobEnergyCurrent,
__global float* restrict GlobPopulationNext,
__global float* restrict GlobEnergyNext,
__global unsigned int* restrict GlobPRNG,
__constant Dockparameters* restrict DockConst
)
{
char active = 1;
const char mode = 2;
char ack = 0;
// Find_best
uint best_entity_id;
__local float loc_energies[MAX_POPSIZE];
// Binary tournament
uint parent1, parent2;
/*__local*/ float local_entity_1 [ACTUAL_GENOTYPE_LENGTH];
/*__local*/ float local_entity_2 [ACTUAL_GENOTYPE_LENGTH];
/*
float __attribute__((register)) local_entity_1 [ACTUAL_GENOTYPE_LENGTH];
float __attribute__((register)) local_entity_2 [ACTUAL_GENOTYPE_LENGTH];
*/
__local float offspring_genotype [ACTUAL_GENOTYPE_LENGTH];
while(active) {
active = read_channel_altera(chan_GA2GG_active);
#if defined (DEBUG_ACTIVE_KERNEL)
if (active == 0) {printf(" %-20s: %s\n", "Krnl_GG", "must be disabled");}
#endif
for (ushort i=0; i<DockConst->pop_size; i++) {
loc_energies[i] = GlobEnergyCurrent[i];
}
//Identifying best entity
best_entity_id = find_best(loc_energies, DockConst->pop_size);
//elitism - copying the best entity to new population
for (uchar i=0; i<ACTUAL_GENOTYPE_LENGTH; i++) {
GlobPopulationNext[i] = GlobPopulationCurrent[best_entity_id*ACTUAL_GENOTYPE_LENGTH+i];
}
GlobEnergyNext[0] = loc_energies[best_entity_id];
//new population consists of one member currently
//new_pop_cnt = 1;
//read GlobPRNG
uint prng = GlobPRNG[0];
for (ushort new_pop_cnt = 1; new_pop_cnt < DockConst->pop_size; new_pop_cnt++) {
//selecting two individuals randomly
binary_tournament_selection(&prng, loc_energies, &parent1, &parent2,
DockConst->pop_size, DockConst->tournament_rate);
//mating parents
for (uchar i=0; i<ACTUAL_GENOTYPE_LENGTH; i++) {
local_entity_1[i] = GlobPopulationCurrent[parent1*ACTUAL_GENOTYPE_LENGTH+i];
local_entity_2[i] = GlobPopulationCurrent[parent2*ACTUAL_GENOTYPE_LENGTH+i];
}
// first two args are population [parent1], population [parent2]
gen_new_genotype(&prng, local_entity_1, local_entity_2,
DockConst->mutation_rate, DockConst->abs_max_dmov, DockConst->abs_max_dang,
DockConst->crossover_rate, offspring_genotype);
//////======================================================
/*
if ( (active!=0) || ((active==0) && (new_pop_cnt==1)) ) {
write_channel_altera(chan_GG2Conf_active, active);
mem_fence(CLK_CHANNEL_MEM_FENCE);
write_channel_altera(chan_GG2Conf_mode, mode);
mem_fence(CLK_CHANNEL_MEM_FENCE);
write_channel_altera(chan_GG2Conf_cnt, new_pop_cnt);
mem_fence(CLK_CHANNEL_MEM_FENCE);
for (uchar pipe_cnt=0; pipe_cnt<ACTUAL_GENOTYPE_LENGTH; pipe_cnt++) {
GlobPopulationNext [new_pop_cnt*ACTUAL_GENOTYPE_LENGTH + pipe_cnt] = offspring_genotype [pipe_cnt];
write_channel_altera(chan_GG2Conf_genotype, offspring_genotype[pipe_cnt]);
}
} // End of if enclosing write to channels
*/
//////======================================================
write_channel_altera(chan_GG2Conf_active, active);
mem_fence(CLK_CHANNEL_MEM_FENCE);
write_channel_altera(chan_GG2Conf_mode, mode);
mem_fence(CLK_CHANNEL_MEM_FENCE);
write_channel_altera(chan_GG2Conf_cnt, new_pop_cnt);
mem_fence(CLK_CHANNEL_MEM_FENCE);
for (uchar pipe_cnt=0; pipe_cnt<ACTUAL_GENOTYPE_LENGTH; pipe_cnt++) {
GlobPopulationNext [new_pop_cnt*ACTUAL_GENOTYPE_LENGTH + pipe_cnt] = offspring_genotype [pipe_cnt];
write_channel_altera(chan_GG2Conf_genotype, offspring_genotype[pipe_cnt]);
}
} // End of for-loop new_pop_cnt
//write back to GlobPRNG
GlobPRNG[0] = prng;
ack = read_channel_altera(chan_Store2GG_ack);
mem_fence(CLK_GLOBAL_MEM_FENCE | CLK_CHANNEL_MEM_FENCE); // lvs added during hw evaluation
write_channel_altera(chan_GG2GA_eval_cnt, (DockConst->pop_size - 1));
} // End of while (active)
#if defined (DEBUG_ACTIVE_KERNEL)
printf(" %-20s: %s\n", "Krnl_GG", "disabled");
#endif
}
// --------------------------------------------------------------------------
// Calculating energies of initial population
// --------------------------------------------------------------------------
__kernel __attribute__ ((max_global_work_dim(0)))
void Krnl_IC(__global const float* restrict GlobPopulationCurrent,
__constant Dockparameters* restrict DockConst
)
{
char active = 1;
const char mode = 1;
char ack = 0;
__local float genotype [ACTUAL_GENOTYPE_LENGTH];
active = read_channel_altera(chan_GA2IC_active);
for (ushort pop_cnt = 0; pop_cnt < DockConst->pop_size; pop_cnt++) {
///*__local*/ float genotype [ACTUAL_GENOTYPE_LENGTH];
for (uchar pipe_cnt=0; pipe_cnt<ACTUAL_GENOTYPE_LENGTH; pipe_cnt++) {
genotype[pipe_cnt] = GlobPopulationCurrent[pop_cnt*ACTUAL_GENOTYPE_LENGTH + pipe_cnt];
}
write_channel_altera(chan_IC2Conf_active, active);
mem_fence(CLK_CHANNEL_MEM_FENCE);
write_channel_altera(chan_IC2Conf_mode, mode);
mem_fence(CLK_CHANNEL_MEM_FENCE);
write_channel_altera(chan_IC2Conf_cnt, pop_cnt);
mem_fence(CLK_CHANNEL_MEM_FENCE);
for (uchar pipe_cnt=0; pipe_cnt<ACTUAL_GENOTYPE_LENGTH; pipe_cnt++) {
write_channel_altera(chan_IC2Conf_genotype, genotype[pipe_cnt]);
}
#if defined (DEBUG_KRNL_IC)
printf("pop_cnt (Krnl_IC): %u\n", pop_cnt);
#endif
} // End of for-loop pop_cnt
ack = read_channel_altera(chan_Store2IC_ack);
#if defined (DEBUG_KRNL_IC)
printf("eval_cnt (Krnl_IC): %u\n", DockConst->pop_size);
#endif
write_channel_altera(chan_IC2GA_eval_cnt, DockConst->pop_size);
#if defined (DEBUG_ACTIVE_KERNEL)
printf(" %-20s: %s\n", "Krnl_IC", "disabled");
#endif
}
This diff is collapsed.
// --------------------------------------------------------------------------
// The function calculates the intermolecular energy of a ligand given by
// myligand parameter, and a receptor represented as a grid.
// The grid point values must be stored at the location which starts at GlobFgrids,
// the memory content can be generated with get_gridvalues function.
// The mygrid parameter must be the corresponding grid informtaion.
// If an atom is outside the grid, the coordinates will be changed with
// the value of outofgrid_tolerance,
// if it remains outside, a very high value will be added to the current energy as a penalty.
// Originally from: processligand.c
// --------------------------------------------------------------------------
__kernel __attribute__ ((max_global_work_dim(0)))
void Krnl_InterE2(
__constant float* restrict GlobFgrids,
__constant float* restrict KerConstStatic_atom_charges_const,
__constant char* restrict KerConstStatic_atom_types_const,
unsigned char DockConst_g1,
unsigned int DockConst_g2,
unsigned int DockConst_g3,
unsigned char DockConst_num_of_atoms,
unsigned char DockConst_gridsize_x_minus1,
unsigned char DockConst_gridsize_y_minus1,
unsigned char DockConst_gridsize_z_minus1,
unsigned int Host_mul_tmp2,
unsigned int Host_mul_tmp3
)
{
// local vars are allowed only at kernel scope
// however, they can be moved inside loops and still be local
// see how to do that here!
bool active = true;
__local char atom_types_localcache [MAX_NUM_OF_ATOMS];
__local float atom_charges_localcache [MAX_NUM_OF_ATOMS];
for (uchar i=0; i<DockConst_num_of_atoms; i++) {
atom_types_localcache [i] = KerConstStatic_atom_types_const [i];
atom_charges_localcache [i] = KerConstStatic_atom_charges_const [i];
}
while(active) {
char mode;
float3 __attribute__ ((
memory,
numbanks(2),
bankwidth(16),
singlepump,
numreadports(1),
numwriteports(1)
)) loc_coords[MAX_NUM_OF_ATOMS];
//printf("BEFORE In INTER CHANNEL\n");
// --------------------------------------------------------------
// Wait for ligand atomic coordinates in channel
// --------------------------------------------------------------
/*
active = read_channel_altera(chan_Conf2Intere_LS2_active);
mem_fence(CLK_CHANNEL_MEM_FENCE);
mode = read_channel_altera(chan_Conf2Intere_LS2_mode);
mem_fence(CLK_CHANNEL_MEM_FENCE);
for (uchar pipe_cnt=0; pipe_cnt<DockConst_num_of_atoms; pipe_cnt++) {
loc_coords[pipe_cnt] = read_channel_altera(chan_Conf2Intere_LS2_xyz);
}
*/
active = read_channel_altera(chan_Conf2Intere_LS2_active);
mem_fence(CLK_CHANNEL_MEM_FENCE);
for (uchar pipe_cnt=0; pipe_cnt<DockConst_num_of_atoms; pipe_cnt++) {
if (pipe_cnt == 0) {
mode = read_channel_altera(chan_Conf2Intere_LS2_mode);
mem_fence(CLK_CHANNEL_MEM_FENCE);
}
loc_coords[pipe_cnt] = read_channel_altera(chan_Conf2Intere_LS2_xyz);
}
// --------------------------------------------------------------
//printf("AFTER In INTER CHANNEL\n");
#if defined (DEBUG_ACTIVE_KERNEL)
if (active == 0) {printf(" %-20s: %s\n", "Krnl_InterE", "must be disabled");}
#endif
float interE = 0.0f;
// for each atom
for (uchar atom1_id=0; atom1_id<DockConst_num_of_atoms; atom1_id++)
{
char atom1_typeid = atom_types_localcache [atom1_id];
float3 loc_coords_atid1 = loc_coords[atom1_id];
float x = loc_coords_atid1.x;
float y = loc_coords_atid1.y;
float z = loc_coords_atid1.z;
float q = atom_charges_localcache [atom1_id];
float partialE1;
float partialE2;
float partialE3;
// if the atom is outside of the grid
if ((x < 0.0f) || (x >= DockConst_gridsize_x_minus1) ||
(y < 0.0f) || (y >= DockConst_gridsize_y_minus1) ||
(z < 0.0f) || (z >= DockConst_gridsize_z_minus1)) {
//penalty is 2^24 for each atom outside the grid
/*
interE += 16777216.0f;
*/
partialE1 = 16777216.0f;
partialE2 = 0.0f;
partialE3 = 0.0f;
}
else
{
int x_low = convert_int(floor(x));
int y_low = convert_int(floor(y));
int z_low = convert_int(floor(z));
int x_high = convert_int(ceil(x));
int y_high = convert_int(ceil(y));
int z_high = convert_int(ceil(z));
float dx = x - x_low;
float dy = y - y_low;
float dz = z - z_low;
// Calculates the weights for trilinear interpolation
// based on the location of the point inside
float weights [2][2][2];
weights [0][0][0] = (1-dx)*(1-dy)*(1-dz);
weights [1][0][0] = dx*(1-dy)*(1-dz);
weights [0][1][0] = (1-dx)*dy*(1-dz);
weights [1][1][0] = dx*dy*(1-dz);
weights [0][0][1] = (1-dx)*(1-dy)*dz;
weights [1][0][1] = dx*(1-dy)*dz;
weights [0][1][1] = (1-dx)*dy*dz;
weights [1][1][1] = dx*dy*dz;
// lvs added temporal variables
uint cube_000, cube_100, cube_010, cube_110, cube_001, cube_101, cube_011, cube_111;
/*
uint mul_tmp;
*/
uint ylow_times_g1 = y_low * DockConst_g1;
uint yhigh_times_g1 = y_high * DockConst_g1;
uint zlow_times_g2 = z_low * DockConst_g2;
uint zhigh_times_g2 = z_high * DockConst_g2;
cube_000 = x_low + ylow_times_g1 + zlow_times_g2;
cube_100 = x_high + ylow_times_g1 + zlow_times_g2;
cube_010 = x_low + yhigh_times_g1 + zlow_times_g2;
cube_110 = x_high + yhigh_times_g1 + zlow_times_g2;
cube_001 = x_low + ylow_times_g1 + zhigh_times_g2;
cube_101 = x_high + ylow_times_g1 + zhigh_times_g2;
cube_011 = x_low + yhigh_times_g1 + zhigh_times_g2;
cube_111 = x_high + yhigh_times_g1 + zhigh_times_g2;
uint mul_tmp = atom1_typeid * DockConst_g3;
//energy contribution of the current grid type
float cube [2][2][2];
cube [0][0][0] = GlobFgrids[cube_000 + mul_tmp];
cube [1][0][0] = GlobFgrids[cube_100 + mul_tmp];
cube [0][1][0] = GlobFgrids[cube_010 + mul_tmp];
cube [1][1][0] = GlobFgrids[cube_110 + mul_tmp];
cube [0][0][1] = GlobFgrids[cube_001 + mul_tmp];
cube [1][0][1] = GlobFgrids[cube_101 + mul_tmp];
cube [0][1][1] = GlobFgrids[cube_011 + mul_tmp];
cube [1][1][1] = GlobFgrids[cube_111 + mul_tmp];
partialE1 = TRILININTERPOL(cube, weights);
//energy contribution of the electrostatic grid
/*
atom1_typeid = DockConst_num_of_atypes;
mul_tmp = atom1_typeid * DockConst_g3;
*/
uint mul_tmp2 = Host_mul_tmp2;
cube [0][0][0] = GlobFgrids[cube_000 + mul_tmp2];
cube [1][0][0] = GlobFgrids[cube_100 + mul_tmp2];
cube [0][1][0] = GlobFgrids[cube_010 + mul_tmp2];
cube [1][1][0] = GlobFgrids[cube_110 + mul_tmp2];
cube [0][0][1] = GlobFgrids[cube_001 + mul_tmp2];
cube [1][0][1] = GlobFgrids[cube_101 + mul_tmp2];
cube [0][1][1] = GlobFgrids[cube_011 + mul_tmp2];
cube [1][1][1] = GlobFgrids[cube_111 + mul_tmp2];
partialE2 = q * TRILININTERPOL(cube, weights);
//energy contribution of the desolvation grid
/*
atom1_typeid = DockConst_num_of_atypes+1;
mul_tmp = atom1_typeid * DockConst_g3;
*/
uint mul_tmp3 = Host_mul_tmp3;
cube [0][0][0] = GlobFgrids[cube_000 + mul_tmp3];
cube [1][0][0] = GlobFgrids[cube_100 + mul_tmp3];
cube [0][1][0] = GlobFgrids[cube_010 + mul_tmp3];
cube [1][1][0] = GlobFgrids[cube_110 + mul_tmp3];
cube [0][0][1] = GlobFgrids[cube_001 + mul_tmp3];
cube [1][0][1] = GlobFgrids[cube_101 + mul_tmp3];
cube [0][1][1] = GlobFgrids[cube_011 + mul_tmp3];
cube [1][1][1] = GlobFgrids[cube_111 + mul_tmp3];
partialE3 = fabs(q) * TRILININTERPOL(cube, weights);
}