diff --git a/src/USER-MISC/fix_ipi.cpp b/src/USER-MISC/fix_ipi.cpp
index 67c9cc8ee255e6ddefacdd0c2e00c4b369eb9e18..27157461395096bc2ab36b287eb3e657d689f182 100644
--- a/src/USER-MISC/fix_ipi.cpp
+++ b/src/USER-MISC/fix_ipi.cpp
@@ -219,6 +219,9 @@ FixIPI::FixIPI(LAMMPS *lmp, int narg, char **arg) :
 
   // create instance of Irregular class
   irregular = new Irregular(lmp);
+  
+  // yet, we have not assigned a socket
+  socketflag = 0;
 }
 
 /* ---------------------------------------------------------------------- */
@@ -248,9 +251,12 @@ int FixIPI::setmask()
 void FixIPI::init()
 {
   //only opens socket on master process
-  if (master) open_socket(ipisock, inet, port, host, error);
-  else ipisock=0;
+  if (master) {
+	if (!socketflag) open_socket(ipisock, inet, port, host, error);
+  } else ipisock=0;
   //! should check for success in socket opening -- but the current open_socket routine dies brutally if unsuccessful
+  // tell lammps we have assigned a socket
+  socketflag = 1;
 
   // asks for evaluation of PE at first step
   modify->compute[modify->find_compute("thermo_pe")]->invoked_scalar = -1;
diff --git a/src/USER-MISC/fix_ipi.h b/src/USER-MISC/fix_ipi.h
index 0bb3717de464e2f0537e47a886c28664ae56ac3e..191b6c280d58e85b9e69872e8ab905e39de9fe8a 100644
--- a/src/USER-MISC/fix_ipi.h
+++ b/src/USER-MISC/fix_ipi.h
@@ -35,7 +35,7 @@ class FixIPI : public Fix {
 
  protected:
   char *host; int port; int inet, master, hasdata;
-  int ipisock, me; double *buffer; long bsize;
+  int ipisock, me, socketflag; double *buffer; long bsize;
   int kspace_flag;
   int reset_flag;