From f0a3628a00a8f56572e32a91502bcaec7e181366 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 18 Oct 2019 07:14:16 -0400 Subject: [PATCH] reduce compiler warnings --- src/USER-OMP/pair_reaxc_omp.cpp | 13 +++++-------- src/USER-OMP/reaxc_forces_omp.cpp | 22 +++++++++++----------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/USER-OMP/pair_reaxc_omp.cpp b/src/USER-OMP/pair_reaxc_omp.cpp index fa6e8f54e5..8743fb8e4a 100644 --- a/src/USER-OMP/pair_reaxc_omp.cpp +++ b/src/USER-OMP/pair_reaxc_omp.cpp @@ -285,14 +285,13 @@ void PairReaxCOMP::compute(int eflag, int vflag) if (vflag_fdotr) virial_fdotr_compute(); -// Set internal timestep counter to that of LAMMPS + // Set internal timestep counter to that of LAMMPS data->step = update->ntimestep; Output_Results( system, control, data, &lists, out_control, mpi_data ); // populate tmpid and tmpbo arrays for fix reax/c/species - int i, j; if(fixspecies_flag) { if (system->N > nmax) { @@ -306,8 +305,8 @@ void PairReaxCOMP::compute(int eflag, int vflag) #if defined(_OPENMP) #pragma omp parallel for collapse(2) schedule(static) default(shared) #endif - for (i = 0; i < system->N; i ++) - for (j = 0; j < MAXSPECBOND; j ++) { + for (int i = 0; i < system->N; i++) + for (int j = 0; j < MAXSPECBOND; j++) { tmpbo[i][j] = 0.0; tmpid[i][j] = 0; } @@ -613,13 +612,11 @@ void PairReaxCOMP::read_reax_forces(int /* vflag */) void PairReaxCOMP::FindBond() { const double bo_cut = 0.10; - int i; #if defined(_OPENMP) -#pragma omp parallel for schedule(static) default(shared) \ - private(i) +#pragma omp parallel for schedule(static) default(shared) #endif - for (i = 0; i < system->n; i++) { + for (int i = 0; i < system->n; i++) { int j, pj, nj; double bo_tmp; bond_data *bo_ij; diff --git a/src/USER-OMP/reaxc_forces_omp.cpp b/src/USER-OMP/reaxc_forces_omp.cpp index 971667cc2d..1bde0fb970 100644 --- a/src/USER-OMP/reaxc_forces_omp.cpp +++ b/src/USER-OMP/reaxc_forces_omp.cpp @@ -265,12 +265,12 @@ void Compute_Total_ForceOMP( reax_system *system, control_params *control, void Validate_ListsOMP(reax_system *system, storage * /*workspace*/, reax_list **lists, int step, int n, int N, int numH, MPI_Comm /*comm*/) { - int i, comp, Hindex; + int comp, Hindex; reax_list *bonds, *hbonds; double saferzone = system->saferzone; #if defined(_OPENMP) -#pragma omp parallel default(shared) private(i, comp, Hindex) +#pragma omp parallel default(shared) private(comp,Hindex) #endif { @@ -281,7 +281,7 @@ void Validate_ListsOMP(reax_system *system, storage * /*workspace*/, reax_list * #if defined(_OPENMP) #pragma omp for schedule(guided) #endif - for( i = 0; i < N; ++i ) { + for(int i = 0; i < N; ++i ) { system->my_atoms[i].num_bonds = MAX(Num_Entries(i,bonds)*2, MIN_BONDS); if (i < N-1) @@ -305,7 +305,7 @@ void Validate_ListsOMP(reax_system *system, storage * /*workspace*/, reax_list * #if defined(_OPENMP) #pragma omp for schedule(guided) #endif - for( i = 0; i < n; ++i ) { + for(int i = 0; i < n; ++i ) { Hindex = system->my_atoms[i].Hindex; if (Hindex > -1) { system->my_atoms[i].num_hbonds = @@ -338,7 +338,7 @@ void Init_Forces_noQEq_OMP( reax_system *system, control_params *control, startTimeBase = MPI_Wtime(); #endif - int i, j, pj; + int j, pj; int start_i, end_i; int type_i, type_j; int ihb, jhb, ihb_top, jhb_top; @@ -367,7 +367,7 @@ void Init_Forces_noQEq_OMP( reax_system *system, control_params *control, #if defined(_OPENMP) #pragma omp parallel default(shared) \ - private(i, atom_i, type_i, start_i, end_i, sbp_i, btop_i, ihb, ihb_top, \ + private(atom_i, type_i, start_i, end_i, sbp_i, btop_i, ihb, ihb_top, \ j, atom_j, type_j, pj, sbp_j, nbr_pj, jhb, twbp) #endif { @@ -382,9 +382,9 @@ void Init_Forces_noQEq_OMP( reax_system *system, control_params *control, long totalReductionSize = system->N * nthreads; #if defined(_OPENMP) -#pragma omp for schedule(dynamic,50) reduction(+ : num_bonds) +#pragma omp for schedule(dynamic,50) reduction(+:num_bonds) #endif - for (i = 0; i < system->N; ++i) { + for (int i = 0; i < system->N; ++i) { atom_i = &(system->my_atoms[i]); type_i = atom_i->type; sbp_i = &(system->reax_param.sbp[type_i]); @@ -490,7 +490,7 @@ void Init_Forces_noQEq_OMP( reax_system *system, control_params *control, #if defined(_OPENMP) #pragma omp for schedule(dynamic,50) #endif - for(i=0; iN; i++) + for(int i=0; iN; i++) for(int t=0; tN + i; workspace->dDeltap_self[i][0] += tmp_ddelta[indx][0]; @@ -506,7 +506,7 @@ void Init_Forces_noQEq_OMP( reax_system *system, control_params *control, #if defined(_OPENMP) #pragma omp for schedule(dynamic,50) reduction(+ : num_hbonds) #endif - for (i = 0; i < system->n; ++i) { + for (int i = 0; i < system->n; ++i) { atom_i = &(system->my_atoms[i]); type_i = atom_i->type; sbp_i = &(system->reax_param.sbp[type_i]); @@ -572,7 +572,7 @@ void Init_Forces_noQEq_OMP( reax_system *system, control_params *control, #if defined(_OPENMP) #pragma omp for schedule(guided) #endif - for(i=0; i