Commit 9c153df7 authored by Leonardo Solis's avatar Leonardo Solis

LS9 blocks + added comments + corrections

parent 3938e557
......@@ -532,7 +532,11 @@ else
endif
ENABLE_KERNELS = $(K1) $(K2) $(K3) $(K4) $(K5) $(K6) $(K7) $(K8) $(K9) $(K10) $(K11) $(K12) $(K13) $(K14) $(K15) $(K16) $(K17) $(K18) $(K19) $(K20) $(K21) $(K22) $(K23) $(K24) $(K25) $(K26) $(K27) $(K28) $(K29) $(K30) $(K31) $(K32) $(K33) $(K34) $(K35) $(K36) $(K37) $(K38) $(K39) $(K40) $(K41) $(K42) $(K43) $(K44) $(K45) $(K46) $(K47) $(K48)
ENABLE_KERNELS = $(K1) $(K2) $(K3) $(K4) $(K5) $(K6) $(K7) $(K8) $(K9) $(K10) \
$(K11) $(K12) $(K13) $(K14) $(K15) $(K16) $(K17) $(K18) $(K19) $(K20) \
$(K21) $(K22) $(K23) $(K24) $(K25) $(K26) $(K27) $(K28) $(K29) $(K30) \
$(K31) $(K32) $(K33) $(K34) $(K35) $(K36) $(K37) $(K38) $(K39) $(K40) \
$(K41) $(K42) $(K43) $(K44) $(K45) $(K46) $(K47) $(K48)
# =============================
# Reproduce result (remove randomness)
......@@ -666,7 +670,18 @@ else
SEP_FGRID_FLAG=
endif
FIPO_FLAG = $(FIPOCO_FLAG) $(FIPOIE_FLAG) $(FIPOIA_FLAG) $(FIPOLS1_FLAG) $(FIPOLS2_FLAG) $(FIPOLS3_FLAG) $(FIPOLS4_FLAG) $(FIPOLS5_FLAG) $(FIPOLS6_FLAG) $(FIPOLS7_FLAG) $(FIPOLS8_FLAG) $(FIPOLS9_FLAG) $(COPYPOPENE_FLAG) $(SEP_FGRID_FLAG)
FIPO_FLAG = $(FIPOCO_FLAG) \
$(FIPOIE_FLAG) $(FIPOIA_FLAG) \
$(FIPOLS1_FLAG) \
$(FIPOLS2_FLAG) \
$(FIPOLS3_FLAG) \
$(FIPOLS4_FLAG) \
$(FIPOLS5_FLAG) \
$(FIPOLS6_FLAG) \
$(FIPOLS7_FLAG) \
$(FIPOLS8_FLAG) \
$(FIPOLS9_FLAG) \
$(COPYPOPENE_FLAG) $(SEP_FGRID_FLAG)
# =============================
# AOC flags
......@@ -716,18 +731,19 @@ $(TARGET_DIR)/$(TARGET) : Makefile $(SRCS) $(INCS) $(TARGET_DIR)
$(foreach L,$(LIBS),-l$L) \
-o $(TARGET_DIR)/$(TARGET) $(DOCK_DEBUG_FLAG) $(DEV) $(DOCK_PROG) $(ENABLE_KERNELS) $(REP) $(FIPO_FLAG)
@echo " "
@echo "================================"
@echo "INFO: host binary is under: bin/"
@echo "================================"
@echo "==================================================="
@echo "INFO: host binary is under: $(TARGET_DIR)/$(TARGET)"
@echo "==================================================="
@echo " "
# Docking parameters
# NEV was usually set to 100000
# Docking parameters
# that directly determine the execution time
# Following values are used only for emulation
# to have a short but still a representative test
PDB := 1stp
NRUN := 10
NEV := 50000
# Project name
PROJECT_NAME := ofdock_taskpar_alt
......@@ -753,9 +769,9 @@ BOARD := Proc10A_X115
keremu: $(DEV_SRC)
aoc -march=emulator -v --board $(BOARD) $(DEV_SRC) -o $(TARGET_DIR)/$(KRNL_NAME).aocx $(REP) $(FIPO_FLAG) $(AOC_FLAG) -g
@echo " "
@echo "==============================================================="
@echo "INFO: emulation files are under: bin/$(KRNL_NAME)(.aoco)(.aocx)"
@echo "==============================================================="
@echo "========================================================================="
@echo "INFO: emulation files are under: $(TARGET_DIR)/$(KRNL_NAME)(.aoco)(.aocx)"
@echo "========================================================================="
@echo " "
# Run emulation
......@@ -766,9 +782,9 @@ emu: $(TARGET_DIR)/$(TARGET) keremu
cd $(TARGET_DIR) && \
CL_CONTEXT_EMULATOR_DEVICE_ALTERA=1 ./$(TARGET) -ffile ../input/$(PDB)/derived/$(PDB)_protein.maps.fld -lfile ../input/$(PDB)/derived/$(PDB)_ligand.pdbqt -nev $(NEV) -nrun $(NRUN) -gfpop 1
@echo " "
@echo "========================================"
@echo "INFO: log file is under: bin/docking.dlg"
@echo "========================================"
@echo "=================================================="
@echo "INFO: log file is under: $(TARGET_DIR)/docking.dlg"
@echo "=================================================="
@echo " "
......@@ -781,13 +797,13 @@ emu: $(TARGET_DIR)/$(TARGET) keremu
kerrpt: $(DEV_SRC)
aoc --board $(BOARD) $(DEV_SRC) -o $(TARGET_DIR)/$(KRNL_NAME).aoco $(REP) $(FIPO_FLAG) $(AOC_FLAG) -c --report -g
@echo " "
@echo "=================================================================="
@echo "INFO: report files are under: bin/$(KRNL_NAME)/reports/report.html"
@echo "INFO: THIS WORKS ONLY FROM V16.1 ON "
@echo " "
@echo "INFO: report file is under: bin/$(KRNL_NAME).log "
@echo "INFO: THIS WORKS IN V16.0 AND OLDER. "
@echo "=================================================================="
@echo "============================================================================"
@echo "INFO: report files are under: $(TARGET_DIR)/$(KRNL_NAME)/reports/report.html"
@echo "INFO: THIS WORKS ONLY FROM V16.1 ON "
@echo " "
@echo "INFO: report file is under: $(TARGET_DIR)/$(KRNL_NAME).log "
@echo "INFO: THIS WORKS IN V16.0 AND OLDER. "
@echo "============================================================================"
@echo " "
# Build hw (FPGA bitstream)
......@@ -799,17 +815,17 @@ kerrpt: $(DEV_SRC)
hw:
aoc --board $(BOARD) $(DEV_SRC) -o $(TARGET_DIR_HW)/$(KRNL_NAME).aocx $(FIPO_FLAG) $(AOC_FLAG)
@echo " "
@echo "================================================================"
@echo "INFO: FPGA bitstream is under: bin_hw/$(KRNL_NAME)(.aoco)(.aocx)"
@echo "================================================================"
@echo "=========================================================================="
@echo "INFO: FPGA bitstream is under: $(TARGET_DIR_HW)/$(KRNL_NAME)(.aoco)(.aocx)"
@echo "=========================================================================="
@echo " "
hw-he:
aoc --high-effort --board $(BOARD) $(DEV_SRC) -o $(TARGET_DIR_HW)/$(KRNL_NAME).aocx $(FIPO_FLAG) $(AOC_FLAG)
@echo " "
@echo "================================================================"
@echo "INFO: FPGA bitstream is under: bin_hw/$(KRNL_NAME)(.aoco)(.aocx)"
@echo "================================================================"
@echo "=========================================================================="
@echo "INFO: FPGA bitstream is under: $(TARGET_DIR_HW)/$(KRNL_NAME)(.aoco)(.aocx)"
@echo "=========================================================================="
@echo " "
# Build hw (FPGA bitstream) instrumented with performance counters
......@@ -821,13 +837,13 @@ hw-he:
hw-prof:
aoc --profile --board $(BOARD) $(DEV_SRC) -o $(TARGET_DIR_HW_PROF)/$(KRNL_NAME).aocx $(FIPO_FLAG) $(AOC_FLAG)
@echo " "
@echo "====================================================================================="
@echo "INFO: instrumented FPGA bitstream is under: bin_hw_profile/$(KRNL_NAME)(.aoco)(.aocx)"
@echo "====================================================================================="
@echo "============================================================================================"
@echo "INFO: instrumented FPGA bitstream is under: $(TARGET_DIR_HW_PROF)/$(KRNL_NAME)(.aoco)(.aocx)"
@echo "============================================================================================"
@echo " "
# Execute on sauron server
# Execute on remote server
# Host-recompilation
# Copy of host to $(TARGET_DIR_HW)
# The working directory is changed
......@@ -835,15 +851,15 @@ hw-prof:
exe: $(TARGET_DIR)/$(TARGET)
cp $(TARGET_DIR)/$(TARGET) $(TARGET_DIR_HW)/ && \
cd $(TARGET_DIR_HW) && \
./$(TARGET) -ffile ../input/$(PDB)/derived/$(PDB)_protein.maps.fld -lfile ../input/$(PDB)/derived/$(PDB)_ligand.pdbqt -nrun 10
./$(TARGET) -ffile ../input/$(PDB)/derived/$(PDB)_protein.maps.fld -lfile ../input/$(PDB)/derived/$(PDB)_ligand.pdbqt -nrun $(NRUN) -resnam docking_$(PDB)_$(NRUN)
@echo " "
@echo "==========================================="
@echo "INFO: log file is under: bin_hw/docking.dlg"
@echo "==========================================="
@echo "===================================================================="
@echo "INFO: log file is under: $(TARGET_DIR_HW)/docking_$(PDB)_$(NRUN).dlg"
@echo "===================================================================="
@echo " "
# Execute and profile on sauron server
# Execute and profile on remote server
# Host-recompilation
# Copy of host to $(TARGET_DIR_HW_PROF)
# The working directory is changed
......@@ -851,20 +867,23 @@ exe: $(TARGET_DIR)/$(TARGET)
exe-prof: $(TARGET_DIR)/$(TARGET)
cp $(TARGET_DIR)/$(TARGET) $(TARGET_DIR_HW_PROF)/ && \
cd $(TARGET_DIR_HW_PROF) && \
./$(TARGET) -ffile ../input/$(PDB)/derived/$(PDB)_protein.maps.fld -lfile ../input/$(PDB)/derived/$(PDB)_ligand.pdbqt -nrun 10
./$(TARGET) -ffile ../input/$(PDB)/derived/$(PDB)_protein.maps.fld -lfile ../input/$(PDB)/derived/$(PDB)_ligand.pdbqt -nrun $(NRUN) -resnam docking_$(PDB)_$(NRUN)
@echo " "
@echo "==================================================="
@echo "INFO: log file is under: bin_hw_profile/docking.dlg"
@echo "==================================================="
@echo "========================================================================="
@echo "INFO: log file is under: $(TARGET_DIR_HW_PROF)/docking_$(PDB)_$(NRUN).dlg"
@echo "========================================================================="
@echo " "
COPY_DIR := copy_$(PROJECT_NAME)
COPY_DIR_DOCK := $(PROJECT_NAME)
# Make sure this remote-server alias exists (in ~/.ssh/config)
SERVER := sauron
# Delete an existing folder if previously created
# Create a folder $(COPY_DIR) in the parent directory
# Copy binaries into $(COPY_DIR) folder, avoiding the (innecesary) compilation intermediate files
# Copy source files into $(COPY_DIR) as host is built in the HARP2 front-end
# Copy source files into $(COPY_DIR) as host is built in the remote $(SERVER)
# Create a zip file out of the $(COPY_DIR) folder
copy: clean-copy
mkdir ../$(COPY_DIR)
......@@ -882,16 +901,16 @@ copy: clean-copy
cp -r input/ ../$(COPY_DIR)/$(COPY_DIR_DOCK)/
cp -r wrapcl/ ../$(COPY_DIR)/$(COPY_DIR_DOCK)/
cp -r ../common ../$(COPY_DIR)/
cp ../conf_aoc160_sauron.sh ../$(COPY_DIR)/
cp ../conf_aoc160_$(SERVER).sh ../$(COPY_DIR)/
cd ../; zip -r $(COPY_DIR).zip $(COPY_DIR)
@echo " "
@echo "Transfer the $(COPY_DIR).zip file to sauron server: "
@echo "Transfer the $(COPY_DIR).zip file to $(SERVER) server: "
@echo " "
cd ../ && scp $(COPY_DIR).zip sauron:~/
cd ../ && scp $(COPY_DIR).zip $(SERVER):~/
@echo " "
@echo "================="
@echo "Transfer finished"
@echo "================="
@echo "=========================================="
@echo "Files listed were transferred to $(SERVER)"
@echo "=========================================="
@echo " "
clean-copy:
......
// --------------------------------------------------------------------------
// The function changes the conformation of myligand according to
// the genotype given by the second parameter.
// Conform changes the conformation of the ligand according to
// the genotype fed by any producer logic/kernel (IC, GG, LSs).
// Originally from: processligand.c
// --------------------------------------------------------------------------
__kernel __attribute__ ((max_global_work_dim(0)))
......@@ -18,9 +18,7 @@ void Krnl_Conform(
unsigned int DockConst_rotbondlist_length,
unsigned char DockConst_num_of_atoms,
unsigned char DockConst_num_of_genes,
/*
unsigned char Host_num_of_rotbonds,
*/
#if defined (FIXED_POINT_CONFORM)
__constant fixedpt4* restrict KerConstStatic_ref_orientation_quats_const,
#else
......@@ -36,17 +34,13 @@ void Krnl_Conform(
printf("%-40s %u\n", "DockConst_num_of_genes: ", DockConst_num_of_genes);
#endif
/*
// check best practices guide
// Check best practices guide
// Table 11. Effects of numbanks and bankwidth on the Bank Geometry ...
// only first three indexes of the lower array are used
// however size of lower array was declared as 4, just to keep sizes equal to power of 2
__local float __attribute__((numbanks(8), bankwidth(16))) loc_coords[MAX_NUM_OF_ATOMS][4];
*/
/*
bool active = true;
*/
// Only first three indexes of the lower array are used
// however size of lower array was declared as 4,
// just to keep sizes equal to power of 2
// __local float __attribute__((numbanks(8), bankwidth(16))) loc_coords[MAX_NUM_OF_ATOMS][4];
char active = 0x01;
__local int rotlist_localcache [MAX_NUM_OF_ROTATIONS];
......@@ -62,10 +56,6 @@ while(active) {
fixedpt phi;
fixedpt theta;
fixedpt genrotangle;
/*
fixedpt sin_theta, cos_theta;
fixedpt3 genrot_unitvec;
*/
fixedpt3 genotype_xyz;
fixedpt3 __attribute__ ((
memory,
......@@ -79,10 +69,6 @@ while(active) {
float phi;
float theta;
float genrotangle;
/*
float sin_theta, cos_theta;
float3 genrot_unitvec;
*/
float3 genotype_xyz;
float3 __attribute__ ((
memory,
......@@ -94,10 +80,6 @@ while(active) {
)) loc_coords [MAX_NUM_OF_ATOMS];
#endif
/*
active = read_channel_altera(chan_IGL2Conform_active);
mem_fence(CLK_CHANNEL_MEM_FENCE);
*/
char2 actmode = read_channel_altera(chan_IGL2Conform_actmode);
mem_fence(CLK_CHANNEL_MEM_FENCE);
......@@ -113,52 +95,19 @@ while(active) {
#endif
for (uchar i=0; i<DockConst_num_of_genes; i++) {
/*float fl_tmp = read_channel_altera(chan_IGL2Conform_genotype);*/
float fl_tmp;
switch (mode) {
case 'I':
fl_tmp = read_channel_altera(chan_IC2Conf_genotype);
break;
case 'G':
fl_tmp = read_channel_altera(chan_GG2Conf_genotype);
break;
case 0x01:
fl_tmp = read_channel_altera(chan_LS2Conf_LS1_genotype);
break;
case 0x02:
fl_tmp = read_channel_altera(chan_LS2Conf_LS2_genotype);
break;
case 0x03:
fl_tmp = read_channel_altera(chan_LS2Conf_LS3_genotype);
break;
case 0x04:
fl_tmp = read_channel_altera(chan_LS2Conf_LS4_genotype);
break;
case 0x05:
fl_tmp = read_channel_altera(chan_LS2Conf_LS5_genotype);
break;
case 0x06:
fl_tmp = read_channel_altera(chan_LS2Conf_LS6_genotype);
break;
case 0x07:
fl_tmp = read_channel_altera(chan_LS2Conf_LS7_genotype);
break;
case 0x08:
fl_tmp = read_channel_altera(chan_LS2Conf_LS8_genotype);
break;
case 0x09:
fl_tmp = read_channel_altera(chan_LS2Conf_LS9_genotype);
break;
case 'I': fl_tmp = read_channel_altera(chan_IC2Conf_genotype); break;
case 'G': fl_tmp = read_channel_altera(chan_GG2Conf_genotype); break;
case 0x01: fl_tmp = read_channel_altera(chan_LS2Conf_LS1_genotype); break;
case 0x02: fl_tmp = read_channel_altera(chan_LS2Conf_LS2_genotype); break;
case 0x03: fl_tmp = read_channel_altera(chan_LS2Conf_LS3_genotype); break;
case 0x04: fl_tmp = read_channel_altera(chan_LS2Conf_LS4_genotype); break;
case 0x05: fl_tmp = read_channel_altera(chan_LS2Conf_LS5_genotype); break;
case 0x06: fl_tmp = read_channel_altera(chan_LS2Conf_LS6_genotype); break;
case 0x07: fl_tmp = read_channel_altera(chan_LS2Conf_LS7_genotype); break;
case 0x08: fl_tmp = read_channel_altera(chan_LS2Conf_LS8_genotype); break;
case 0x09: fl_tmp = read_channel_altera(chan_LS2Conf_LS9_genotype); break;
}
if (i > 2) {
......@@ -168,7 +117,7 @@ while(active) {
//printf("Conform: %u %u\n", mode, i);
#if defined (FIXED_POINT_CONFORM)
// convert float to fixedpt
// Convert float to fixedpt
fixedpt fx_tmp = fixedpt_fromfloat(fl_tmp);
switch (i) {
case 0: genotype_xyz.x = fx_tmp; break;
......@@ -196,40 +145,23 @@ while(active) {
if (active == 0x00) {printf(" %-20s: %s\n", "Krnl_Conform", "must be disabled");}
#endif
/*
#if defined (FIXED_POINT_CONFORM)
sin_theta = fixedpt_sin(theta);
cos_theta = fixedpt_cos(theta);
genrot_unitvec.x = fixedpt_mul(sin_theta, fixedpt_cos(phi));
genrot_unitvec.y = fixedpt_mul(sin_theta, fixedpt_sin(phi));
genrot_unitvec.z = cos_theta;
#else
sin_theta = native_sin(theta);
cos_theta = native_cos(theta);
genrot_unitvec.x = sin_theta*native_cos(phi);
genrot_unitvec.y = sin_theta*native_sin(phi);
genrot_unitvec.z = cos_theta;
#endif
*/
for (ushort rotation_counter = 0; rotation_counter < DockConst_rotbondlist_length; rotation_counter++)
{
int rotation_list_element = rotlist_localcache [rotation_counter];
if ((rotation_list_element & RLIST_DUMMY_MASK) == 0) //if not dummy rotation
if ((rotation_list_element & RLIST_DUMMY_MASK) == 0) // If not dummy rotation
{
uint atom_id = rotation_list_element & RLIST_ATOMID_MASK;
//capturing atom coordinates
// Capturing atom coordinates
#if defined (FIXED_POINT_CONFORM)
fixedpt3 atom_to_rotate;
#else
float3 atom_to_rotate;
#endif
if ((rotation_list_element & RLIST_FIRSTROT_MASK) != 0) //if first rotation of this atom
if ((rotation_list_element & RLIST_FIRSTROT_MASK) != 0) // If first rotation of this atom
{
/*atom_to_rotate = ref_coords_localcache [atom_id];*/
atom_to_rotate = KerConstStatic_ref_coords_const [atom_id];
}
else
......@@ -237,7 +169,7 @@ while(active) {
atom_to_rotate = loc_coords[atom_id];
}
//capturing rotation vectors and angle
// Capturing rotation vectors and angle
#if defined (FIXED_POINT_CONFORM)
fixedpt3 rotation_unitvec;
fixedpt3 rotation_movingvec;
......@@ -248,7 +180,7 @@ while(active) {
float rotation_angle;
#endif
if ((rotation_list_element & RLIST_GENROT_MASK) != 0) //if general rotation
if ((rotation_list_element & RLIST_GENROT_MASK) != 0) // If general rotation
{
#if defined (FIXED_POINT_CONFORM)
fixedpt sin_theta, cos_theta;
......@@ -274,20 +206,18 @@ while(active) {
rotation_movingvec = genotype_xyz;
}
else //if rotating around rotatable bond
else // If rotating around rotatable bond
{
uint rotbond_id = (rotation_list_element & RLIST_RBONDID_MASK) >> RLIST_RBONDID_SHIFT;
/*rotation_unitvec = rotbonds_unit_vectors_localcache [rotbond_id];*/
rotation_unitvec = KerConstStatic_rotbonds_unit_vectors_const [rotbond_id];
rotation_angle = genotype [6+rotbond_id];
/*rotation_movingvec = rotbonds_moving_vectors_localcache [rotbond_id];*/
rotation_movingvec = KerConstStatic_rotbonds_moving_vectors_const [rotbond_id];
//in addition performing the first movement
//which is needed only if rotating around rotatable bond
// In addition performing the first movement
// which is needed only if rotating around rotatable bond
#if defined (FIXED_POINT_CONFORM)
atom_to_rotate.x = fixedpt_sub(atom_to_rotate.x, rotation_movingvec.x);
......@@ -298,7 +228,7 @@ while(active) {
#endif
}
//performing rotation
// Performing rotation
#if defined (FIXED_POINT_CONFORM)
fixedpt quatrot_left_x, quatrot_left_y, quatrot_left_z, quatrot_left_q;
fixedpt quatrot_temp_x, quatrot_temp_y, quatrot_temp_z, quatrot_temp_q;
......@@ -331,9 +261,9 @@ while(active) {
quatrot_left.w = cos_angle;
#endif
if ((rotation_list_element & RLIST_GENROT_MASK) != 0) //if general rotation,
//two rotations should be performed
//(multiplying the quaternions)
if ((rotation_list_element & RLIST_GENROT_MASK) != 0) // If general rotation,
// two rotations should be performed
// (multiplying the quaternions)
{
#if defined (FIXED_POINT_CONFORM)
const fixedpt4 ref_orientation_quats_const = KerConstStatic_ref_orientation_quats_const[Host_RunId];
......@@ -349,8 +279,8 @@ while(active) {
const float ref_orientation_quats_const_3 = ref_orientation_quats_const.w;
#endif
//calculating quatrot_left*ref_orientation_quats_const,
//which means that reference orientation rotation is the first
// Calculating quatrot_left*ref_orientation_quats_const,
// which means that reference orientation rotation is the first
#if defined (FIXED_POINT_CONFORM)
quatrot_temp_q = quatrot_left_q;
quatrot_temp_x = quatrot_left_x;
......@@ -360,7 +290,7 @@ while(active) {
quatrot_temp = quatrot_left;
#endif
//taking the first element of ref_orientation_quats_const member
// Taking the first element of ref_orientation_quats_const member
#if defined (FIXED_POINT_CONFORM)
quatrot_left_q = fixedpt_mul(quatrot_temp_q, ref_orientation_quats_const_0)
- fixedpt_mul(quatrot_temp_x, ref_orientation_quats_const_1)
......@@ -445,7 +375,7 @@ while(active) {
atom_to_rotate.z = dot(quatrot_temp, left4z);
#endif
//performing final movement and storing values
// Performing final movement and storing values
loc_coords[atom_id] = atom_to_rotate + rotation_movingvec;
} // End if-statement not dummy rotation
......@@ -474,7 +404,7 @@ while(active) {
}*/
/*
/*
for (uchar pipe_cnt=0; pipe_cnt<DockConst_num_of_atoms; pipe_cnt++) {
if (pipe_cnt == 0) {
char active_tmp = active;
......@@ -499,9 +429,7 @@ while(active) {
write_channel_altera(chan_Conf2Intere_xyz, tmp);
write_channel_altera(chan_Conf2Intrae_xyz, tmp);
}
*/
*/
for (uchar pipe_cnt=0; pipe_cnt<DockConst_num_of_atoms; pipe_cnt+=2) {
if (pipe_cnt == 0) {
......@@ -528,7 +456,7 @@ while(active) {
float8 tmp;
#if defined (FIXED_POINT_CONFORM)
// convert fixedpt3 to float3
// Convert fixedpt3 to float3
float tmp_x1 = fixedpt_tofloat(tmp_coords[0].x);
float tmp_y1 = fixedpt_tofloat(tmp_coords[0].y);
float tmp_z1 = fixedpt_tofloat(tmp_coords[0].z);
......@@ -551,7 +479,7 @@ while(active) {
printf("AFTER Out CONFORM CHANNEL\n");
#endif
} // End of while(1)
} // End of while(active)
#if defined (DEBUG_ACTIVE_KERNEL)
printf(" %-20s: %s\n", "Krnl_Conform", "disabled");
......
// Enable the channels extension
#pragma OPENCL EXTENSION cl_altera_channels : enable
//IC: initial calculation of energy of populations
//GG: genetic generation
//LS: local search
//IC: initial calculation of energy of populations
//GG: genetic generation
//LS: local search
//OFF: turn off
#include "../defines.h"
......@@ -11,9 +11,11 @@
#define CHAN_DEPTH_ATOMXYZ (MAX_NUM_OF_ATOMS/2)
#define CHAN_DEPTH_GENOTYPE ACTUAL_GENOTYPE_LENGTH
channel bool chan_GA2IGL_IC_active;
channel bool chan_GA2IGL_GG_active;
// Send active signal to IGL_Arbiter
channel bool chan_GA2IGL_IC_active;
channel bool chan_GA2IGL_GG_active;
// Send genotypes from producers (IC, GG, LSs) to Conform
channel float chan_IC2Conf_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_GG2Conf_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_LS2Conf_LS1_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
......@@ -26,14 +28,13 @@ channel float chan_LS2Conf_LS7_genotype __attribute__((depth(CHAN_DEPTH_G
channel float chan_LS2Conf_LS8_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_LS2Conf_LS9_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
// Conform to IE, IA
// Send ligand-atom positions from Conform to InterE & IntraE
channel float8 chan_Conf2Intere_xyz __attribute__((depth(CHAN_DEPTH_ATOMXYZ)));
channel char2 chan_Conf2Intere_actmode;
channel float8 chan_Conf2Intrae_xyz __attribute__((depth(CHAN_DEPTH_ATOMXYZ)));
channel char2 chan_Conf2Intrae_actmode;
// Send data back to generators of genotypes
// Send energy values from InterE & IntraE to genotype-senders (IC, GG, LSs)
channel float chan_Intere2StoreIC_intere __attribute__((depth(2)));
channel float chan_Intere2StoreGG_intere __attribute__((depth(2)));
channel float chan_Intere2StoreLS_LS1_intere __attribute__((depth(2)));
......@@ -45,7 +46,6 @@ channel float chan_Intere2StoreLS_LS6_intere __attribute__((depth(2)));
channel float chan_Intere2StoreLS_LS7_intere __attribute__((depth(2)));
channel float chan_Intere2StoreLS_LS8_intere __attribute__((depth(2)));
channel float chan_Intere2StoreLS_LS9_intere __attribute__((depth(2)));
channel float chan_Intrae2StoreIC_intrae __attribute__((depth(2)));
channel float chan_Intrae2StoreGG_intrae __attribute__((depth(2)));
channel float chan_Intrae2StoreLS_LS1_intrae __attribute__((depth(2)));
......@@ -58,27 +58,27 @@ channel float chan_Intrae2StoreLS_LS7_intrae __attribute__((depth(2)));
channel float chan_Intrae2StoreLS_LS8_intrae __attribute__((depth(2)));
channel float chan_Intrae2StoreLS_LS9_intrae __attribute__((depth(2)));
// PRNG kernerls
channel float8 chan_PRNG2GA_BT_ushort_float_prng;
channel uchar2 chan_PRNG2GA_GG_uchar_prng;
channel float chan_PRNG2GA_GG_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
/*
channel ushort8 chan_PRNG2GA_LS123_ushort_prng;
*/
// Send PRNG outputs from generators to consumers
channel float8 chan_PRNG2GA_BT_ushort_float_prng;
channel uchar2 chan_PRNG2GA_GG_uchar_prng;
channel float chan_PRNG2GA_GG_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel ushort16 chan_PRNG2GA_LS123_ushort_prng;
channel float chan_PRNG2GA_LS_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS2_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS3_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS4_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS5_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS6_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS7_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS8_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS9_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS2_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS3_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS4_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS5_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS6_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS7_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS8_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS9_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
// Turn-off signals to PRNG generators
// FIXME: these channels don't go anymore through IGL_Arbiter.
// That was initially the case, but was fixed.
// Name should be changed accordingly (GA instead of Arbiter)
// to avoid misleading data-flow information
channel bool chan_Arbiter_BT_ushort_float_off;
channel bool chan_Arbiter_GG_uchar_off;
channel bool chan_Arbiter_GG_float_off;
......@@ -92,10 +92,8 @@ channel bool chan_Arbiter_LS6_float_off;
channel bool chan_Arbiter_LS7_float_off;
channel bool chan_Arbiter_LS8_float_off;
channel bool chan_Arbiter_LS9_float_off;
/*
channel bool chan_GA2PRNG_LS_float_Off;
*/
// LS1, LS2, LS3
// Send energy values and genotypes to LSs
channel float chan_GA2LS_LS1_energy;
channel float chan_GA2LS_LS2_energy;
channel float chan_GA2LS_LS3_energy;
......@@ -115,6 +113,7 @@ channel float chan_GA2LS_LS7_genotype __attribute__((depth(CHAN_DEPTH_G
channel float chan_GA2LS_LS8_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_GA2LS_LS9_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
// Send LS status from LSs to IGL_Arbiter
channel bool chan_LS2Arbiter_LS1_end;
channel bool chan_LS2Arbiter_LS2_end;
channel bool chan_LS2Arbiter_LS3_end;
......@@ -124,6 +123,8 @@ channel bool chan_LS2Arbiter_LS6_end;
channel bool chan_LS2Arbiter_LS7_end;
channel bool chan_LS2Arbiter_LS8_end;
channel bool chan_LS2Arbiter_LS9_end;
// Get LS-eval-count, new energy, new genotype from LSs
channel float2 chan_LS2GA_LS1_evalenergy __attribute__((depth(2)));
channel float2 chan_LS2GA_LS2_evalenergy __attribute__((depth(2)));
channel float2 chan_LS2GA_LS3_evalenergy __attribute__((depth(2)));
......@@ -143,6 +144,7 @@ channel float chan_LS2GA_LS7_genotype __attribute__((depth(CHAN_DEPTH_G
channel float chan_LS2GA_LS8_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_LS2GA_LS9_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
// Turn-off signals to LSs
channel bool chan_GA2LS_Off1_active;
channel bool chan_GA2LS_Off2_active;
channel bool chan_GA2LS_Off3_active;
......@@ -153,13 +155,24 @@ channel bool chan_GA2LS_Off7_active;
channel bool chan_GA2LS_Off8_active;
channel bool chan_GA2LS_Off9_active;
// IGL_Arbiter -> Conform
// Send genotype-producer-channel selector and genotype
// from IGL_Arbiter to Conform