Commit ece1aff7 authored by Steve Plimpton's avatar Steve Plimpton
Browse files

less comm version of special bonds rendezvous

parent 2e0d69b0
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -745,7 +745,7 @@ void Comm::ring(int n, int nper, void *inbuf, int messtag,
------------------------------------------------------------------------- */

int Comm::rendezvous(int n, int *proclist, char *inbuf, int insize,
                     int (*callback)(int, char *, int *&, char *&, void *),
                     int (*callback)(int, char *, int &, int *&, char *&, void *),
                     char *&outbuf, int outsize, void *ptr)
{
  // comm inbuf from caller decomposition to rendezvous decomposition
@@ -763,13 +763,15 @@ int Comm::rendezvous(int n, int *proclist, char *inbuf, int insize,
  // peform rendezvous computation via callback()
  // callback() allocates/populates proclist_rvous and outbuf_rvous

  int flag;
  int *proclist_rvous;
  char *outbuf_rvous;

  int nout_rvous = 
    callback(n_rvous,inbuf_rvous,proclist_rvous,outbuf_rvous,ptr);
    callback(n_rvous,inbuf_rvous,flag,proclist_rvous,outbuf_rvous,ptr);

  memory->sfree(inbuf_rvous);
  if (flag != 1) memory->sfree(inbuf_rvous);  // outbuf_rvous = inbuf_vous
  if (flag == 0) return 0;    // all nout_rvous are 0, no 2nd irregular

  // comm outbuf from rendezvous decomposition back to caller
  // caller will free outbuf
+1 −1
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ class Comm : protected Pointers {
  void ring(int, int, void *, int, void (*)(int, char *, void *),
            void *, void *, int self = 1);
  int rendezvous(int, int *, char *, int, 
                 int (*)(int, char *, int *&, char *&, void *), 
                 int (*)(int, char *, int &, int *&, char *&, void *), 
                 char *&, int, void *);

  int read_lines_from_file(FILE *, int, int, char *);
+423 −271

File changed.

Preview size limit exceeded, changes collapsed.

+17 −7
Original line number Diff line number Diff line
@@ -26,21 +26,30 @@ class Special : protected Pointers {

 private:
  int me,nprocs;
  int maxall;
  tagint **onetwo,**onethree,**onefour;

  // data used by rendezvous callback methods

  int max_rvous;
  int ncount;
  tagint *atomIDs;
  int *procowner;

  struct InRvous {
  struct IDRvous {
    int me;
    tagint atomID,partnerID;
    tagint atomID;
  };

  struct OutRvous {
  struct PairRvous {
    tagint atomID,partnerID;
  };

  void atom_owners();
  void onetwo_build_newton();
  void onetwo_build_newton_off();
  void onethree_build();
  void onefour_build();

  void dedup();
  void angle_trim();
  void dihedral_trim();
@@ -48,10 +57,11 @@ class Special : protected Pointers {
  void fix_alteration();
  void timer_output(double);

  // callback function for rendezvous communication
  // callback functions for rendezvous communication

  static int rendezvous_1234(int, char *, int *&, char *&, void *);
  static int rendezvous_trim(int, char *, int *&, char *&, void *);
  static int rendezvous_ids(int, char *, int &, int *&, char *&, void *);
  static int rendezvous_1234(int, char *, int &, int *&, char *&, void *);
  static int rendezvous_trim(int, char *, int &, int *&, char *&, void *);
};

}