Commit 70593d92 authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@12812 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent c4af1cdb
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -122,6 +122,9 @@ void colvarproxy_lammps::init(const char *conf_file)
  // create the colvarmodule instance
  colvars = new colvarmodule(this);

  cvm::log("Using LAMMPS interface, version "+
            cvm::to_str(COLVARPROXY_VERSION)+".\n");

  // TODO move one or more of these to setup() if needed
  colvars->config_file(conf_file);
  colvars->setup_input();
@@ -189,6 +192,8 @@ double colvarproxy_lammps::compute()
    applied_forces[i].x = applied_forces[i].y = applied_forces[i].z = 0.0;
  }

  bias_energy = 0.0;

  // call the collective variable module
  colvars->calc();

+12 −8
Original line number Diff line number Diff line
@@ -14,6 +14,10 @@
#include <vector>
#include <iostream>

#ifndef COLVARPROXY_VERSION
#define COLVARPROXY_VERSION "2014-10-29"
#endif

/* struct for packed data communication of coordinates and forces. */
struct commdata {
  int tag,type;
@@ -103,7 +107,7 @@ class colvarproxy_lammps : public colvarproxy {

  inline size_t restart_frequency() { return restart_every; };

  void add_energy (cvm::real energy) { bias_energy = energy; };
  void add_energy(cvm::real energy) { bias_energy += energy; };
  void request_system_force(bool yesno) { system_force_requested = yesno; };

  void log(std::string const &message);
+4 −4
Original line number Diff line number Diff line
@@ -601,7 +601,7 @@ void FixColvars::setup(int vflag)
      }
    }
    /* blocking receive to wait until it is our turn to send data. */
    MPI_Recv(&tmp, 0, MPI_INT, 0, 0, world, &status);
    MPI_Recv(&tmp, 0, MPI_INT, 0, 0, world, MPI_STATUS_IGNORE);
    MPI_Rsend(comm_buf, nme*size_one, MPI_BYTE, 0, 0, world);
  }

@@ -744,7 +744,7 @@ void FixColvars::post_force(int vflag)
      }
    }
    /* blocking receive to wait until it is our turn to send data. */
    MPI_Recv(&tmp, 0, MPI_INT, 0, 0, world, &status);
    MPI_Recv(&tmp, 0, MPI_INT, 0, 0, world, MPI_STATUS_IGNORE);
    MPI_Rsend(comm_buf, nme*size_one, MPI_BYTE, 0, 0, world);
  }

@@ -875,7 +875,7 @@ void FixColvars::end_of_step()
        }
      }
      /* blocking receive to wait until it is our turn to send data. */
      MPI_Recv(&tmp, 0, MPI_INT, 0, 0, world, &status);
      MPI_Recv(&tmp, 0, MPI_INT, 0, 0, world, MPI_STATUS_IGNORE);
      MPI_Rsend(comm_buf, nme*size_one, MPI_BYTE, 0, 0, world);
    }
  }
+4 −3
Original line number Diff line number Diff line
@@ -88,10 +88,11 @@ static void write_group(FILE *fp, int gid, Atom *atom, Group *group, int me,
    for (i = 0; i < nlocal; i++)
      if (mask[i] & groupbit) sendlist[lnum++] = tag[i];

    MPI_Status status;
    MPI_Request request;
    int nrecv,allrecv;
    if (me == 0) {
      MPI_Status status;
      MPI_Request request;

      for (i=0; i < lnum; i++)
        recvlist[i] = sendlist[i];

@@ -107,7 +108,7 @@ static void write_group(FILE *fp, int gid, Atom *atom, Group *group, int me,
      // sort received list
      qsort((void *)recvlist, num, sizeof(tagint), cmptagint);
    } else {
      MPI_Recv(&nrecv,0,MPI_INT,0,0,world,&status);
      MPI_Recv(&nrecv,0,MPI_INT,0,0,world,MPI_STATUS_IGNORE);
      MPI_Rsend(sendlist,lnum,MPI_LMP_TAGINT,0,0,world);
    }
    delete [] sendlist;