Пример #1
0
void comp_frame(FILE *fp, t_trxframe *fr1, t_trxframe *fr2,
		gmx_bool bRMSD, real ftol,real abstol)
{
  fprintf(fp,"\n");
  cmp_int(fp,"flags",-1,fr1->flags,fr2->flags);
  cmp_int(fp,"not_ok",-1,fr1->not_ok,fr2->not_ok);
  cmp_int(fp,"natoms",-1,fr1->natoms,fr2->natoms);
  cmp_real(fp,"t0",-1,fr1->t0,fr2->t0,ftol,abstol);
  if (cmp_bool(fp,"bTitle",-1,fr1->bTitle,fr2->bTitle))
    cmp_str(fp,"title", -1, fr1->title, fr2->title);
  if (cmp_bool(fp,"bStep",-1,fr1->bStep,fr2->bStep))
    cmp_int(fp,"step",-1,fr1->step,fr2->step);
  cmp_int(fp,"step",-1,fr1->step,fr2->step);
  if (cmp_bool(fp,"bTime",-1,fr1->bTime,fr2->bTime))   
    cmp_real(fp,"time",-1,fr1->time,fr2->time,ftol,abstol);
  if (cmp_bool(fp,"bLambda",-1,fr1->bLambda,fr2->bLambda)) 
    cmp_real(fp,"lambda",-1,fr1->lambda,fr2->lambda,ftol,abstol);
  if (cmp_bool(fp,"bAtoms",-1,fr1->bAtoms,fr2->bAtoms))
    cmp_atoms(fp,fr1->atoms,fr2->atoms,ftol,abstol);
  if (cmp_bool(fp,"bPrec",-1,fr1->bPrec,fr2->bPrec))
    cmp_real(fp,"prec",-1,fr1->prec,fr2->prec,ftol,abstol);
  if (cmp_bool(fp,"bX",-1,fr1->bX,fr2->bX))
    cmp_rvecs(fp,"x",min(fr1->natoms,fr2->natoms),fr1->x,fr2->x,bRMSD,ftol,abstol);
  if (cmp_bool(fp,"bV",-1,fr1->bV,fr2->bV))
    cmp_rvecs(fp,"v",min(fr1->natoms,fr2->natoms),fr1->v,fr2->v,bRMSD,ftol,abstol);
  if (cmp_bool(fp,"bF",-1,fr1->bF,fr2->bF))
    cmp_rvecs(fp,"f",min(fr1->natoms,fr2->natoms),fr1->f,fr2->f,bRMSD,ftol,abstol);
  if (cmp_bool(fp,"bBox",-1,fr1->bBox,fr2->bBox))
    cmp_rvecs(fp,"box",3,fr1->box,fr2->box,FALSE,ftol,abstol);
}
Пример #2
0
static void comp_state(t_state *st1, t_state *st2,
		       gmx_bool bRMSD,real ftol,real abstol)
{
  int i,j,nc;

  fprintf(stdout,"comparing flags\n");
  cmp_int(stdout,"flags",-1,st1->flags,st2->flags);
  fprintf(stdout,"comparing box\n");
  cmp_rvecs(stdout,"box",DIM,st1->box,st2->box,FALSE,ftol,abstol);
  fprintf(stdout,"comparing box_rel\n");
  cmp_rvecs(stdout,"box_rel",DIM,st1->box_rel,st2->box_rel,FALSE,ftol,abstol);
  fprintf(stdout,"comparing boxv\n");
  cmp_rvecs(stdout,"boxv",DIM,st1->boxv,st2->boxv,FALSE,ftol,abstol);
  if (st1->flags & (1<<estSVIR_PREV)) {
    fprintf(stdout,"comparing shake vir_prev\n");
    cmp_rvecs(stdout,"svir_prev",DIM,st1->svir_prev,st2->svir_prev,FALSE,ftol,abstol);
  }
  if (st1->flags & (1<<estFVIR_PREV)) {
    fprintf(stdout,"comparing force vir_prev\n");
    cmp_rvecs(stdout,"fvir_prev",DIM,st1->fvir_prev,st2->fvir_prev,FALSE,ftol,abstol);
  }
  if (st1->flags & (1<<estPRES_PREV)) {
    fprintf(stdout,"comparing prev_pres\n");
    cmp_rvecs(stdout,"pres_prev",DIM,st1->pres_prev,st2->pres_prev,FALSE,ftol,abstol);
  }
  cmp_int(stdout,"ngtc",-1,st1->ngtc,st2->ngtc);
  cmp_int(stdout,"nhchainlength",-1,st1->nhchainlength,st2->nhchainlength);
  if (st1->ngtc == st2->ngtc && st1->nhchainlength == st2->nhchainlength){
    for(i=0; i<st1->ngtc; i++) {
      nc = i*st1->nhchainlength;
      for(j=0; j<nc; j++) {
	cmp_real(stdout,"nosehoover_xi",
		 i,st1->nosehoover_xi[nc+j],st2->nosehoover_xi[nc+j],ftol,abstol);
      }
    }
  }
  cmp_int(stdout,"nnhpres",-1,st1->nnhpres,st2->nnhpres);
  if (st1->nnhpres == st2->nnhpres && st1->nhchainlength == st2->nhchainlength) {
    for(i=0; i<st1->nnhpres; i++) {
      nc = i*st1->nhchainlength;
      for(j=0; j<nc; j++) {
	cmp_real(stdout,"nosehoover_xi",
		 i,st1->nhpres_xi[nc+j],st2->nhpres_xi[nc+j],ftol,abstol);
      }
    }
  }

  cmp_int(stdout,"natoms",-1,st1->natoms,st2->natoms);
  if (st1->natoms == st2->natoms) {
    if ((st1->flags & (1<<estX)) && (st2->flags & (1<<estX))) {
      fprintf(stdout,"comparing x\n");
      cmp_rvecs(stdout,"x",st1->natoms,st1->x,st2->x,bRMSD,ftol,abstol);
    }
    if ((st1->flags & (1<<estV)) && (st2->flags & (1<<estV))) {
      fprintf(stdout,"comparing v\n");
      cmp_rvecs(stdout,"v",st1->natoms,st1->v,st2->v,bRMSD,ftol,abstol);
    }
  }
}
Пример #3
0
static void cmp_cosines(FILE *fp,const char *s,t_cosines c1[DIM],t_cosines c2[DIM],real ftol, real abstol)
{
  int i,m;
  char buf[256];
  
  for(m=0; (m<DIM); m++) {
    sprintf(buf,"inputrec->%s[%d]",s,m);
    cmp_int(fp,buf,0,c1->n,c2->n);
    for(i=0; (i<min(c1->n,c2->n)); i++) {
      cmp_real(fp,buf,i,c1->a[i],c2->a[i],ftol,abstol);
      cmp_real(fp,buf,i,c1->phi[i],c2->phi[i],ftol,abstol);
    }
  }
}
Пример #4
0
static void cmp_disres(t_enxframe *fr1,t_enxframe *fr2,real ftol, real abstol)
{
  int i;
  char bav[64],bt[64],bs[22];
    
  cmp_int(stdout,"ndisre",-1,fr1->ndisre,fr2->ndisre);
  if ((fr1->ndisre == fr2->ndisre) && (fr1->ndisre > 0)) {
    sprintf(bav,"step %s: disre rav",gmx_step_str(fr1->step,bs));
    sprintf(bt, "step %s: disre  rt",gmx_step_str(fr1->step,bs));
    for(i=0; (i<fr1->ndisre); i++) {
      cmp_real(stdout,bav,i,fr1->disre_rm3tav[i],fr2->disre_rm3tav[i],ftol,abstol);
      cmp_real(stdout,bt ,i,fr1->disre_rt[i]    ,fr2->disre_rt[i]    ,ftol,abstol);
    }
  }
}
Пример #5
0
static void cmp_idef(FILE *fp, const t_idef *id1, const t_idef *id2, real ftol, real abstol)
{
    int  i;
    char buf1[64], buf2[64];

    fprintf(fp, "comparing idef\n");
    if (id2)
    {
        cmp_int(fp, "idef->ntypes", -1, id1->ntypes, id2->ntypes);
        cmp_int(fp, "idef->atnr",  -1, id1->atnr, id2->atnr);
        for (i = 0; (i < std::min(id1->ntypes, id2->ntypes)); i++)
        {
            sprintf(buf1, "idef->functype[%d]", i);
            sprintf(buf2, "idef->iparam[%d]", i);
            cmp_int(fp, buf1, i, (int)id1->functype[i], (int)id2->functype[i]);
            cmp_iparm(fp, buf2, id1->functype[i],
                      id1->iparams[i], id2->iparams[i], ftol, abstol);
        }
        cmp_real(fp, "fudgeQQ", -1, id1->fudgeQQ, id2->fudgeQQ, ftol, abstol);
        cmp_cmap(fp, &id1->cmap_grid, &id2->cmap_grid, ftol, abstol);
        for (i = 0; (i < F_NRE); i++)
        {
            cmp_ilist(fp, i, &(id1->il[i]), &(id2->il[i]));
        }
    }
    else
    {
        for (i = 0; (i < id1->ntypes); i++)
        {
            cmp_iparm_AB(fp, "idef->iparam", id1->functype[i], id1->iparams[i], ftol, abstol);
        }
    }
}
Пример #6
0
static void comp_pull_AB(FILE *fp,t_pull *pull,real ftol,real abstol)
{
  int i;

  for(i=0; i<pull->ngrp+1; i++) {
    fprintf(fp,"comparing pull group %d\n",i);
    cmp_real(fp,"pullgrp->k",-1,pull->grp[i].k,pull->grp[i].kB,ftol,abstol);
  }
}
Пример #7
0
static void cmp_grpopts(FILE *fp,t_grpopts *opt1,t_grpopts *opt2,real ftol, real abstol)
{
  int i,j;
  char buf1[256],buf2[256];
  
  cmp_int(fp,"inputrec->grpopts.ngtc",-1,  opt1->ngtc,opt2->ngtc);
  cmp_int(fp,"inputrec->grpopts.ngacc",-1, opt1->ngacc,opt2->ngacc);
  cmp_int(fp,"inputrec->grpopts.ngfrz",-1, opt1->ngfrz,opt2->ngfrz);
  cmp_int(fp,"inputrec->grpopts.ngener",-1,opt1->ngener,opt2->ngener);
  for(i=0; (i<min(opt1->ngtc,opt2->ngtc)); i++) {
    cmp_real(fp,"inputrec->grpopts.nrdf",i,opt1->nrdf[i],opt2->nrdf[i],ftol,abstol);
    cmp_real(fp,"inputrec->grpopts.ref_t",i,opt1->ref_t[i],opt2->ref_t[i],ftol,abstol);
    cmp_real(fp,"inputrec->grpopts.tau_t",i,opt1->tau_t[i],opt2->tau_t[i],ftol,abstol);
    cmp_int(fp,"inputrec->grpopts.annealing",i,opt1->annealing[i],opt2->annealing[i]);
    cmp_int(fp,"inputrec->grpopts.anneal_npoints",i,
	    opt1->anneal_npoints[i],opt2->anneal_npoints[i]);
    if(opt1->anneal_npoints[i]==opt2->anneal_npoints[i]) {
      sprintf(buf1,"inputrec->grpopts.anneal_time[%d]",i);
      sprintf(buf2,"inputrec->grpopts.anneal_temp[%d]",i);
      for(j=0;j<opt1->anneal_npoints[i];j++) {
	cmp_real(fp,buf1,j,opt1->anneal_time[i][j],opt2->anneal_time[i][j],ftol,abstol);
	cmp_real(fp,buf2,j,opt1->anneal_temp[i][j],opt2->anneal_temp[i][j],ftol,abstol);
      }
    }
  }
  if (opt1->ngener == opt2->ngener) {
    for(i=0; i<opt1->ngener; i++)
      for(j=i; j<opt1->ngener; j++) {
	sprintf(buf1,"inputrec->grpopts.egp_flags[%d]",i);
	cmp_int(fp,buf1,j,
		opt1->egp_flags[opt1->ngener*i+j],
		opt2->egp_flags[opt1->ngener*i+j]);
      }
  }
  for(i=0; (i<min(opt1->ngacc,opt2->ngacc)); i++)
    cmp_rvec(fp,"inputrec->grpopts.acc",i,opt1->acc[i],opt2->acc[i],ftol,abstol);
  for(i=0; (i<min(opt1->ngfrz,opt2->ngfrz)); i++)
    cmp_ivec(fp,"inputrec->grpopts.nFreeze",i,opt1->nFreeze[i],opt2->nFreeze[i]);
}
Пример #8
0
static void cmp_cmap(FILE *fp, const gmx_cmap_t *cmap1, const gmx_cmap_t *cmap2, real ftol, real abstol)
{
    cmp_int(fp, "cmap ngrid", -1, cmap1->ngrid, cmap2->ngrid);
    cmp_int(fp, "cmap grid_spacing", -1, cmap1->grid_spacing, cmap2->grid_spacing);
    if (cmap1->ngrid == cmap2->ngrid &&
        cmap1->grid_spacing == cmap2->grid_spacing)
    {
        int g;

        for (g = 0; g < cmap1->ngrid; g++)
        {
            int i;

            fprintf(fp, "comparing cmap %d\n", g);

            for (i = 0; i < 4*cmap1->grid_spacing*cmap1->grid_spacing; i++)
            {
                cmp_real(fp, "", i, cmap1->cmapdata[g].cmap[i], cmap2->cmapdata[g].cmap[i], ftol, abstol);
            }
        }
    }
}
Пример #9
0
static void cmp_atom(FILE *fp,int index,t_atom *a1,t_atom *a2,real ftol,real abstol)
{
  int  i;
  char buf[256];

  if (a2) {
    cmp_us(fp,"atom.type",index,a1->type,a2->type);
    cmp_us(fp,"atom.ptype",index,a1->ptype,a2->ptype);
    cmp_int(fp,"atom.resind",index,a1->resind,a2->resind);
    cmp_int(fp,"atom.atomnumber",index,a1->atomnumber,a2->atomnumber);
    cmp_real(fp,"atom.m",index,a1->m,a2->m,ftol,abstol);
    cmp_real(fp,"atom.q",index,a1->q,a2->q,ftol,abstol);
    cmp_us(fp,"atom.typeB",index,a1->typeB,a2->typeB);
    cmp_real(fp,"atom.mB",index,a1->mB,a2->mB,ftol,abstol);
    cmp_real(fp,"atom.qB",index,a1->qB,a2->qB,ftol,abstol);
  } else {
    cmp_us(fp,"atom.type",index,a1->type,a1->typeB);
    cmp_real(fp,"atom.m",index,a1->m,a1->mB,ftol,abstol);
    cmp_real(fp,"atom.q",index,a1->q,a1->qB,ftol,abstol);
  }
}
Пример #10
0
SInt64 JSON::comparef(const JSON& a, const JSON& b)
{
	switch (a.m_type)
	{
	case e_null: 
		switch (b.m_type)
		{
			case e_null: return cmp_null(a,b);
			case e_bool: return cmp_bool(a,b);
			case e_integer: return cmp_integer(a,b);
			case e_real: return cmp_real(a,b);
			case e_string: return cmp_string(a,b);
			case e_array: return cmp_array(a,b);
			case e_object: return cmp_object(a,b);
		}

	case e_bool:
		switch (b.m_type)
		{
			case e_null: return cmp_bool(a,b);
			case e_bool: return cmp_bool(a,b);
			case e_integer: return cmp_integer(a,b);
			case e_real: return cmp_real(a,b);
			case e_string: return cmp_string(a,b);
			case e_array: return cmp_array(a,b);
			case e_object: return cmp_object(a,b);
		}

	case e_integer:
		switch (b.m_type)
		{
			case e_null: return cmp_integer(a,b);
			case e_bool: return cmp_integer(a,b);
			case e_integer: return cmp_integer(a,b);
			case e_real: return cmp_real(a,b);
			case e_string: return cmp_string(a,b);
			case e_array: return cmp_array(a,b);
			case e_object: return cmp_object(a,b);
		}

	case e_real:
		switch (b.m_type)
		{
			case e_null: return cmp_real(a,b);
			case e_bool: return cmp_real(a,b);
			case e_integer: return cmp_real(a,b);
			case e_real: return cmp_real(a,b);
			case e_string: return cmp_string(a,b);
			case e_array: return cmp_array(a,b);
			case e_object: return cmp_object(a,b);
		}

	case e_string:
		switch (b.m_type)
		{
			case e_null: return cmp_string(a,b);
			case e_bool: return cmp_string(a,b);
			case e_integer: return cmp_string(a,b);
			case e_real: return cmp_string(a,b);
			case e_string: return cmp_string(a,b);
			case e_array: return cmp_array(a,b);
			case e_object: return cmp_object(a,b);
		}

	case e_array:
		switch (b.m_type)
		{
			case e_null: return cmp_array(a,b);
			case e_bool: return cmp_array(a,b);
			case e_integer: return cmp_array(a,b);
			case e_real: return cmp_array(a,b);
			case e_string: return cmp_array(a,b);
			case e_array: return cmp_array(a,b);
			case e_object: return cmp_object(a,b);
		}

	case e_object:
		switch (b.m_type)
		{
			case e_null: return cmp_object(a,b);
			case e_bool: return cmp_object(a,b);
			case e_integer: return cmp_object(a,b);
			case e_real: return cmp_object(a,b);
			case e_string: return cmp_object(a,b);
			case e_array: return cmp_object(a,b);
			case e_object: return cmp_object(a,b);
		}
	}

	Check();
	return -1;
}
Пример #11
0
void comp_enx(const char *fn1, const char *fn2, real ftol, real abstol, const char *lastener)
{
    int            nre, nre1, nre2;
    ener_file_t    in1, in2;
    int            i, j, maxener, *ind1, *ind2, *have;
    gmx_enxnm_t   *enm1 = NULL, *enm2 = NULL;
    t_enxframe    *fr1, *fr2;
    gmx_bool       b1, b2;

    fprintf(stdout, "comparing energy file %s and %s\n\n", fn1, fn2);

    in1 = open_enx(fn1, "r");
    in2 = open_enx(fn2, "r");
    do_enxnms(in1, &nre1, &enm1);
    do_enxnms(in2, &nre2, &enm2);
    if (nre1 != nre2)
    {
        fprintf(stdout, "There are %d and %d terms in the energy files\n\n",
                nre1, nre2);
    }
    else
    {
        fprintf(stdout, "There are %d terms in the energy files\n\n", nre1);
    }

    snew(ind1, nre1);
    snew(ind2, nre2);
    snew(have, nre2);
    nre = 0;
    for (i = 0; i < nre1; i++)
    {
        for (j = 0; j < nre2; j++)
        {
            if (enernm_equal(enm1[i].name, enm2[j].name))
            {
                ind1[nre] = i;
                ind2[nre] = j;
                have[j]   = 1;
                nre++;
                break;
            }
        }
        if (nre == 0 || ind1[nre-1] != i)
        {
            cmp_str(stdout, "enm", i, enm1[i].name, "-");
        }
    }
    for (i = 0; i < nre2; i++)
    {
        if (have[i] == 0)
        {
            cmp_str(stdout, "enm", i, "-", enm2[i].name);
        }
    }

    maxener = nre;
    for (i = 0; i < nre; i++)
    {
        if ((lastener != NULL) && (std::strstr(enm1[i].name, lastener) != NULL))
        {
            maxener = i+1;
            break;
        }
    }

    fprintf(stdout, "There are %d terms to compare in the energy files\n\n",
            maxener);

    for (i = 0; i < maxener; i++)
    {
        cmp_str(stdout, "unit", i, enm1[ind1[i]].unit, enm2[ind2[i]].unit);
    }

    snew(fr1, 1);
    snew(fr2, 1);
    do
    {
        b1 = do_enx(in1, fr1);
        b2 = do_enx(in2, fr2);
        if (b1 && !b2)
        {
            fprintf(stdout, "\nEnd of file on %s but not on %s\n", fn2, fn1);
        }
        else if (!b1 && b2)
        {
            fprintf(stdout, "\nEnd of file on %s but not on %s\n", fn1, fn2);
        }
        else if (!b1 && !b2)
        {
            fprintf(stdout, "\nFiles read successfully\n");
        }
        else
        {
            cmp_real(stdout, "t", -1, fr1->t, fr2->t, ftol, abstol);
            cmp_int(stdout, "step", -1, fr1->step, fr2->step);
            /* We don't want to print the nre mismatch for every frame */
            /* cmp_int(stdout,"nre",-1,fr1->nre,fr2->nre); */
            if ((fr1->nre >= nre) && (fr2->nre >= nre))
            {
                cmp_energies(stdout, fr1->step, fr1->step, fr1->ener, fr2->ener,
                             enm1, ftol, abstol, nre, ind1, ind2, maxener);
            }
            /*cmp_disres(fr1,fr2,ftol,abstol);*/
            cmp_eblocks(fr1, fr2, ftol, abstol);
        }
    }
    while (b1 && b2);

    close_enx(in1);
    close_enx(in2);

    free_enxframe(fr2);
    sfree(fr2);
    free_enxframe(fr1);
    sfree(fr1);
}
Пример #12
0
static void cmp_inputrec(FILE *fp,t_inputrec *ir1,t_inputrec *ir2,real ftol, real abstol)
{
  int i;

  fprintf(fp,"comparing inputrec\n");

  /* gcc 2.96 doesnt like these defines at all, but issues a huge list
   * of warnings. Maybe it will change in future versions, but for the
   * moment I've spelled them out instead. /EL 000820 
   * #define CIB(s) cmp_int(fp,"inputrec->"#s,0,ir1->##s,ir2->##s)
   * #define CII(s) cmp_int(fp,"inputrec->"#s,0,ir1->##s,ir2->##s)
   * #define CIR(s) cmp_real(fp,"inputrec->"#s,0,ir1->##s,ir2->##s,ftol)
   */
  cmp_int(fp,"inputrec->eI",-1,ir1->eI,ir2->eI);
  cmp_gmx_large_int(fp,"inputrec->nsteps",ir1->nsteps,ir2->nsteps);
  cmp_gmx_large_int(fp,"inputrec->init_step",ir1->init_step,ir2->init_step);
  cmp_int(fp,"inputrec->simulation_part",-1,ir1->simulation_part,ir2->simulation_part);
  cmp_int(fp,"inputrec->ePBC",-1,ir1->ePBC,ir2->ePBC);
  cmp_int(fp,"inputrec->bPeriodicMols",-1,ir1->bPeriodicMols,ir2->bPeriodicMols);
  cmp_int(fp,"inputrec->ns_type",-1,ir1->ns_type,ir2->ns_type);
  cmp_int(fp,"inputrec->nstlist",-1,ir1->nstlist,ir2->nstlist);
  cmp_int(fp,"inputrec->ndelta",-1,ir1->ndelta,ir2->ndelta);
  cmp_int(fp,"inputrec->nstcomm",-1,ir1->nstcomm,ir2->nstcomm);
  cmp_int(fp,"inputrec->comm_mode",-1,ir1->comm_mode,ir2->comm_mode);
  cmp_int(fp,"inputrec->nstcheckpoint",-1,ir1->nstcheckpoint,ir2->nstcheckpoint);
  cmp_int(fp,"inputrec->nstlog",-1,ir1->nstlog,ir2->nstlog);
  cmp_int(fp,"inputrec->nstxout",-1,ir1->nstxout,ir2->nstxout);
  cmp_int(fp,"inputrec->nstvout",-1,ir1->nstvout,ir2->nstvout);
  cmp_int(fp,"inputrec->nstfout",-1,ir1->nstfout,ir2->nstfout);
  cmp_int(fp,"inputrec->nstcalcenergy",-1,ir1->nstcalcenergy,ir2->nstcalcenergy);
  cmp_int(fp,"inputrec->nstenergy",-1,ir1->nstenergy,ir2->nstenergy);
  cmp_int(fp,"inputrec->nstxtcout",-1,ir1->nstxtcout,ir2->nstxtcout);
  cmp_double(fp,"inputrec->init_t",-1,ir1->init_t,ir2->init_t,ftol,abstol);
  cmp_double(fp,"inputrec->delta_t",-1,ir1->delta_t,ir2->delta_t,ftol,abstol);
  cmp_real(fp,"inputrec->xtcprec",-1,ir1->xtcprec,ir2->xtcprec,ftol,abstol);
  cmp_int(fp,"inputrec->nkx",-1,ir1->nkx,ir2->nkx);
  cmp_int(fp,"inputrec->nky",-1,ir1->nky,ir2->nky);
  cmp_int(fp,"inputrec->nkz",-1,ir1->nkz,ir2->nkz);
  cmp_int(fp,"inputrec->pme_order",-1,ir1->pme_order,ir2->pme_order);
  cmp_real(fp,"inputrec->ewald_rtol",-1,ir1->ewald_rtol,ir2->ewald_rtol,ftol,abstol);
  cmp_int(fp,"inputrec->ewald_geometry",-1,ir1->ewald_geometry,ir2->ewald_geometry);
  cmp_real(fp,"inputrec->epsilon_surface",-1,ir1->epsilon_surface,ir2->epsilon_surface,ftol,abstol);
  cmp_int(fp,"inputrec->bOptFFT",-1,ir1->bOptFFT,ir2->bOptFFT);
  cmp_int(fp,"inputrec->bContinuation",-1,ir1->bContinuation,ir2->bContinuation);
  cmp_int(fp,"inputrec->bShakeSOR",-1,ir1->bShakeSOR,ir2->bShakeSOR);
  cmp_int(fp,"inputrec->etc",-1,ir1->etc,ir2->etc);
  cmp_int(fp,"inputrec->epc",-1,ir1->epc,ir2->epc);
  cmp_int(fp,"inputrec->epct",-1,ir1->epct,ir2->epct);
  cmp_real(fp,"inputrec->tau_p",-1,ir1->tau_p,ir2->tau_p,ftol,abstol);
  cmp_rvec(fp,"inputrec->ref_p(x)",-1,ir1->ref_p[XX],ir2->ref_p[XX],ftol,abstol);
  cmp_rvec(fp,"inputrec->ref_p(y)",-1,ir1->ref_p[YY],ir2->ref_p[YY],ftol,abstol);
  cmp_rvec(fp,"inputrec->ref_p(z)",-1,ir1->ref_p[ZZ],ir2->ref_p[ZZ],ftol,abstol);
  cmp_rvec(fp,"inputrec->compress(x)",-1,ir1->compress[XX],ir2->compress[XX],ftol,abstol);
  cmp_rvec(fp,"inputrec->compress(y)",-1,ir1->compress[YY],ir2->compress[YY],ftol,abstol);
  cmp_rvec(fp,"inputrec->compress(z)",-1,ir1->compress[ZZ],ir2->compress[ZZ],ftol,abstol);
  cmp_int(fp,"refcoord_scaling",-1,ir1->refcoord_scaling,ir2->refcoord_scaling);
   cmp_rvec(fp,"inputrec->posres_com",-1,ir1->posres_com,ir2->posres_com,ftol,abstol);
   cmp_rvec(fp,"inputrec->posres_comB",-1,ir1->posres_comB,ir2->posres_comB,ftol,abstol);
   cmp_int(fp,"inputrec->andersen_seed",-1,ir1->andersen_seed,ir2->andersen_seed);
  cmp_real(fp,"inputrec->rlist",-1,ir1->rlist,ir2->rlist,ftol,abstol);
  cmp_real(fp,"inputrec->rlistlong",-1,ir1->rlistlong,ir2->rlistlong,ftol,abstol);
  cmp_real(fp,"inputrec->rtpi",-1,ir1->rtpi,ir2->rtpi,ftol,abstol);
  cmp_int(fp,"inputrec->coulombtype",-1,ir1->coulombtype,ir2->coulombtype);
  cmp_real(fp,"inputrec->rcoulomb_switch",-1,ir1->rcoulomb_switch,ir2->rcoulomb_switch,ftol,abstol);
  cmp_real(fp,"inputrec->rcoulomb",-1,ir1->rcoulomb,ir2->rcoulomb,ftol,abstol);
  cmp_int(fp,"inputrec->vdwtype",-1,ir1->vdwtype,ir2->vdwtype);
  cmp_real(fp,"inputrec->rvdw_switch",-1,ir1->rvdw_switch,ir2->rvdw_switch,ftol,abstol);
  cmp_real(fp,"inputrec->rvdw",-1,ir1->rvdw,ir2->rvdw,ftol,abstol);
  cmp_real(fp,"inputrec->epsilon_r",-1,ir1->epsilon_r,ir2->epsilon_r,ftol,abstol);
  cmp_real(fp,"inputrec->epsilon_rf",-1,ir1->epsilon_rf,ir2->epsilon_rf,ftol,abstol);
  cmp_real(fp,"inputrec->tabext",-1,ir1->tabext,ir2->tabext,ftol,abstol);
  cmp_int(fp,"inputrec->implicit_solvent",-1,ir1->implicit_solvent,ir2->implicit_solvent);
  cmp_int(fp,"inputrec->gb_algorithm",-1,ir1->gb_algorithm,ir2->gb_algorithm);
  cmp_int(fp,"inputrec->nstgbradii",-1,ir1->nstgbradii,ir2->nstgbradii);
  cmp_real(fp,"inputrec->rgbradii",-1,ir1->rgbradii,ir2->rgbradii,ftol,abstol);
  cmp_real(fp,"inputrec->gb_saltconc",-1,ir1->gb_saltconc,ir2->gb_saltconc,ftol,abstol);
  cmp_real(fp,"inputrec->gb_epsilon_solvent",-1,ir1->gb_epsilon_solvent,ir2->gb_epsilon_solvent,ftol,abstol);
  cmp_real(fp,"inputrec->gb_obc_alpha",-1,ir1->gb_obc_alpha,ir2->gb_obc_alpha,ftol,abstol);
  cmp_real(fp,"inputrec->gb_obc_beta",-1,ir1->gb_obc_beta,ir2->gb_obc_beta,ftol,abstol);
  cmp_real(fp,"inputrec->gb_obc_gamma",-1,ir1->gb_obc_gamma,ir2->gb_obc_gamma,ftol,abstol);
  cmp_real(fp,"inputrec->gb_dielectric_offset",-1,ir1->gb_dielectric_offset,ir2->gb_dielectric_offset,ftol,abstol);
  cmp_int(fp,"inputrec->sa_algorithm",-1,ir1->sa_algorithm,ir2->sa_algorithm);
  cmp_real(fp,"inputrec->sa_surface_tension",-1,ir1->sa_surface_tension,ir2->sa_surface_tension,ftol,abstol);	

  cmp_int(fp,"inputrec->eDispCorr",-1,ir1->eDispCorr,ir2->eDispCorr);
  cmp_real(fp,"inputrec->shake_tol",-1,ir1->shake_tol,ir2->shake_tol,ftol,abstol);
  cmp_int(fp,"inputrec->efep",-1,ir1->efep,ir2->efep);
  cmp_double(fp,"inputrec->init_lambda",-1,ir1->init_lambda,ir2->init_lambda,ftol,abstol);
  cmp_double(fp,"inputrec->delta_lambda",-1,ir1->delta_lambda,ir2->delta_lambda,ftol,abstol);
  cmp_int(fp,"inputrec->n_foreign_lambda",-1,ir1->n_flambda,ir2->n_flambda);
  for(i=0; i<min(ir1->n_flambda,ir2->n_flambda); i++) {
    cmp_double(fp,"inputrec->foreign_lambda",-1,ir1->flambda[i],ir2->flambda[i],ftol,abstol);
  }
  cmp_real(fp,"inputrec->sc_alpha",-1,ir1->sc_alpha,ir2->sc_alpha,ftol,abstol);
  cmp_int(fp,"inputrec->sc_power",-1,ir1->sc_power,ir2->sc_power);
  cmp_real(fp,"inputrec->sc_sigma",-1,ir1->sc_sigma,ir2->sc_sigma,ftol,abstol);
  cmp_real(fp,"inputrec->sc_sigma_min",-1,ir1->sc_sigma_min,ir2->sc_sigma_min,ftol,abstol);
  cmp_int(fp,"inputrec->nstdhdl",-1,ir1->nstdhdl,ir2->nstdhdl);
  cmp_int(fp,"inputrec->separate_dhdl_file",-1,ir1->separate_dhdl_file,ir2->separate_dhdl_file);
  cmp_int(fp,"inputrec->dhdl_derivatives",-1,ir1->dhdl_derivatives,ir2->dhdl_derivatives);
  cmp_int(fp,"inputrec->dh_hist_size",-1,ir1->dh_hist_size,ir2->dh_hist_size);
  cmp_double(fp,"inputrec->dh_hist_spacing",-1,ir1->dh_hist_spacing,ir2->dh_hist_spacing,ftol,abstol);

  cmp_int(fp,"inputrec->nwall",-1,ir1->nwall,ir2->nwall);
  cmp_int(fp,"inputrec->wall_type",-1,ir1->wall_type,ir2->wall_type);
  cmp_int(fp,"inputrec->wall_atomtype[0]",-1,ir1->wall_atomtype[0],ir2->wall_atomtype[0]);
  cmp_int(fp,"inputrec->wall_atomtype[1]",-1,ir1->wall_atomtype[1],ir2->wall_atomtype[1]);
  cmp_real(fp,"inputrec->wall_density[0]",-1,ir1->wall_density[0],ir2->wall_density[0],ftol,abstol);
  cmp_real(fp,"inputrec->wall_density[1]",-1,ir1->wall_density[1],ir2->wall_density[1],ftol,abstol);
  cmp_real(fp,"inputrec->wall_ewald_zfac",-1,ir1->wall_ewald_zfac,ir2->wall_ewald_zfac,ftol,abstol);

  cmp_int(fp,"inputrec->ePull",-1,ir1->ePull,ir2->ePull);
  if (ir1->ePull == ir2->ePull && ir1->ePull != epullNO)
    cmp_pull(fp,ir1->pull,ir2->pull,ftol,abstol);
  
  cmp_int(fp,"inputrec->eDisre",-1,ir1->eDisre,ir2->eDisre);
  cmp_real(fp,"inputrec->dr_fc",-1,ir1->dr_fc,ir2->dr_fc,ftol,abstol);
  cmp_int(fp,"inputrec->eDisreWeighting",-1,ir1->eDisreWeighting,ir2->eDisreWeighting);
  cmp_int(fp,"inputrec->bDisreMixed",-1,ir1->bDisreMixed,ir2->bDisreMixed);
  cmp_int(fp,"inputrec->nstdisreout",-1,ir1->nstdisreout,ir2->nstdisreout);
  cmp_real(fp,"inputrec->dr_tau",-1,ir1->dr_tau,ir2->dr_tau,ftol,abstol);
  cmp_real(fp,"inputrec->orires_fc",-1,ir1->orires_fc,ir2->orires_fc,ftol,abstol);
  cmp_real(fp,"inputrec->orires_tau",-1,ir1->orires_tau,ir2->orires_tau,ftol,abstol);
  cmp_int(fp,"inputrec->nstorireout",-1,ir1->nstorireout,ir2->nstorireout);
  cmp_real(fp,"inputrec->dihre_fc",-1,ir1->dihre_fc,ir2->dihre_fc,ftol,abstol);
  cmp_real(fp,"inputrec->em_stepsize",-1,ir1->em_stepsize,ir2->em_stepsize,ftol,abstol);
  cmp_real(fp,"inputrec->em_tol",-1,ir1->em_tol,ir2->em_tol,ftol,abstol);
  cmp_int(fp,"inputrec->niter",-1,ir1->niter,ir2->niter);
  cmp_real(fp,"inputrec->fc_stepsize",-1,ir1->fc_stepsize,ir2->fc_stepsize,ftol,abstol);
  cmp_int(fp,"inputrec->nstcgsteep",-1,ir1->nstcgsteep,ir2->nstcgsteep);
  cmp_int(fp,"inputrec->nbfgscorr",0,ir1->nbfgscorr,ir2->nbfgscorr);
  cmp_int(fp,"inputrec->eConstrAlg",-1,ir1->eConstrAlg,ir2->eConstrAlg);
  cmp_int(fp,"inputrec->nProjOrder",-1,ir1->nProjOrder,ir2->nProjOrder);
  cmp_real(fp,"inputrec->LincsWarnAngle",-1,ir1->LincsWarnAngle,ir2->LincsWarnAngle,ftol,abstol);
  cmp_int(fp,"inputrec->nLincsIter",-1,ir1->nLincsIter,ir2->nLincsIter);
  cmp_real(fp,"inputrec->bd_fric",-1,ir1->bd_fric,ir2->bd_fric,ftol,abstol);
  cmp_int(fp,"inputrec->ld_seed",-1,ir1->ld_seed,ir2->ld_seed);
  cmp_real(fp,"inputrec->cos_accel",-1,ir1->cos_accel,ir2->cos_accel,ftol,abstol);
  cmp_rvec(fp,"inputrec->deform(a)",-1,ir1->deform[XX],ir2->deform[XX],ftol,abstol);
  cmp_rvec(fp,"inputrec->deform(b)",-1,ir1->deform[YY],ir2->deform[YY],ftol,abstol);
  cmp_rvec(fp,"inputrec->deform(c)",-1,ir1->deform[ZZ],ir2->deform[ZZ],ftol,abstol);

  cmp_int(fp,"ir->adress->type" ,-1,ir1->adress->type,ir2->adress->type);
  cmp_real(fp,"ir->adress->const_wf" ,-1,ir1->adress->const_wf,ir2->adress->const_wf,ftol,abstol);
  cmp_real(fp,"ir->adress->ex_width" ,-1,ir1->adress->ex_width,ir2->adress->ex_width,ftol,abstol);
  cmp_real(fp,"ir->adress->hy_width" ,-1,ir1->adress->hy_width,ir2->adress->hy_width,ftol,abstol);
  cmp_int(fp,"ir->adress->icor" ,-1,ir1->adress->icor,ir2->adress->icor);
  cmp_int(fp,"ir->adress->site" ,-1,ir1->adress->site,ir2->adress->site);
  cmp_rvec(fp,"ir->adress->refs" ,-1,ir1->adress->refs,ir2->adress->refs,ftol,abstol);
  cmp_rvec(fp,"ir->adress->refs_2" ,-1,ir1->adress->refs_2,ir2->adress->refs_2,ftol,abstol);
  cmp_real(fp,"ir->adress->ex_forcecap", -1,ir1->adress->ex_forcecap,ir2->adress->ex_forcecap,ftol,abstol);

  cmp_int(fp,"inputrec->userint1",-1,ir1->userint1,ir2->userint1);
  cmp_int(fp,"inputrec->userint2",-1,ir1->userint2,ir2->userint2);
  cmp_int(fp,"inputrec->userint3",-1,ir1->userint3,ir2->userint3);
  cmp_int(fp,"inputrec->userint4",-1,ir1->userint4,ir2->userint4);
  cmp_real(fp,"inputrec->userreal1",-1,ir1->userreal1,ir2->userreal1,ftol,abstol);
  cmp_real(fp,"inputrec->userreal2",-1,ir1->userreal2,ir2->userreal2,ftol,abstol);
  cmp_real(fp,"inputrec->userreal3",-1,ir1->userreal3,ir2->userreal3,ftol,abstol);
  cmp_real(fp,"inputrec->userreal4",-1,ir1->userreal4,ir2->userreal4,ftol,abstol);
  cmp_grpopts(fp,&(ir1->opts),&(ir2->opts),ftol,abstol);
  cmp_cosines(fp,"ex",ir1->ex,ir2->ex,ftol,abstol);
  cmp_cosines(fp,"et",ir1->et,ir2->et,ftol,abstol);
}