Exemplo n.º 1
0
 def recv(self, type_mask=raw.FLUX_MSGTYPE_ANY, match_tag=raw.FLUX_MATCHTAG_NONE, topic_glob=None, flags=0):
     """ Receive a message, returns a flux.Message containing the result or None """
     match = ffi.new(
         "struct flux_match *",
         {
             "typemask": type_mask,
             "matchtag": match_tag,
             "topic_glob": topic_glob if topic_glob is not None else ffi.NULL,
         },
     )
     handle = self.flux_recv(match[0], flags)
     if handle is not None:
         return Message(handle=handle)
     else:  # pragma: no cover
         return None
Exemplo n.º 2
0
 def recv(self,
          type_mask=flux.FLUX_MSGTYPE_ANY,
          match_tag=flux.FLUX_MATCHTAG_NONE,
          topic_glob=None,
          bsize=0,
          flags=0):
     """ Receive a message, returns a flux.Message containing the result or None """
     match = ffi.new('struct flux_match *', {
         'typemask': type_mask,
         'matchtag': match_tag,
         'topic_glob': topic_glob if topic_glob is not None else ffi.NULL,
         'bsize': bsize,
     })
     handle = self.flux_recv(match[0], flags)
     if handle is not None:
         return Message(handle=handle)
     else:  # pragma: no cover
         return None
Exemplo n.º 3
0
 def recv(self,
          type_mask=raw.FLUX_MSGTYPE_ANY,
          match_tag=raw.FLUX_MATCHTAG_NONE,
          topic_glob=None,
          flags=0):
     """
     Receive a message, returns a flux.Message containing the result or None
     """
     match = ffi.new(
         'struct flux_match *', {
             'typemask': type_mask,
             'matchtag': match_tag,
             'topic_glob':
             topic_glob if topic_glob is not None else ffi.NULL,
         })
     handle = self.flux_recv(match[0], flags)
     if handle is not None:
         return Message(handle=handle)
     else:  # pragma: no cover
         return None
Exemplo n.º 4
0
 def get_rank(self):
     rank = ffi.new("uint32_t [1]")
     self.flux_get_rank(rank)
     return rank[0]
Exemplo n.º 5
0
 def get_str(self):
     c_nodeid = ffi.new('uint32_t [1]')
     j_str = ffi.new('char *[1]')
     self.pimpl.get(c_nodeid, j_str)
     return ffi.string(j_str[0])
Exemplo n.º 6
0
 def get_rank(self):
     rank = ffi.new('uint32_t [1]')
     self.flux_get_rank(rank)
     return rank[0]
Exemplo n.º 7
0
 def get_str(self):
   j_str = ffi.new('char *[1]')
   self.pimpl.get(ffi.NULL, j_str)
   return ffi.string(j_str[0])
Exemplo n.º 8
0
 def get_str(self):
   c_nodeid = ffi.new('uint32_t [1]')
   j_str = ffi.new('char *[1]')
   self.pimpl.get(c_nodeid, j_str)
   return ffi.string(j_str[0])