コード例 #1
0
ファイル: heckle_processgroup.py プロジェクト: zzhou1985/Qsim
 def simulator_init(self, spec, log):
     """
     Used by Simulator to be able to extend Process Group
     and pass through correct LOGGER
     """
     LOGGER.debug("HeckleProcess Group: simulator_init")
     ProcessGroup.__init__(self, spec, log)
     if not self.kernel:
         self.kernel = "default"
     self.pinging_nodes = []
     self.nodefile = tempfile.mkstemp()
     os.write(self.nodefile[0], " ".join(self.location))
     os.close(self.nodefile[0])
コード例 #2
0
 def simulator_init(self, spec, log):
     """
     Used by Simulator to be able to extend Process Group
     and pass through correct LOGGER
     """
     LOGGER.debug("HeckleProcess Group: simulator_init")
     ProcessGroup.__init__(self, spec, log)
     if not self.kernel:
         self.kernel = "default"
     self.pinging_nodes = []
     self.nodefile = tempfile.mkstemp()
     os.write(self.nodefile[0], " ".join(self.location))
     os.close(self.nodefile[0])
コード例 #3
0
ファイル: heckle_processgroup.py プロジェクト: zzhou1985/Qsim
 def __init__(self, spec):
     logstr = "ProcessGroup:__INIT__:"
     LOGGER.debug(logstr + "Spec is: %s " % spec)
     ProcessGroup.__init__(self, spec, LOGGER)
     hiccup = HeckleConnector()
     self.location = spec["location"][:]
     self.pinging_nodes = spec["location"][:]
     print "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n Location is: %s, %s, %s\n&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&" % (
         self.location,
         self.pinging_nodes,
         spec["location"],
     )
     # Set up process group attributes
     if not spec["kernel"]:
         spec["kernel"] = "default"
     self.kernel = spec["kernel"]
     self.user = self.uid = spec["user"]
     self.resource_attributes = {}
     for loc in self.location:
         self.resource_attributes[loc] = hiccup.get_node_properties(loc)
     print "The environment variables at this point are: %s" % spec["env"]
     try:
         temp_env = spec["env"]["data"]
         del (spec["env"]["data"])
         spec["env"].update(temp_env)
     except:
         pass
     try:  #  Checking for Fakebuild
         spec["fakebuild"] = spec["env"]["fakebuild"]
         del spec["env"]["fakebuild"]
     except:
         spec["fakebuild"] = False
     self.env = spec["env"]
     # Write nodefile
     self.nodefile = tempfile.mkstemp()
     print "\n\n\n\n\nNodefile is: %s\n\n\n\n\n" % self.nodefile[1]
     os.write(self.nodefile[0], " ".join(self.location))
     os.chmod(self.nodefile[1], stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH)
     os.close(self.nodefile[0])
     # Make heckle reservation
     res_attrs = ["location", "kernel", "walltime", "user", "fakebuild", "comment"]
     res_args = {}
     for attr in spec:
         res_args[attr] = spec[attr]
     reservation = hiccup.make_reservation(res_args)
     self.heckle_res_id = reservation.id
コード例 #4
0
 def __init__(self, spec):
     logstr = "ProcessGroup:__INIT__:"
     LOGGER.debug(logstr + "Spec is: %s " % spec)
     ProcessGroup.__init__(self, spec, LOGGER)
     hiccup = HeckleConnector()
     self.location = spec['location'][:]
     self.pinging_nodes = spec['location'][:]
     print "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n Location is: %s, %s, %s\n&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&" % (
         self.location, self.pinging_nodes, spec['location'])
     # Set up process group attributes
     if not spec['kernel']:
         spec['kernel'] = "default"
     self.kernel = spec['kernel']
     self.user = self.uid = spec['user']
     self.resource_attributes = {}
     for loc in self.location:
         self.resource_attributes[loc] = hiccup.get_node_properties(loc)
     print "The environment variables at this point are: %s" % spec['env']
     try:
         temp_env = spec['env']['data']
         del (spec['env']['data'])
         spec['env'].update(temp_env)
     except:
         pass
     try:  #  Checking for Fakebuild
         spec['fakebuild'] = spec['env']['fakebuild']
         del spec['env']['fakebuild']
     except:
         spec['fakebuild'] = False
     self.env = spec['env']
     # Write nodefile
     self.nodefile = tempfile.mkstemp()
     print "\n\n\n\n\nNodefile is: %s\n\n\n\n\n" % self.nodefile[1]
     os.write(self.nodefile[0], " ".join(self.location))
     os.chmod(self.nodefile[1], stat.S_IRUSR|stat.S_IWUSR|stat.S_IRGRP| \
     stat.S_IROTH)
     os.close(self.nodefile[0])
     # Make heckle reservation
     res_attrs = ['location', 'kernel', 'walltime', 'user', 'fakebuild'\
         , 'comment']
     res_args = {}
     for attr in spec:
         res_args[attr] = spec[attr]
     reservation = hiccup.make_reservation(res_args)
     self.heckle_res_id = reservation.id