Updated prd documentation

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@3780 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
athomps 2010-02-04 02:13:23 +00:00
parent 8c49ec08dd
commit a424a1b626
4 changed files with 25 additions and 8 deletions

View File

@ -224,6 +224,7 @@ void FixEvent::write_restart(FILE *fp)
list[n++] = clock;
list[n++] = replica_number;
list[n++] = correlated_event;
list[n++] = ncoincident;
if (comm->me == 0) {
int size = n * sizeof(double);
@ -246,4 +247,5 @@ void FixEvent::restart(char *buf)
clock = static_cast<int> (list[n++]);
replica_number = static_cast<int> (list[n++]);
correlated_event = static_cast<int> (list[n++]);
ncoincident = static_cast<int> (list[n++]);
}

View File

@ -31,6 +31,7 @@ class FixEvent : public Fix {
int clock; // total elapsed timesteps across all replicas
int replica_number; // replica where last event occured
int correlated_event; // 1 if last event was correlated, 0 otherwise
int ncoincident; // number of simultaneous events on different replicas
FixEvent(class LAMMPS *, int, char **);
~FixEvent();

View File

@ -242,9 +242,9 @@ void PRD::command(int narg, char **arg)
if (me_universe == 0) {
if (universe->uscreen)
fprintf(universe->uscreen,"Step Clock Event Correlated Replica\n");
fprintf(universe->uscreen,"Step CPU Clock Event Correlated Coincident Replica\n");
if (universe->ulogfile)
fprintf(universe->ulogfile,"Step Clock Event Correlated Replica\n");
fprintf(universe->ulogfile,"Step CPU Clock Event Correlated Coincident Replica\n");
}
// store hot state and quenched event for replica 0
@ -256,7 +256,10 @@ void PRD::command(int narg, char **arg)
fix_event->store_state();
quench();
ncoincident = 0;
share_event(0,0);
timer->barrier_start(TIME_LOOP);
time_start = timer->array[TIME_LOOP];
log_event();
// do full init/setup since are starting all replicas after event
@ -281,7 +284,7 @@ void PRD::command(int narg, char **arg)
time_dephase = time_dynamics = time_quench = time_comm = time_output = 0.0;
timer->barrier_start(TIME_LOOP);
double time_start = timer->array[TIME_LOOP];
time_start = timer->array[TIME_LOOP];
while (update->ntimestep < update->endstep) {
dephase();
@ -538,6 +541,7 @@ int PRD::check_event(int replica_num)
if (me == 0) MPI_Allreduce(&worldflag,&universeflag,1,
MPI_INT,MPI_SUM,comm_replica);
MPI_Bcast(&universeflag,1,MPI_INT,0,world);
ncoincident = universeflag;
if (!universeflag) ireplica = -1;
else {
if (universeflag > 1) {
@ -555,7 +559,6 @@ int PRD::check_event(int replica_num)
MPI_INT,MPI_SUM,comm_replica);
MPI_Bcast(&ireplica,1,MPI_INT,0,world);
}
timer->barrier_stop(TIME_LOOP);
time_comm += timer->array[TIME_LOOP];
return ireplica;
@ -604,6 +607,7 @@ void PRD::share_event(int ireplica, int flag)
fix_event->replica_number = ireplica;
fix_event->correlated_event = 0;
if (flag == 2) fix_event->correlated_event = 1;
fix_event->ncoincident = ncoincident;
}
if (flag == 0) fix_event->event_number--;
@ -636,16 +640,23 @@ void PRD::share_event(int ireplica, int flag)
void PRD::log_event()
{
timer->array[TIME_LOOP] = time_start;
if (universe->me == 0) {
if (universe->uscreen)
fprintf(universe->uscreen,"%d %d %d %d %d\n",
fix_event->event_timestep,fix_event->clock,
fprintf(universe->uscreen,"%d %.3f %d %d %d %d %d\n",
fix_event->event_timestep,
timer->elapsed(TIME_LOOP),
fix_event->clock,
fix_event->event_number,fix_event->correlated_event,
fix_event->ncoincident,
fix_event->replica_number);
if (universe->ulogfile)
fprintf(universe->ulogfile,"%d %d %d %d %d\n",
fix_event->event_timestep,fix_event->clock,
fprintf(universe->ulogfile,"%d %.3f %d %d %d %d %d\n",
fix_event->event_timestep,
timer->elapsed(TIME_LOOP),
fix_event->clock,
fix_event->event_number,fix_event->correlated_event,
fix_event->ncoincident,
fix_event->replica_number);
}
}

View File

@ -43,10 +43,13 @@ class PRD : protected Pointers {
int quench_reneighbor;
double time_dephase,time_dynamics,time_quench,time_comm,time_output;
double time_start;
MPI_Comm comm_replica;
int *tagall,*displacements,*imageall;
double **xall;
int ncoincident;
class RanPark *random_select;
class RanMars *random_dephase;