git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@6209 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2011-05-23 14:04:44 +00:00
parent 69786dc452
commit e97e40698a
12 changed files with 122 additions and 100 deletions

View File

@ -32,9 +32,12 @@
#include "write_restart.h"
#include "memory.h"
#include "error.h"
#include "accelerator.h"
using namespace LAMMPS_NS;
enum{NOACCEL,OPT,GPU,USERCUDA}; // same as lammps.cpp
#define DELTA 1
#define MYMIN(a,b) ((a) < (b) ? (a) : (b))
@ -243,8 +246,13 @@ void Output::write(bigint ntimestep)
{
// next_dump does not force output on last step of run
// wrap dumps that invoke computes with clear/add
// download data from GPU if necessary
if (next_dump_any == ntimestep) {
if (lmp->accelerator == USERCUDA && !lmp->cuda->oncpu)
lmp->cuda->downloadAll();
for (int idump = 0; idump < ndump; idump++) {
if (next_dump[idump] == ntimestep && last_dump[idump] != ntimestep) {
if (dump[idump]->clearstep) modify->clearstep_compute();
@ -267,8 +275,13 @@ void Output::write(bigint ntimestep)
// next_restart does not force output on last step of run
// for toggle = 0, replace "*" with current timestep in restart filename
// download data from GPU if necessary
if (next_restart == ntimestep && last_restart != ntimestep) {
if (lmp->accelerator == USERCUDA && !lmp->cuda->oncpu)
lmp->cuda->downloadAll();
if (restart_toggle == 0) {
char *file = new char[strlen(restart1) + 16];
char *ptr = strchr(restart1,'*');