Commit f2f49e60 authored by mkanski's avatar mkanski
Browse files

Make some errors more elaborate + change some error->all to error->one

parent 799c16a8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -431,6 +431,7 @@ void PairReaxC::setup( )
    int *num_hbonds = fix_reax->num_hbonds;

    control->vlist_cut = neighbor->cutneighmax;
    control->me = comm->me;

    // determine the local and total capacity

+11 −6
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ char Read_Force_Field( FILE *fp, reax_interaction *reax,
  n = atoi(tmp[0]);
  if (n < 1) {
    if (me == 0)
      control->error_ptr->warning( FLERR, "Number of globals in ffield file is 0" );
      control->error_ptr->warning( FLERR, "Number of globals in ffield file is 0. The file will not be read." );
    fclose(fp);
    free(s);
    free(tmp);
@@ -141,6 +141,7 @@ char Read_Force_Field( FILE *fp, reax_interaction *reax,

  reax->gp.vdw_type = 0;

  char errmsg[1024];

  for( i = 0; i < reax->num_atom_types; i++ ) {
    /* line one */
@@ -152,7 +153,8 @@ char Read_Force_Field( FILE *fp, reax_interaction *reax,
        control->error_ptr->all(FLERR, "Force field file requires using 'lgvdw yes'");	
    
    if (c < 9) {
      control->error_ptr->all(FLERR,"Inconsistent ffield file");
      snprintf (errmsg, 1024, "Missing parameter(s) in line %s", s);
      control->error_ptr->all(FLERR, errmsg);
    }

    for( j = 0; j < (int)(strlen(tmp[0])); ++j )
@@ -174,7 +176,8 @@ char Read_Force_Field( FILE *fp, reax_interaction *reax,

    /* Sanity check */
    if (c < 8) {
      control->error_ptr->all(FLERR,"Inconsistent ffield file");
      snprintf (errmsg, 1024, "Missing parameter(s) in line %s", s);
      control->error_ptr->all(FLERR, errmsg);
    }

    val = atof(tmp[0]); reax->sbp[i].alpha      = val;
@@ -192,7 +195,8 @@ char Read_Force_Field( FILE *fp, reax_interaction *reax,

    /* Sanity check */
    if (c < 8) {
      control->error_ptr->all(FLERR,"Inconsistent ffield file");
      snprintf (errmsg, 1024, "Missing parameter(s) in line %s", s);
      control->error_ptr->all(FLERR, errmsg);
    }

    val = atof(tmp[0]); reax->sbp[i].r_pi_pi    = val;
@@ -210,7 +214,8 @@ char Read_Force_Field( FILE *fp, reax_interaction *reax,

    /* Sanity check */
    if (c < 8) {
      control->error_ptr->all(FLERR,"Inconsistent ffield file");
      snprintf (errmsg, 1024, "Missing parameter(s) in line %s", s);
      control->error_ptr->all(FLERR, errmsg);
    }

    val = atof(tmp[0]); reax->sbp[i].p_ovun2    = val;
@@ -287,7 +292,7 @@ char Read_Force_Field( FILE *fp, reax_interaction *reax,
        }
      } else {
        char errmsg[256];
        snprintf(errmsg, 256, "Inconsistent vdWaals-parameters "
        snprintf(errmsg, 256, "Inconsistent vdWaals-parameters: "
                 "No shielding or inner-wall set for element %s",
                 reax->sbp[i].name);
        control->error_ptr->all(FLERR, errmsg);
+1 −1
Original line number Diff line number Diff line
@@ -168,7 +168,7 @@ void Validate_Lists( reax_system *system, storage * /*workspace*/, reax_list **l
          char errmsg[256];
          snprintf(errmsg, 256, "step%d-hbondchk failed: H=%d end(H)=%d str(H+1)=%d\n",
                  step, Hindex, End_Index(Hindex,hbonds), comp );
          system->error_ptr->all(FLERR, errmsg);
          system->error_ptr->one(FLERR, errmsg);
        }
      }
    }
+7 −22
Original line number Diff line number Diff line
@@ -223,49 +223,34 @@ void Initialize( reax_system *system, control_params *control,


  if (Init_MPI_Datatypes(system, workspace, mpi_data, comm, msg) == FAILURE) {

    snprintf(errmsg, 128, "Could not create datatypes on thread %d",
              system->my_rank);
    control->error_ptr->one(FLERR,errmsg);
    control->error_ptr->one(FLERR,"Could not create datatypes");
  }

  if (Init_System(system, control, msg) == FAILURE) {
    snprintf(errmsg, 128, "System could not be initialized on thread %d",
              system->my_rank);
    control->error_ptr->one(FLERR,errmsg);
    control->error_ptr->one(FLERR,"System could not be initialized");
  }

  if (Init_Simulation_Data( system, control, data, msg ) == FAILURE) {
    snprintf(errmsg, 128, "Sim_data could not be initialized on thread %d",
              system->my_rank);
    control->error_ptr->one(FLERR,errmsg);
    control->error_ptr->one(FLERR,"Sim_data could not be initialized");
  }

  if (Init_Workspace( system, control, workspace, msg ) ==
      FAILURE) {
    snprintf(errmsg, 128, "Workspace could not be initialized on thread %d",
              system->my_rank);
    control->error_ptr->one(FLERR,errmsg);    
    control->error_ptr->one(FLERR,"Workspace could not be initialized");    
  }

  if (Init_Lists( system, control, data, workspace, lists, mpi_data, msg ) ==
      FAILURE) {
    snprintf(errmsg, 128, "System could not be initialized on thread %d",
              system->my_rank);
    control->error_ptr->one(FLERR,errmsg);     
    control->error_ptr->one(FLERR,"Lists could not be initialized");     
    }

  if (Init_Output_Files(system,control,out_control,mpi_data,msg)== FAILURE) {
    snprintf(errmsg, 128, "Could not open output files on thread %d",
              system->my_rank);
    control->error_ptr->one(FLERR,errmsg); 
    control->error_ptr->one(FLERR,"Could not open output files"); 
  }

  if (control->tabulate) {
    if (Init_Lookup_Tables( system, control, workspace, mpi_data, msg ) == FAILURE) {
      snprintf(errmsg, 128, "Lookup table could not be created on thread %d",
              system->my_rank);
    control->error_ptr->one(FLERR,errmsg); 
    control->error_ptr->one(FLERR,"Lookup table could not be created"); 
    }
  }

+1 −1
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ int Make_List(int n, int num_intrs, int type, reax_list *l )
  default:
    char errmsg[128];
    snprintf(errmsg, 128, "No %d list type defined", l->type);
    l->error_ptr->all(FLERR,errmsg);
    l->error_ptr->one(FLERR,errmsg);
  }

  return SUCCESS;
Loading