#include "sighandler.h"
#include "tpxio.h"
#include "txtdump.h"
+#include "gmx_membed.h"
#include "md_openmm.h"
gmx_edsam_t ed=NULL;
t_commrec *cr_old=cr;
int nthreads=1;
+ gmx_membed_t *membed=NULL;
/* CAUTION: threads may be started later on in this function, so
cr doesn't reflect the final parallel state right now */
}
/* END OF CAUTION: cr is now reliable */
+ /* g_membed initialisation *
+ * Because we change the mtop, init_membed is called before the init_parallel *
+ * (in case we ever want to make it run in parallel) */
+ if (opt2bSet("-membed",nfile,fnm))
+ {
+ fprintf(stderr,"Entering membed code");
+ snew(membed,1);
+ init_membed(fplog,membed,nfile,fnm,mtop,inputrec,state,cr,&cpt_period);
+ }
+
if (PAR(cr))
{
/* now broadcast everything to the non-master nodes/threads: */
fprintf(stderr,"Loaded with Money\n\n");
}
- if (PAR(cr) && !((Flags & MD_PARTDEC) || EI_TPI(inputrec->eI)))
+ if (PAR(cr) && !((Flags & MD_PARTDEC) ||
+ EI_TPI(inputrec->eI) ||
+ inputrec->eI == eiNM))
{
cr->dd = init_domain_decomposition(fplog,cr,Flags,ddxyz,rdd,rconstr,
dddlb_opt,dlb_scale,
fcd,state,
mdatoms,nrnb,wcycle,ed,fr,
repl_ex_nst,repl_ex_seed,
+ membed,
cpt_period,max_hours,
deviceOptions,
Flags,
finish_run(fplog,cr,ftp2fn(efSTO,nfile,fnm),
inputrec,nrnb,wcycle,&runtime,
EI_DYNAMICS(inputrec->eI) && !MULTISIM(cr));
+
+ if (opt2bSet("-membed",nfile,fnm))
+ {
+ sfree(membed);
+ }
/* Does what it says */
print_date_and_time(fplog,cr->nodeid,"Finished mdrun",&runtime);
#include "mtop_util.h"
#include "gmxfio.h"
#include "pme.h"
+#include "gmx_membed.h"
typedef struct {
t_state s;
snew(*enerd,1);
init_enerdata(top_global->groups.grps[egcENER].nr,ir->n_flambda,*enerd);
- /* Init bin for energy stuff */
- *mdebin = init_mdebin((*outf)->fp_ene,top_global,ir,NULL);
+ if (mdebin != NULL)
+ {
+ /* Init bin for energy stuff */
+ *mdebin = init_mdebin((*outf)->fp_ene,top_global,ir,NULL);
+ }
clear_rvec(mu_tot);
calc_shifts(ems->s.box,fr->shift_vec);
gmx_edsam_t ed,
t_forcerec *fr,
int repl_ex_nst,int repl_ex_seed,
+ gmx_membed_t *membed,
real cpt_period,real max_hours,
const char *deviceOptions,
unsigned long Flags,
gmx_edsam_t ed,
t_forcerec *fr,
int repl_ex_nst,int repl_ex_seed,
+ gmx_membed_t *membed,
real cpt_period,real max_hours,
const char *deviceOptions,
unsigned long Flags,
gmx_edsam_t ed,
t_forcerec *fr,
int repl_ex_nst,int repl_ex_seed,
+ gmx_membed_t *membed,
real cpt_period,real max_hours,
const char *deviceOptions,
unsigned long Flags,
gmx_edsam_t ed,
t_forcerec *fr,
int repl_ex_nst,int repl_ex_seed,
+ gmx_membed_t *membed,
real cpt_period,real max_hours,
const char *deviceOptions,
unsigned long Flags,
gmx_runtime_t *runtime)
{
- t_mdebin *mdebin;
const char *NM = "Normal Mode Analysis";
gmx_mdoutf_t *outf;
int natoms,atom,d;
state_global,top_global,state_work,&top,
&f,&f_global,
nrnb,mu_tot,fr,&enerd,&graph,mdatoms,&gstat,vsite,constr,
- nfile,fnm,&outf,&mdebin);
+ nfile,fnm,&outf,NULL);
natoms = top_global->natoms;
snew(fneg,natoms);
if (MASTER(cr))
{
- print_ebin(NULL,FALSE,FALSE,FALSE,fplog,atom,t,eprAVER,
- FALSE,mdebin,fcd,&(top_global->groups),&(inputrec->opts));
-
fprintf(stderr,"\n\nWriting Hessian...\n");
gmx_mtxio_write(ftp2fn(efMTX,nfile,fnm),sz,sz,full_matrix,sparse_matrix);
}