Commit 09d4291a authored by Leonardo Solis's avatar Leonardo Solis
Browse files

#31, removed several host compilation warnings


Former-commit-id: bbb8ee40
parent 57d3e6aa
...@@ -37,7 +37,7 @@ typedef struct ...@@ -37,7 +37,7 @@ typedef struct
unsigned long max_num_of_iters; unsigned long max_num_of_iters;
unsigned long pop_size; unsigned long pop_size;
char initpop_gen_or_loadfile; char initpop_gen_or_loadfile;
char gen_pdbs; unsigned char gen_pdbs;
char fldfile [128]; char fldfile [128];
char ligandfile [128]; char ligandfile [128];
float ref_ori_angles [3]; float ref_ori_angles [3];
......
...@@ -433,7 +433,7 @@ int prepare_conststatic_fields_for_gpu(Liganddata* myligand_reference, ...@@ -433,7 +433,7 @@ int prepare_conststatic_fields_for_gpu(Liganddata* myligand_reference,
float phi, theta, genrotangle; float phi, theta, genrotangle;
//reference orientation quaternions //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]); //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; phi = cpu_ref_ori_angles[3*i]*DEG_TO_RAD;
......
...@@ -522,7 +522,7 @@ void get_commandpars(const int* argc, ...@@ -522,7 +522,7 @@ void get_commandpars(const int* argc,
if (mypars->pop_size < mypars->gen_pdbs) 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; mypars->gen_pdbs = 1;
} }
...@@ -545,13 +545,17 @@ void gen_initpop_and_reflig(Dockpars* mypars, ...@@ -545,13 +545,17 @@ void gen_initpop_and_reflig(Dockpars* mypars,
//In addition, as part of reference orientation handling, //In addition, as part of reference orientation handling,
//the function moves myligand to origo and scales it according to grid spacing. //the function moves myligand to origo and scales it according to grid spacing.
{ {
int entity_id, gene_id; //int entity_id;
int gen_pop, gen_seeds; //int gene_id;
int gen_pop;
//int gen_seeds;
FILE* fp; FILE* fp;
/*
float init_orientation[MAX_NUM_OF_ROTBONDS+6]; float init_orientation[MAX_NUM_OF_ROTBONDS+6];
*/
double movvec_to_origo[3]; double movvec_to_origo[3];
int pop_size = mypars->pop_size; unsigned int pop_size = mypars->pop_size;
//initial population //initial population
gen_pop = 0; gen_pop = 0;
...@@ -576,8 +580,8 @@ void gen_initpop_and_reflig(Dockpars* mypars, ...@@ -576,8 +580,8 @@ void gen_initpop_and_reflig(Dockpars* mypars,
} }
else else
{ {
for (entity_id=0; entity_id<pop_size; entity_id++) for (unsigned int entity_id=0; entity_id<pop_size; entity_id++)
for (gene_id=0; gene_id<MAX_NUM_OF_ROTBONDS+6; gene_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*GENOTYPE_LENGTH_IN_GLOBMEM+gene_id]));
fscanf(fp, "%f", &(init_populations[entity_id*ACTUAL_GENOTYPE_LENGTH+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, ...@@ -598,13 +602,13 @@ void gen_initpop_and_reflig(Dockpars* mypars,
//Generating initial population //Generating initial population
if (gen_pop == 1) if (gen_pop == 1)
{ {
for (entity_id=0; entity_id<pop_size*mypars->num_of_runs; entity_id++) for (unsigned int entity_id=0; entity_id<pop_size*mypars->num_of_runs; entity_id++)
for (gene_id=0; gene_id<3; gene_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*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]); 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 (unsigned int 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 char gene_id=3; gene_id<MAX_NUM_OF_ROTBONDS+6; gene_id++)
if (gene_id == 4) if (gene_id == 4)
//init_populations[entity_id*GENOTYPE_LENGTH_IN_GLOBMEM+gene_id] = myrand()*180; //init_populations[entity_id*GENOTYPE_LENGTH_IN_GLOBMEM+gene_id] = myrand()*180;
init_populations[entity_id*ACTUAL_GENOTYPE_LENGTH+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, ...@@ -623,8 +627,8 @@ void gen_initpop_and_reflig(Dockpars* mypars,
printf("Warning: can't create initpop.txt.\n"); printf("Warning: can't create initpop.txt.\n");
else else
{ {
for (entity_id=0; entity_id<pop_size; entity_id++) for (unsigned int entity_id=0; entity_id<pop_size; entity_id++)
for (gene_id=0; gene_id<MAX_NUM_OF_ROTBONDS+6; gene_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*GENOTYPE_LENGTH_IN_GLOBMEM+gene_id]);
fprintf(fp, "%f ", init_populations[entity_id*ACTUAL_GENOTYPE_LENGTH+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, ...@@ -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 //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) //(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 (unsigned int entity_id=0; entity_id<pop_size*mypars->num_of_runs; entity_id++)
for (gene_id=0; gene_id<3; gene_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*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; 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 //changing initial orientation of reference ligand
for (uint i=0; i<38; i++) for (uint i=0; i<38; i++)
switch (i) switch (i)
...@@ -660,12 +664,12 @@ void gen_initpop_and_reflig(Dockpars* mypars, ...@@ -660,12 +664,12 @@ void gen_initpop_and_reflig(Dockpars* mypars,
//change_conform_f(myligand, init_orientation, 0); //change_conform_f(myligand, init_orientation, 0);
change_conform_f(myligand, init_orientation, ref_ori_angles, 0); change_conform_f(myligand, init_orientation, ref_ori_angles, 0);
*/ */
//initial orientation will be calculated during docking, //initial orientation will be calculated during docking,
//only the required angles are generated here, //only the required angles are generated here,
//but the angles possibly read from file are ignored //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] = (float) (myrand()*360.0); //phi
ref_ori_angles[3*i+1] = (float) (myrand()*180.0); //theta ref_ori_angles[3*i+1] = (float) (myrand()*180.0); //theta
......
...@@ -803,7 +803,7 @@ filled with clock() */ ...@@ -803,7 +803,7 @@ filled with clock() */
#endif #endif
#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: "); printf("Execution run: ");
for (unsigned int run_cnt = 0; run_cnt < mypars->num_of_runs; run_cnt++) { 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 ...@@ -853,11 +853,16 @@ int gen_new_pdbfile(const char* oldpdb, const char* newpdb, const Liganddata* my
FILE* fp_new; FILE* fp_new;
char tempstr [256]; char tempstr [256];
char tempstr_short [32]; char tempstr_short [32];
int acnt_oldlig, acnt_newlig; int acnt_oldlig;
/*
int acnt_newlig;
*/
int i,j; int i,j;
acnt_oldlig = 0; acnt_oldlig = 0;
/*
acnt_newlig = 0; acnt_newlig = 0;
*/
fp_old = fopen(oldpdb, "r"); fp_old = fopen(oldpdb, "r");
if (fp_old == NULL) if (fp_old == NULL)
......
...@@ -8,7 +8,9 @@ void arrange_result(float* final_population, float* energies, const int pop_size ...@@ -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. //the population, the arrangement will be performed only on the first pop_size part of final_population.
{ {
int i,j; 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_genotype[ACTUAL_GENOTYPE_LENGTH];
float temp_energy; float temp_energy;
...@@ -16,12 +18,11 @@ void arrange_result(float* final_population, float* energies, const int pop_size ...@@ -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 for (i=pop_size-2; i>=j; i--) //arrange according to sum of inter- and intramolecular energies
if (energies[i] > energies[i+1]) if (energies[i] > energies[i+1])
{ {
/* /*
memcpy(temp_genotype, final_population+i*GENOTYPE_LENGTH_IN_GLOBMEM, GENOTYPE_LENGTH_IN_GLOBMEM*sizeof(float)); 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*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(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(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*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)); memcpy(final_population+(i+1)*ACTUAL_GENOTYPE_LENGTH, temp_genotype, ACTUAL_GENOTYPE_LENGTH*sizeof(float));
......
Supports Markdown
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