Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
docking
ocladock-fpga
Commits
09d4291a
Commit
09d4291a
authored
Nov 11, 2018
by
Leonardo Solis
Browse files
#31, removed several host compilation warnings
Former-commit-id:
bbb8ee40
parent
57d3e6aa
Changes
6
Hide whitespace changes
Inline
Side-by-side
ofdock_taskpar_xl/host/inc/getparameters.h
View file @
09d4291a
...
...
@@ -37,7 +37,7 @@ typedef struct
unsigned
long
max_num_of_iters
;
unsigned
long
pop_size
;
char
initpop_gen_or_loadfile
;
char
gen_pdbs
;
unsigned
char
gen_pdbs
;
char
fldfile
[
128
];
char
ligandfile
[
128
];
float
ref_ori_angles
[
3
];
...
...
ofdock_taskpar_xl/host/src/calcenergy.cpp
View file @
09d4291a
...
...
@@ -433,7 +433,7 @@ int prepare_conststatic_fields_for_gpu(Liganddata* myligand_reference,
float
phi
,
theta
,
genrotangle
;
//reference orientation quaternions
for
(
i
=
0
;
i
<
mypars
->
num_of_runs
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
mypars
->
num_of_runs
;
i
++
)
{
//printf("Pregenerated angles for run %d: %f %f %f\n", i, cpu_ref_ori_angles[3*i], cpu_ref_ori_angles[3*i+1], cpu_ref_ori_angles[3*i+2]);
phi
=
cpu_ref_ori_angles
[
3
*
i
]
*
DEG_TO_RAD
;
...
...
ofdock_taskpar_xl/host/src/getparameters.cpp
View file @
09d4291a
...
...
@@ -522,7 +522,7 @@ void get_commandpars(const int* argc,
if
(
mypars
->
pop_size
<
mypars
->
gen_pdbs
)
{
printf
(
"Warning: value of -npdb argument ig
o
nred. Value mustn't be greater than the population size.
\n
"
);
printf
(
"Warning: value of -npdb argument ign
o
red. Value mustn't be greater than the population size.
\n
"
);
mypars
->
gen_pdbs
=
1
;
}
...
...
@@ -545,13 +545,17 @@ void gen_initpop_and_reflig(Dockpars* mypars,
//In addition, as part of reference orientation handling,
//the function moves myligand to origo and scales it according to grid spacing.
{
int
entity_id
,
gene_id
;
int
gen_pop
,
gen_seeds
;
//int entity_id;
//int gene_id;
int
gen_pop
;
//int gen_seeds;
FILE
*
fp
;
/*
float init_orientation[MAX_NUM_OF_ROTBONDS+6];
*/
double
movvec_to_origo
[
3
];
int
pop_size
=
mypars
->
pop_size
;
unsigned
int
pop_size
=
mypars
->
pop_size
;
//initial population
gen_pop
=
0
;
...
...
@@ -576,8 +580,8 @@ void gen_initpop_and_reflig(Dockpars* mypars,
}
else
{
for
(
entity_id
=
0
;
entity_id
<
pop_size
;
entity_id
++
)
for
(
gene_id
=
0
;
gene_id
<
MAX_NUM_OF_ROTBONDS
+
6
;
gene_id
++
)
for
(
unsigned
int
entity_id
=
0
;
entity_id
<
pop_size
;
entity_id
++
)
for
(
unsigned
char
gene_id
=
0
;
gene_id
<
MAX_NUM_OF_ROTBONDS
+
6
;
gene_id
++
)
//fscanf(fp, "%f", &(init_populations[entity_id*GENOTYPE_LENGTH_IN_GLOBMEM+gene_id]));
fscanf
(
fp
,
"%f"
,
&
(
init_populations
[
entity_id
*
ACTUAL_GENOTYPE_LENGTH
+
gene_id
]));
...
...
@@ -598,13 +602,13 @@ void gen_initpop_and_reflig(Dockpars* mypars,
//Generating initial population
if
(
gen_pop
==
1
)
{
for
(
entity_id
=
0
;
entity_id
<
pop_size
*
mypars
->
num_of_runs
;
entity_id
++
)
for
(
gene_id
=
0
;
gene_id
<
3
;
gene_id
++
)
for
(
unsigned
int
entity_id
=
0
;
entity_id
<
pop_size
*
mypars
->
num_of_runs
;
entity_id
++
)
for
(
unsigned
char
gene_id
=
0
;
gene_id
<
3
;
gene_id
++
)
//init_populations[entity_id*GENOTYPE_LENGTH_IN_GLOBMEM+gene_id] = (float) myrand()*(mygrid->size_xyz_angstr[gene_id]);
init_populations
[
entity_id
*
ACTUAL_GENOTYPE_LENGTH
+
gene_id
]
=
(
float
)
myrand
()
*
(
mygrid
->
size_xyz_angstr
[
gene_id
]);
for
(
entity_id
=
0
;
entity_id
<
pop_size
*
mypars
->
num_of_runs
;
entity_id
++
)
for
(
gene_id
=
3
;
gene_id
<
MAX_NUM_OF_ROTBONDS
+
6
;
gene_id
++
)
for
(
unsigned
int
entity_id
=
0
;
entity_id
<
pop_size
*
mypars
->
num_of_runs
;
entity_id
++
)
for
(
unsigned
char
gene_id
=
3
;
gene_id
<
MAX_NUM_OF_ROTBONDS
+
6
;
gene_id
++
)
if
(
gene_id
==
4
)
//init_populations[entity_id*GENOTYPE_LENGTH_IN_GLOBMEM+gene_id] = myrand()*180;
init_populations
[
entity_id
*
ACTUAL_GENOTYPE_LENGTH
+
gene_id
]
=
myrand
()
*
180
;
...
...
@@ -623,8 +627,8 @@ void gen_initpop_and_reflig(Dockpars* mypars,
printf
(
"Warning: can't create initpop.txt.
\n
"
);
else
{
for
(
entity_id
=
0
;
entity_id
<
pop_size
;
entity_id
++
)
for
(
gene_id
=
0
;
gene_id
<
MAX_NUM_OF_ROTBONDS
+
6
;
gene_id
++
)
for
(
unsigned
int
entity_id
=
0
;
entity_id
<
pop_size
;
entity_id
++
)
for
(
unsigned
char
gene_id
=
0
;
gene_id
<
MAX_NUM_OF_ROTBONDS
+
6
;
gene_id
++
)
//fprintf(fp, "%f ", init_populations[entity_id*GENOTYPE_LENGTH_IN_GLOBMEM+gene_id]);
fprintf
(
fp
,
"%f "
,
init_populations
[
entity_id
*
ACTUAL_GENOTYPE_LENGTH
+
gene_id
]);
...
...
@@ -639,12 +643,12 @@ void gen_initpop_and_reflig(Dockpars* mypars,
//genotypes should contain x, y and z genes in grid spacing instead of Angstroms
//(but was previously generated in Angstroms since fdock does the same)
for
(
entity_id
=
0
;
entity_id
<
pop_size
*
mypars
->
num_of_runs
;
entity_id
++
)
for
(
gene_id
=
0
;
gene_id
<
3
;
gene_id
++
)
for
(
unsigned
int
entity_id
=
0
;
entity_id
<
pop_size
*
mypars
->
num_of_runs
;
entity_id
++
)
for
(
unsigned
char
gene_id
=
0
;
gene_id
<
3
;
gene_id
++
)
//init_populations [entity_id*GENOTYPE_LENGTH_IN_GLOBMEM+gene_id] = init_populations [entity_id*GENOTYPE_LENGTH_IN_GLOBMEM+gene_id]/mygrid->spacing;
init_populations
[
entity_id
*
ACTUAL_GENOTYPE_LENGTH
+
gene_id
]
=
init_populations
[
entity_id
*
ACTUAL_GENOTYPE_LENGTH
+
gene_id
]
/
mygrid
->
spacing
;
/*
/*
//changing initial orientation of reference ligand
for (uint i=0; i<38; i++)
switch (i)
...
...
@@ -660,12 +664,12 @@ void gen_initpop_and_reflig(Dockpars* mypars,
//change_conform_f(myligand, init_orientation, 0);
change_conform_f(myligand, init_orientation, ref_ori_angles, 0);
*/
*/
//initial orientation will be calculated during docking,
//only the required angles are generated here,
//but the angles possibly read from file are ignored
for
(
int
i
=
0
;
i
<
mypars
->
num_of_runs
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
mypars
->
num_of_runs
;
i
++
)
{
ref_ori_angles
[
3
*
i
]
=
(
float
)
(
myrand
()
*
360.0
);
//phi
ref_ori_angles
[
3
*
i
+
1
]
=
(
float
)
(
myrand
()
*
180.0
);
//theta
...
...
ofdock_taskpar_xl/host/src/performdocking.cpp
View file @
09d4291a
...
...
@@ -803,7 +803,7 @@ filled with clock() */
#endif
#endif
printf
(
"Docking runs to be executed: %u
\n
"
,
mypars
->
num_of_runs
);
printf
(
"Docking runs to be executed: %
l
u
\n
"
,
mypars
->
num_of_runs
);
printf
(
"Execution run: "
);
for
(
unsigned
int
run_cnt
=
0
;
run_cnt
<
mypars
->
num_of_runs
;
run_cnt
++
)
{
...
...
ofdock_taskpar_xl/host/src/processligand.cpp
View file @
09d4291a
...
...
@@ -853,11 +853,16 @@ int gen_new_pdbfile(const char* oldpdb, const char* newpdb, const Liganddata* my
FILE
*
fp_new
;
char
tempstr
[
256
];
char
tempstr_short
[
32
];
int
acnt_oldlig
,
acnt_newlig
;
int
acnt_oldlig
;
/*
int acnt_newlig;
*/
int
i
,
j
;
acnt_oldlig
=
0
;
/*
acnt_newlig = 0;
*/
fp_old
=
fopen
(
oldpdb
,
"r"
);
if
(
fp_old
==
NULL
)
...
...
ofdock_taskpar_xl/host/src/processresult.cpp
View file @
09d4291a
...
...
@@ -8,7 +8,9 @@ void arrange_result(float* final_population, float* energies, const int pop_size
//the population, the arrangement will be performed only on the first pop_size part of final_population.
{
int
i
,
j
;
//float temp_genotype[GENOTYPE_LENGTH_IN_GLOBMEM];
/*
float temp_genotype[GENOTYPE_LENGTH_IN_GLOBMEM];
*/
float
temp_genotype
[
ACTUAL_GENOTYPE_LENGTH
];
float
temp_energy
;
...
...
@@ -16,12 +18,11 @@ void arrange_result(float* final_population, float* energies, const int pop_size
for
(
i
=
pop_size
-
2
;
i
>=
j
;
i
--
)
//arrange according to sum of inter- and intramolecular energies
if
(
energies
[
i
]
>
energies
[
i
+
1
])
{
/*
/*
memcpy(temp_genotype, final_population+i*GENOTYPE_LENGTH_IN_GLOBMEM, GENOTYPE_LENGTH_IN_GLOBMEM*sizeof(float));
memcpy(final_population+i*GENOTYPE_LENGTH_IN_GLOBMEM, final_population+(i+1)*GENOTYPE_LENGTH_IN_GLOBMEM, GENOTYPE_LENGTH_IN_GLOBMEM*sizeof(float));
memcpy(final_population+(i+1)*GENOTYPE_LENGTH_IN_GLOBMEM, temp_genotype, GENOTYPE_LENGTH_IN_GLOBMEM*sizeof(float));
*/
*/
memcpy
(
temp_genotype
,
final_population
+
i
*
ACTUAL_GENOTYPE_LENGTH
,
ACTUAL_GENOTYPE_LENGTH
*
sizeof
(
float
));
memcpy
(
final_population
+
i
*
ACTUAL_GENOTYPE_LENGTH
,
final_population
+
(
i
+
1
)
*
ACTUAL_GENOTYPE_LENGTH
,
ACTUAL_GENOTYPE_LENGTH
*
sizeof
(
float
));
memcpy
(
final_population
+
(
i
+
1
)
*
ACTUAL_GENOTYPE_LENGTH
,
temp_genotype
,
ACTUAL_GENOTYPE_LENGTH
*
sizeof
(
float
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment