Commit eedc88eb authored by mkanski's avatar mkanski
Browse files

MPI_Abort removed from reax/c/kk + fixed some declarations

parent 88755aef
Loading
Loading
Loading
Loading
+33 −41
Original line number Diff line number Diff line
@@ -447,23 +447,23 @@ int PairReaxCKokkos<DeviceType>::Init_Lookup_Tables()
  num_atom_types = atom->ntypes;
  dr = control->nonb_cut / control->tabulate;
  h = (double*)
    smalloc( (control->tabulate+2) * sizeof(double), "lookup:h", world );
    smalloc( control->error_ptr, (control->tabulate+2) * sizeof(double), "lookup:h");
  fh = (double*)
    smalloc( (control->tabulate+2) * sizeof(double), "lookup:fh", world );
    smalloc( control->error_ptr, (control->tabulate+2) * sizeof(double), "lookup:fh");
  fvdw = (double*)
    smalloc( (control->tabulate+2) * sizeof(double), "lookup:fvdw", world );
    smalloc( control->error_ptr, (control->tabulate+2) * sizeof(double), "lookup:fvdw");
  fCEvd = (double*)
    smalloc( (control->tabulate+2) * sizeof(double), "lookup:fCEvd", world );
    smalloc( control->error_ptr, (control->tabulate+2) * sizeof(double), "lookup:fCEvd");
  fele = (double*)
    smalloc( (control->tabulate+2) * sizeof(double), "lookup:fele", world );
    smalloc( control->error_ptr, (control->tabulate+2) * sizeof(double), "lookup:fele");
  fCEclmb = (double*)
    smalloc( (control->tabulate+2) * sizeof(double), "lookup:fCEclmb", world );
    smalloc( control->error_ptr, (control->tabulate+2) * sizeof(double), "lookup:fCEclmb");

  LR = (LR_lookup_table**)
    scalloc( num_atom_types+1, sizeof(LR_lookup_table*), "lookup:LR", world );
    scalloc( control->error_ptr, num_atom_types+1, sizeof(LR_lookup_table*), "lookup:LR");
  for( i = 0; i < num_atom_types+1; ++i )
    LR[i] = (LR_lookup_table*)
      scalloc( num_atom_types+1, sizeof(LR_lookup_table), "lookup:LR[i]", world );
      scalloc( control->error_ptr, num_atom_types+1, sizeof(LR_lookup_table), "lookup:LR[i]");

  for( i = 1; i <= num_atom_types; ++i ) {
    for( j = i; j <= num_atom_types; ++j ) {
@@ -473,22 +473,18 @@ int PairReaxCKokkos<DeviceType>::Init_Lookup_Tables()
      LR[i][j].dx = dr;
      LR[i][j].inv_dx = control->tabulate / control->nonb_cut;
      LR[i][j].y = (LR_data*)
        smalloc( LR[i][j].n * sizeof(LR_data), "lookup:LR[i,j].y", world );
        smalloc( control->error_ptr, LR[i][j].n * sizeof(LR_data), "lookup:LR[i,j].y");
      LR[i][j].H = (cubic_spline_coef*)
        smalloc( LR[i][j].n*sizeof(cubic_spline_coef),"lookup:LR[i,j].H" ,
                 world );
        smalloc( control->error_ptr, LR[i][j].n*sizeof(cubic_spline_coef),"lookup:LR[i,j].H");
      LR[i][j].vdW = (cubic_spline_coef*)
        smalloc( LR[i][j].n*sizeof(cubic_spline_coef),"lookup:LR[i,j].vdW",
                 world);
        smalloc( control->error_ptr, LR[i][j].n*sizeof(cubic_spline_coef),"lookup:LR[i,j].vdW");
      LR[i][j].CEvd = (cubic_spline_coef*)
        smalloc( LR[i][j].n*sizeof(cubic_spline_coef),"lookup:LR[i,j].CEvd",
                 world);
        smalloc( control->error_ptr, LR[i][j].n*sizeof(cubic_spline_coef),"lookup:LR[i,j].CEvd");
      LR[i][j].ele = (cubic_spline_coef*)
        smalloc( LR[i][j].n*sizeof(cubic_spline_coef),"lookup:LR[i,j].ele",
                 world );
        smalloc( control->error_ptr, LR[i][j].n*sizeof(cubic_spline_coef),"lookup:LR[i,j].ele");
      LR[i][j].CEclmb = (cubic_spline_coef*)
        smalloc( LR[i][j].n*sizeof(cubic_spline_coef),
                 "lookup:LR[i,j].CEclmb", world );
        smalloc( control->error_ptr, LR[i][j].n*sizeof(cubic_spline_coef),
                 "lookup:LR[i,j].CEclmb");

      for( r = 1; r <= control->tabulate; ++r ) {
        LR_vdW_Coulomb(i, j, r * dr, &(LR[i][j].y[r]) );
@@ -512,24 +508,20 @@ int PairReaxCKokkos<DeviceType>::Init_Lookup_Tables()
      vlast_vdw = fCEvd[r-1];
      vlast_ele = fele[r-1];

      Natural_Cubic_Spline( &h[1], &fh[1],
                            &(LR[i][j].H[1]), control->tabulate+1, world );
      Natural_Cubic_Spline( control->error_ptr, &h[1], &fh[1],
                            &(LR[i][j].H[1]), control->tabulate+1 );

      Complete_Cubic_Spline( &h[1], &fvdw[1], v0_vdw, vlast_vdw,
                             &(LR[i][j].vdW[1]), control->tabulate+1,
                             world );
      Complete_Cubic_Spline( control->error_ptr, &h[1], &fvdw[1], v0_vdw, vlast_vdw,
                             &(LR[i][j].vdW[1]), control->tabulate+1 );

      Natural_Cubic_Spline( &h[1], &fCEvd[1],
                            &(LR[i][j].CEvd[1]), control->tabulate+1,
                            world );
      Natural_Cubic_Spline( control->error_ptr, &h[1], &fCEvd[1],
                            &(LR[i][j].CEvd[1]), control->tabulate+1 );

      Complete_Cubic_Spline( &h[1], &fele[1], v0_ele, vlast_ele,
                             &(LR[i][j].ele[1]), control->tabulate+1,
                             world );
      Complete_Cubic_Spline( control->error_ptr, &h[1], &fele[1], v0_ele, vlast_ele,
                             &(LR[i][j].ele[1]), control->tabulate+1 );

      Natural_Cubic_Spline( &h[1], &fCEclmb[1],
                            &(LR[i][j].CEclmb[1]), control->tabulate+1,
                            world );
      Natural_Cubic_Spline( control->error_ptr, &h[1], &fCEclmb[1],
                            &(LR[i][j].CEclmb[1]), control->tabulate+1 );
    }
  }
  free(h);
@@ -555,16 +547,16 @@ void PairReaxCKokkos<DeviceType>::Deallocate_Lookup_Tables()
  for( i = 0; i <= ntypes; ++i ) {
    for( j = i; j <= ntypes; ++j )
      if (LR[i][j].n) {
        sfree( LR[i][j].y, "LR[i,j].y" );
        sfree( LR[i][j].H, "LR[i,j].H" );
        sfree( LR[i][j].vdW, "LR[i,j].vdW" );
        sfree( LR[i][j].CEvd, "LR[i,j].CEvd" );
        sfree( LR[i][j].ele, "LR[i,j].ele" );
        sfree( LR[i][j].CEclmb, "LR[i,j].CEclmb" );
        sfree( control->error_ptr, LR[i][j].y, "LR[i,j].y" );
        sfree( control->error_ptr, LR[i][j].H, "LR[i,j].H" );
        sfree( control->error_ptr, LR[i][j].vdW, "LR[i,j].vdW" );
        sfree( control->error_ptr, LR[i][j].CEvd, "LR[i,j].CEvd" );
        sfree( control->error_ptr, LR[i][j].ele, "LR[i,j].ele" );
        sfree( control->error_ptr, LR[i][j].CEclmb, "LR[i,j].CEclmb" );
      }
    sfree( LR[i], "LR[i]" );
    sfree( control->error_ptr, LR[i], "LR[i]" );
  }
  sfree( LR, "LR" );
  sfree( control->error_ptr, LR, "LR" );
}

/* ---------------------------------------------------------------------- */
+2 −2
Original line number Diff line number Diff line
@@ -32,10 +32,10 @@
void Tridiagonal_Solve( const double *a, const double *b,
                        double *c, double *d, double *x, unsigned int n);

void Natural_Cubic_Spline( LAMMPS_NS::LAMMPS*, const double *h, const double *f,
void Natural_Cubic_Spline( LAMMPS_NS::Error*, const double *h, const double *f,
                           cubic_spline_coef *coef, unsigned int n );

void Complete_Cubic_Spline( LAMMPS_NS::LAMMPS*, const double *h, const double *f, double v0, double vlast,
void Complete_Cubic_Spline( LAMMPS_NS::Error*, const double *h, const double *f, double v0, double vlast,
                            cubic_spline_coef *coef, unsigned int n );

int Init_Lookup_Tables( reax_system*, control_params*, storage*,