Index: python/genericio.py
===================================================================
--- python/genericio.py	(revision 45bb29375c989daffcbb4973d26f941fa88de645)
+++ python/genericio.py	(revision 7889dc4f4d0ec777a3e8a60215f5edfdd6b470fe)
@@ -49,5 +49,5 @@
 #the argument types
 libpygio.get_elem_num.restype=ct.c_int64
-libpygio.get_elem_num.argtypes=[ct.c_char_p]
+libpygio.get_elem_num.argtypes=[ct.c_int,ct.c_char_p]
 
 libpygio.get_variable_type.restype=ct.c_int
@@ -75,11 +75,11 @@
 libpygio.inspect_gio.argtypes=[ct.c_char_p]
 
-def gio_read_(file_name,var_name):
+def gio_read_(comm,file_name,var_name):
     if sys.version_info[0] == 3:
         file_name = bytes(file_name,'ascii')
         var_name = bytes(var_name,'ascii')
-    var_size = libpygio.get_elem_num(file_name)
-    var_type = libpygio.get_variable_type(file_name,var_name)
-    field_count = libpygio.get_variable_field_count(file_name,var_name)
+    var_size = libpygio.get_elem_num(comm,file_name)
+    var_type = libpygio.get_variable_type(comm,file_name,var_name)
+    field_count = libpygio.get_variable_field_count(comm,file_name,var_name)
     if(var_type==10):
         print("Variable not found")
@@ -90,44 +90,44 @@
         #float
         result = np.ndarray((var_size),dtype=np.float32)
-        libpygio.read_gio_float(file_name,var_name,result.ctypes.data_as(ct.POINTER(ct.c_float)),field_count)
+        libpygio.read_gio_float(comm,file_name,var_name,result.ctypes.data_as(ct.POINTER(ct.c_float)),field_count)
         return result
     elif(var_type==1):
         #double
         result = np.ndarray((var_size),dtype=np.float64)
-        libpygio.read_gio_double(file_name,var_name,result.ctypes.data_as(ct.POINTER(ct.c_double)),field_count)
+        libpygio.read_gio_double(comm,file_name,var_name,result.ctypes.data_as(ct.POINTER(ct.c_double)),field_count)
         return result
     elif(var_type==2):
         #int32
         result = np.ndarray((var_size),dtype=np.int32)
-        libpygio.read_gio_int32(file_name,var_name,result.ctypes.data_as(ct.POINTER(ct.c_int32)),field_count)
+        libpygio.read_gio_int32(comm,file_name,var_name,result.ctypes.data_as(ct.POINTER(ct.c_int32)),field_count)
         return result
     elif(var_type==3):
         #int64
         result = np.ndarray((var_size),dtype=np.int64)
-        libpygio.read_gio_int64(file_name,var_name,result.ctypes.data_as(ct.POINTER(ct.c_int64)),field_count)
+        libpygio.read_gio_int64(comm,file_name,var_name,result.ctypes.data_as(ct.POINTER(ct.c_int64)),field_count)
         return result        
     elif(var_type==4):
         #uint16
         result = np.ndarray((var_size,field_count),dtype=np.uint16)
-        libpygio.read_gio_uint16(file_name,var_name,result.ctypes.data_as(ct.POINTER(ct.c_uint16)),field_count)
+        libpygio.read_gio_uint16(comm,file_name,var_name,result.ctypes.data_as(ct.POINTER(ct.c_uint16)),field_count)
         return result
 
-def gio_read(file_name,var_names):
+def gio_read(comm,file_name,var_names):
     ret = []
     if not isinstance(var_names,list):
         var_names = [ var_names ]
     for var_name in var_names:
-        ret.append( gio_read_(file_name,var_name) )
+        ret.append( gio_read_(comm,file_name,var_name) )
     return np.array( ret )
 
-def gio_has_variable(file_name,var_name):
+def gio_has_variable(comm,file_name,var_name):
     if sys.version_info[0] == 3:
         file_name=bytes(file_name,'ascii')
         var_name=bytes(var_name,'ascii')
-    var_size = libpygio.get_elem_num(file_name)
-    var_type = libpygio.get_variable_type(file_name,var_name)
+    var_size = libpygio.get_elem_num(comm,file_name)
+    var_type = libpygio.get_variable_type(comm,file_name,var_name)
     return var_type!=10
 
-def gio_inspect(file_name):
+def gio_inspect(comm,file_name):
     if sys.version_info[0] == 3:
         file_name=bytes(file_name,'ascii')
Index: python/lib/gio.h
===================================================================
--- python/lib/gio.h	(revision d409b8cca24c589136321db366285d0ba0d55735)
+++ python/lib/gio.h	(revision 7889dc4f4d0ec777a3e8a60215f5edfdd6b470fe)
@@ -74,5 +74,5 @@
   reader.close();
 }
-extern "C" int64_t get_elem_num(char* file_name);
+extern "C" int64_t get_elem_num(const MPI_Comm &c, char* file_name);
 
 extern "C" void read_gio_float (const MPI_Comm &C, char* file_name, char* var_name, float* data, int field_count);
@@ -90,5 +90,5 @@
   var_not_found=10
 };
-extern "C" var_type get_variable_type(char* file_name,char* var_name);
-extern "C" int get_variable_field_count(char* file_name,char* var_name);
+extern "C" var_type get_variable_type(const MPI_Comm &C, char* file_name,char* var_name);
+extern "C" int get_variable_field_count(const MPI_Comm &C, char* file_name,char* var_name);
 extern "C" void inspect_gio(const MPI_Comm &C, char* file_name);
