diff --git a/PuReMD/src/basic_comm.c b/PuReMD/src/basic_comm.c index 92c834efd5a51a7fa708b546570b7992b837cf85..a6606458caeb3db30d939ecc9b10fef52a85bff7 100644 --- a/PuReMD/src/basic_comm.c +++ b/PuReMD/src/basic_comm.c @@ -170,19 +170,19 @@ void Dist_NT( reax_system* system, mpi_datatypes *mpi_data, } } - for( d = 0; d < 6; ++d ) + /*for( d = 0; d < 6; ++d ) { nbr = &(system->my_nbrs[d]); if ( nbr->atoms_cnt ) { MPI_Wait( &(req[d]), &(stat[d]) ); } - } + }*/ - /*for( d = 0; d < count; ++d ) + for( d = 0; d < count; ++d ) { MPI_Waitany( REAX_MAX_NT_NBRS, req, &index, stat); - }*/ + } #if defined(DEBUG) fprintf( stderr, "p%d dist: done\n", system->my_rank ); @@ -326,8 +326,7 @@ void Coll_NT( reax_system* system, mpi_datatypes *mpi_data, if ( out_bufs[d].cnt ) { count++; - MPI_Irecv(in[d], out_bufs[d].cnt, type, nbr->receive_rank, d, comm, &(req[d])); - //fprintf( stdout, "p%d coll: d = %d, receive_rank = %d, cnt = %d\n", system->my_rank, d, nbr->receive_rank, out_bufs[d].cnt ); + MPI_Irecv(in[d], out_bufs[d].cnt, type, nbr->rank, d, comm, &(req[d])); } } @@ -338,31 +337,24 @@ void Coll_NT( reax_system* system, mpi_datatypes *mpi_data, if ( nbr->atoms_cnt ) { MPI_Send( buf + nbr->atoms_str * scale, nbr->atoms_cnt, type, - nbr->rank, d, comm ); - //fprintf( stdout, "p%d coll: d = %d, send_rank = %d, cnt = %d\n", system->my_rank, d, nbr->rank, nbr->atoms_cnt ); + nbr->receive_rank, d, comm ); } } - for( d = 0; d < 6; ++d ) + /*for( d = 0; d < 6; ++d ) { - //fprintf( stderr, "p%d coll: d = %d\n", system->my_rank, d ); - //fflush( stdout ); if ( out_bufs[d].cnt ) { MPI_Wait( &(req[d]), &(stat[d])); - //fprintf( stderr, "p%d coll: %d status complete\n", system->my_rank, d ); - //fflush( stdout ); unpack( in[d], buf, out_bufs + d ); } - } - //fprintf( stderr, "p%d coll: entered\n", system->my_rank ); - fflush( stdout ); + }*/ - /*for( d = 0; d < count; ++d ) + for( d = 0; d < count; ++d ) { MPI_Waitany( REAX_MAX_NT_NBRS, req, &index, stat); unpack( in[index], buf, out_bufs + index ); - }*/ + } #if defined(DEBUG) fprintf( stderr, "p%d coll: done\n", system->my_rank ); diff --git a/PuReMD/src/forces.c b/PuReMD/src/forces.c index 93cbe8cfe3c25dcd62c6ce1f122205007d0a9565..bd9fa99da8d4ceb1db3efb0eba17f6140f1690c1 100644 --- a/PuReMD/src/forces.c +++ b/PuReMD/src/forces.c @@ -412,15 +412,13 @@ void Init_Forces( reax_system *system, control_params *control, } #endif - //TODO: remove those variables - int local_to_local = 0; - //FILE *fp; + /*int local_to_local = 0; + FILE *fp;*/ #if defined(NEUTRAL_TERRITORY) - //TODO: remove those variables - int local_to_nt = 0; + /*int local_to_nt = 0; int nt_to_local = 0; int nt_to_nt = 0; - //fp = fopen( "NT_Pairs.txt", "w" ); + fp = fopen( "NT_Pairs.txt", "w" );*/ int mark[6]; mark[0] = mark[1] = 1; mark[2] = mark[3] = mark[4] = mark[5] = 2; @@ -474,9 +472,8 @@ void Init_Forces( reax_system *system, control_params *control, H->entries[Htop].j = i; H->entries[Htop].val = sbp_i->eta; ++Htop; - //TODO: - //fprintf( fp, "%d %d\n", atom_i->orig_id, atom_i->orig_id ); - ++local_to_local; + /*fprintf( fp, "%d %d\n", atom_i->orig_id, atom_i->orig_id ); + ++local_to_local;*/ if ( control->hbond_cut > 0 ) { @@ -547,16 +544,15 @@ void Init_Forces( reax_system *system, control_params *control, #if defined(NEUTRAL_TERRITORY) if( atom_j->nt_dir > 0 || j < system->n ) { - //TODO //fprintf( fp, "%d %d\n", atom_i->orig_id, atom_j->orig_id ); if( j < system->n ) { - ++local_to_local; + //++local_to_local; H->entries[Htop].j = j; } else { - ++local_to_nt; + //++local_to_nt; H->entries[Htop].j = atom_j->pos; } @@ -571,10 +567,9 @@ void Init_Forces( reax_system *system, control_params *control, ++Htop; } #else - //TODO - //fprintf( fp, "%d %d\n", atom_i->orig_id, atom_j->orig_id ); + /*fprintf( fp, "%d %d\n", atom_i->orig_id, atom_j->orig_id ); if( j < system->n ) - ++local_to_local; + ++local_to_local;*/ H->entries[Htop].j = j; if ( control->tabulate == 0 ) { @@ -619,7 +614,6 @@ void Init_Forces( reax_system *system, control_params *control, else if ( local == 2 ) { /* H matrix entry */ - //TODO if( ( atom_j->nt_dir != -1 && mark[atom_i->nt_dir] != mark[atom_j->nt_dir] ) || ( j < system->n && atom_i->nt_dir != 0 )) { //fprintf( fp, "%d %d\n", atom_i->orig_id, atom_j->orig_id ); @@ -630,12 +624,12 @@ void Init_Forces( reax_system *system, control_params *control, } if( j < system->n ) { - ++nt_to_local; + //++nt_to_local; H->entries[Htop].j = j; } else { - ++nt_to_nt; + //++nt_to_nt; H->entries[Htop].j = atom_j->pos; } @@ -726,7 +720,7 @@ void Init_Forces( reax_system *system, control_params *control, } } - int Htot, localtot; +/* int Htot, localtot; MPI_Allreduce(&Htop, &Htot, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); MPI_Allreduce(&local_to_local, &localtot, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD); @@ -748,7 +742,7 @@ void Init_Forces( reax_system *system, control_params *control, fprintf( stdout, "total number of nt to nt entries across all matrices: %d\n", tot4 ); #endif fflush( stdout ); - } + }*/ workspace->realloc.Htop = Htop; workspace->realloc.num_bonds = num_bonds; diff --git a/PuReMD/src/init_md.c b/PuReMD/src/init_md.c index 9ea85cca95800896486f0655b3e895997c6ce783..4e3000b58763a22ae047c22d5806a6f1c903be1a 100644 --- a/PuReMD/src/init_md.c +++ b/PuReMD/src/init_md.c @@ -589,7 +589,7 @@ int Init_Lists( reax_system *system, control_params *control, comm = mpi_data->world; - if ( control->cm_solver_pre_comp_type == SAI_PC || 1 ) + if ( control->cm_solver_pre_comp_type == SAI_PC ) { far_nbr_list_format = FULL_LIST; cm_format = SYM_FULL_MATRIX; diff --git a/PuReMD/src/linear_solvers.c b/PuReMD/src/linear_solvers.c index 1d1ccc9a9960f932b6132721af7ad6f795088874..f9c9345f9548a5eb031c32b9fd82bc24ea10afd3 100644 --- a/PuReMD/src/linear_solvers.c +++ b/PuReMD/src/linear_solvers.c @@ -1192,9 +1192,6 @@ int CG( reax_system *system, control_params *control, simulation_data *data, storage *workspace, sparse_matrix *H, real *b, real tol, real *x, mpi_datatypes* mpi_data, FILE *fout, int nprocs ) { - fprintf(stdout, "%d %d\n", H->n, H->NT); - fflush(stdout); - int i, j, scale; real tmp, alpha, beta, b_norm; real sig_old, sig_new; @@ -1283,8 +1280,6 @@ int CG( reax_system *system, control_params *control, simulation_data *data, for ( i = 0; i < control->cm_solver_max_iters && sqrt(sig_new) / b_norm > tol; ++i ) { - //fprintf( stdout, "p%d, i = %d, res = %.6f\n", system->my_rank, i, sqrt(sig_new) / b_norm ); - //fflush( stdout ); t_start = Get_Time( ); #if defined(NEUTRAL_TERRITORY) Dist_NT( system, mpi_data, workspace->d, MPI_DOUBLE, scale, real_packer ); diff --git a/PuReMD/src/reax_types.h b/PuReMD/src/reax_types.h index 8a08c5ad572b1b818ce77b8e943fdfe5597cabd7..e91117f5e0c2603f2469d274c49e62a399f69f63 100644 --- a/PuReMD/src/reax_types.h +++ b/PuReMD/src/reax_types.h @@ -552,6 +552,7 @@ typedef struct int wsize, my_rank, num_nbrs; ivec my_coords; neighbor_proc my_nbrs[REAX_MAX_NBRS]; + neighbor_proc my_nt_nbrs[REAX_MAX_NT_NBRS]; int *global_offset; simulation_box big_box, my_box, my_ext_box; grid my_grid; @@ -561,7 +562,6 @@ typedef struct #if defined(NEUTRAL_TERRITORY) int num_nt_nbrs; - neighbor_proc my_nt_nbrs[REAX_MAX_NT_NBRS]; #endif } reax_system;