Commit bbb8ee40 authored by Leonardo Solis's avatar Leonardo Solis

#31, removed several host compilation warnings

parent 827e55c2
......@@ -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];
......
......@@ -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;
......
......@@ -522,7 +522,7 @@ void get_commandpars(const int* argc,
if (mypars->pop_size < mypars->gen_pdbs)
{
printf("Warning: value of -npdb argument igonred. Value mustn't be greater than the population size.\n");
printf("Warning: value of -npdb argument ignored. 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
......
......@@ -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: %lu\n", mypars->num_of_runs);
printf("Execution run: ");
for (unsigned int run_cnt = 0; run_cnt < mypars->num_of_runs; run_cnt++) {
......
......@@ -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)
......
......@@ -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));
......
  • These two warnings still appear during host compilation (seem to be not so critical):

    ./host/src/calcenergy.cpp: In function ‘int gen_rotlist(Liganddata*, int*)’:
    ./host/src/calcenergy.cpp:559:61: warning: array subscript has type ‘char’ [-Wchar-subscripts]
           if (myligand->atom_rotbonds[atom_id][rotbond_candidate] != 0) //if the atom has to be rotated around current candidate
                                                                 ^
    ./host/src/processresult.cpp: In function ‘void make_resfiles(float*, float*, const Liganddata*, const Liganddata*, const Dockpars*, int, int, const Gridinfo*, const float*, float*, const int*, char**, int, int, Ligandresult*)’:
    ./host/src/processresult.cpp:254:8: warning: unused variable ‘temp_genotype’ [-Wunused-variable]
      float temp_genotype[GENOTYPE_LENGTH_IN_GLOBMEM];
            ^~~~~~~~~~~~~
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