partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
valid | DataFlowKernel.checkpoint | Checkpoint the dfk incrementally to a checkpoint file.
When called, every task that has been completed yet not
checkpointed is checkpointed to a file.
Kwargs:
- tasks (List of task ids) : List of task ids to checkpoint. Default=None
if set t... | parsl/dataflow/dflow.py | def checkpoint(self, tasks=None):
"""Checkpoint the dfk incrementally to a checkpoint file.
When called, every task that has been completed yet not
checkpointed is checkpointed to a file.
Kwargs:
- tasks (List of task ids) : List of task ids to checkpoint. Default=None
... | def checkpoint(self, tasks=None):
"""Checkpoint the dfk incrementally to a checkpoint file.
When called, every task that has been completed yet not
checkpointed is checkpointed to a file.
Kwargs:
- tasks (List of task ids) : List of task ids to checkpoint. Default=None
... | [
"Checkpoint",
"the",
"dfk",
"incrementally",
"to",
"a",
"checkpoint",
"file",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/dataflow/dflow.py#L859-L940 | [
"def",
"checkpoint",
"(",
"self",
",",
"tasks",
"=",
"None",
")",
":",
"with",
"self",
".",
"checkpoint_lock",
":",
"checkpoint_queue",
"=",
"None",
"if",
"tasks",
":",
"checkpoint_queue",
"=",
"tasks",
"else",
":",
"checkpoint_queue",
"=",
"self",
".",
"t... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | DataFlowKernel._load_checkpoints | Load a checkpoint file into a lookup table.
The data being loaded from the pickle file mostly contains input
attributes of the task: func, args, kwargs, env...
To simplify the check of whether the exact task has been completed
in the checkpoint, we hash these input params and use it as ... | parsl/dataflow/dflow.py | def _load_checkpoints(self, checkpointDirs):
"""Load a checkpoint file into a lookup table.
The data being loaded from the pickle file mostly contains input
attributes of the task: func, args, kwargs, env...
To simplify the check of whether the exact task has been completed
in t... | def _load_checkpoints(self, checkpointDirs):
"""Load a checkpoint file into a lookup table.
The data being loaded from the pickle file mostly contains input
attributes of the task: func, args, kwargs, env...
To simplify the check of whether the exact task has been completed
in t... | [
"Load",
"a",
"checkpoint",
"file",
"into",
"a",
"lookup",
"table",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/dataflow/dflow.py#L942-L992 | [
"def",
"_load_checkpoints",
"(",
"self",
",",
"checkpointDirs",
")",
":",
"memo_lookup_table",
"=",
"{",
"}",
"for",
"checkpoint_dir",
"in",
"checkpointDirs",
":",
"logger",
".",
"info",
"(",
"\"Loading checkpoints from {}\"",
".",
"format",
"(",
"checkpoint_dir",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | DataFlowKernel.load_checkpoints | Load checkpoints from the checkpoint files into a dictionary.
The results are used to pre-populate the memoizer's lookup_table
Kwargs:
- checkpointDirs (list) : List of run folder to use as checkpoints
Eg. ['runinfo/001', 'runinfo/002']
Returns:
- dict... | parsl/dataflow/dflow.py | def load_checkpoints(self, checkpointDirs):
"""Load checkpoints from the checkpoint files into a dictionary.
The results are used to pre-populate the memoizer's lookup_table
Kwargs:
- checkpointDirs (list) : List of run folder to use as checkpoints
Eg. ['runinfo/001... | def load_checkpoints(self, checkpointDirs):
"""Load checkpoints from the checkpoint files into a dictionary.
The results are used to pre-populate the memoizer's lookup_table
Kwargs:
- checkpointDirs (list) : List of run folder to use as checkpoints
Eg. ['runinfo/001... | [
"Load",
"checkpoints",
"from",
"the",
"checkpoint",
"files",
"into",
"a",
"dictionary",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/dataflow/dflow.py#L994-L1014 | [
"def",
"load_checkpoints",
"(",
"self",
",",
"checkpointDirs",
")",
":",
"self",
".",
"memo_lookup_table",
"=",
"None",
"if",
"not",
"checkpointDirs",
":",
"return",
"{",
"}",
"if",
"type",
"(",
"checkpointDirs",
")",
"is",
"not",
"list",
":",
"raise",
"Ba... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | DataFlowKernelLoader.load | Load a DataFlowKernel.
Args:
- config (Config) : Configuration to load. This config will be passed to a
new DataFlowKernel instantiation which will be set as the active DataFlowKernel.
Returns:
- DataFlowKernel : The loaded DataFlowKernel object. | parsl/dataflow/dflow.py | def load(cls, config: Optional[Config] = None):
"""Load a DataFlowKernel.
Args:
- config (Config) : Configuration to load. This config will be passed to a
new DataFlowKernel instantiation which will be set as the active DataFlowKernel.
Returns:
- DataFlowKe... | def load(cls, config: Optional[Config] = None):
"""Load a DataFlowKernel.
Args:
- config (Config) : Configuration to load. This config will be passed to a
new DataFlowKernel instantiation which will be set as the active DataFlowKernel.
Returns:
- DataFlowKe... | [
"Load",
"a",
"DataFlowKernel",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/dataflow/dflow.py#L1033-L1050 | [
"def",
"load",
"(",
"cls",
",",
"config",
":",
"Optional",
"[",
"Config",
"]",
"=",
"None",
")",
":",
"if",
"cls",
".",
"_dfk",
"is",
"not",
"None",
":",
"raise",
"RuntimeError",
"(",
"'Config has already been loaded'",
")",
"if",
"config",
"is",
"None",... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | starter | Start the interchange process
The executor is expected to call this function. The args, kwargs match that of the Interchange.__init__ | parsl/executors/high_throughput/interchange.py | def starter(comm_q, *args, **kwargs):
"""Start the interchange process
The executor is expected to call this function. The args, kwargs match that of the Interchange.__init__
"""
# logger = multiprocessing.get_logger()
ic = Interchange(*args, **kwargs)
comm_q.put((ic.worker_task_port,
... | def starter(comm_q, *args, **kwargs):
"""Start the interchange process
The executor is expected to call this function. The args, kwargs match that of the Interchange.__init__
"""
# logger = multiprocessing.get_logger()
ic = Interchange(*args, **kwargs)
comm_q.put((ic.worker_task_port,
... | [
"Start",
"the",
"interchange",
"process"
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/high_throughput/interchange.py#L521-L530 | [
"def",
"starter",
"(",
"comm_q",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# logger = multiprocessing.get_logger()",
"ic",
"=",
"Interchange",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"comm_q",
".",
"put",
"(",
"(",
"ic",
".",
"worke... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | Interchange.get_tasks | Obtains a batch of tasks from the internal pending_task_queue
Parameters
----------
count: int
Count of tasks to get from the queue
Returns
-------
List of upto count tasks. May return fewer than count down to an empty list
eg. [{'task_id':<x>, '... | parsl/executors/high_throughput/interchange.py | def get_tasks(self, count):
""" Obtains a batch of tasks from the internal pending_task_queue
Parameters
----------
count: int
Count of tasks to get from the queue
Returns
-------
List of upto count tasks. May return fewer than count down to an empty... | def get_tasks(self, count):
""" Obtains a batch of tasks from the internal pending_task_queue
Parameters
----------
count: int
Count of tasks to get from the queue
Returns
-------
List of upto count tasks. May return fewer than count down to an empty... | [
"Obtains",
"a",
"batch",
"of",
"tasks",
"from",
"the",
"internal",
"pending_task_queue"
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/high_throughput/interchange.py#L192-L214 | [
"def",
"get_tasks",
"(",
"self",
",",
"count",
")",
":",
"tasks",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"0",
",",
"count",
")",
":",
"try",
":",
"x",
"=",
"self",
".",
"pending_task_queue",
".",
"get",
"(",
"block",
"=",
"False",
")",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | Interchange.migrate_tasks_to_internal | Pull tasks from the incoming tasks 0mq pipe onto the internal
pending task queue
Parameters:
-----------
kill_event : threading.Event
Event to let the thread know when it is time to die. | parsl/executors/high_throughput/interchange.py | def migrate_tasks_to_internal(self, kill_event):
"""Pull tasks from the incoming tasks 0mq pipe onto the internal
pending task queue
Parameters:
-----------
kill_event : threading.Event
Event to let the thread know when it is time to die.
"""
logger... | def migrate_tasks_to_internal(self, kill_event):
"""Pull tasks from the incoming tasks 0mq pipe onto the internal
pending task queue
Parameters:
-----------
kill_event : threading.Event
Event to let the thread know when it is time to die.
"""
logger... | [
"Pull",
"tasks",
"from",
"the",
"incoming",
"tasks",
"0mq",
"pipe",
"onto",
"the",
"internal",
"pending",
"task",
"queue"
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/high_throughput/interchange.py#L216-L244 | [
"def",
"migrate_tasks_to_internal",
"(",
"self",
",",
"kill_event",
")",
":",
"logger",
".",
"info",
"(",
"\"[TASK_PULL_THREAD] Starting\"",
")",
"task_counter",
"=",
"0",
"poller",
"=",
"zmq",
".",
"Poller",
"(",
")",
"poller",
".",
"register",
"(",
"self",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | Interchange._command_server | Command server to run async command to the interchange | parsl/executors/high_throughput/interchange.py | def _command_server(self, kill_event):
""" Command server to run async command to the interchange
"""
logger.debug("[COMMAND] Command Server Starting")
while not kill_event.is_set():
try:
command_req = self.command_channel.recv_pyobj()
logger.d... | def _command_server(self, kill_event):
""" Command server to run async command to the interchange
"""
logger.debug("[COMMAND] Command Server Starting")
while not kill_event.is_set():
try:
command_req = self.command_channel.recv_pyobj()
logger.d... | [
"Command",
"server",
"to",
"run",
"async",
"command",
"to",
"the",
"interchange"
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/high_throughput/interchange.py#L246-L298 | [
"def",
"_command_server",
"(",
"self",
",",
"kill_event",
")",
":",
"logger",
".",
"debug",
"(",
"\"[COMMAND] Command Server Starting\"",
")",
"while",
"not",
"kill_event",
".",
"is_set",
"(",
")",
":",
"try",
":",
"command_req",
"=",
"self",
".",
"command_cha... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | Interchange.start | Start the NeedNameQeueu
Parameters:
----------
TODO: Move task receiving to a thread | parsl/executors/high_throughput/interchange.py | def start(self, poll_period=None):
""" Start the NeedNameQeueu
Parameters:
----------
TODO: Move task receiving to a thread
"""
logger.info("Incoming ports bound")
if poll_period is None:
poll_period = self.poll_period
start = time.time()
... | def start(self, poll_period=None):
""" Start the NeedNameQeueu
Parameters:
----------
TODO: Move task receiving to a thread
"""
logger.info("Incoming ports bound")
if poll_period is None:
poll_period = self.poll_period
start = time.time()
... | [
"Start",
"the",
"NeedNameQeueu"
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/high_throughput/interchange.py#L300-L485 | [
"def",
"start",
"(",
"self",
",",
"poll_period",
"=",
"None",
")",
":",
"logger",
".",
"info",
"(",
"\"Incoming ports bound\"",
")",
"if",
"poll_period",
"is",
"None",
":",
"poll_period",
"=",
"self",
".",
"poll_period",
"start",
"=",
"time",
".",
"time",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | starter | Start the interchange process
The executor is expected to call this function. The args, kwargs match that of the Interchange.__init__ | parsl/executors/low_latency/interchange.py | def starter(comm_q, *args, **kwargs):
"""Start the interchange process
The executor is expected to call this function. The args, kwargs match that of the Interchange.__init__
"""
# logger = multiprocessing.get_logger()
ic = Interchange(*args, **kwargs)
comm_q.put(ic.worker_port)
ic.start()
... | def starter(comm_q, *args, **kwargs):
"""Start the interchange process
The executor is expected to call this function. The args, kwargs match that of the Interchange.__init__
"""
# logger = multiprocessing.get_logger()
ic = Interchange(*args, **kwargs)
comm_q.put(ic.worker_port)
ic.start()
... | [
"Start",
"the",
"interchange",
"process"
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/low_latency/interchange.py#L123-L132 | [
"def",
"starter",
"(",
"comm_q",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# logger = multiprocessing.get_logger()",
"ic",
"=",
"Interchange",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"comm_q",
".",
"put",
"(",
"ic",
".",
"worker_port"... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | Interchange.start | TODO: docstring | parsl/executors/low_latency/interchange.py | def start(self):
""" TODO: docstring """
logger.info("Starting interchange")
# last = time.time()
while True:
# active_flag = False
socks = dict(self.poller.poll(1))
if socks.get(self.task_incoming) == zmq.POLLIN:
message = self.task_... | def start(self):
""" TODO: docstring """
logger.info("Starting interchange")
# last = time.time()
while True:
# active_flag = False
socks = dict(self.poller.poll(1))
if socks.get(self.task_incoming) == zmq.POLLIN:
message = self.task_... | [
"TODO",
":",
"docstring"
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/low_latency/interchange.py#L58-L81 | [
"def",
"start",
"(",
"self",
")",
":",
"logger",
".",
"info",
"(",
"\"Starting interchange\"",
")",
"# last = time.time()",
"while",
"True",
":",
"# active_flag = False",
"socks",
"=",
"dict",
"(",
"self",
".",
"poller",
".",
"poll",
"(",
"1",
")",
")",
"i... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | execute_task | Deserialize the buffer and execute the task.
Returns the result or throws exception. | parsl/executors/high_throughput/process_worker_pool.py | def execute_task(bufs):
"""Deserialize the buffer and execute the task.
Returns the result or throws exception.
"""
user_ns = locals()
user_ns.update({'__builtins__': __builtins__})
f, args, kwargs = unpack_apply_message(bufs, user_ns, copy=False)
# We might need to look into callability ... | def execute_task(bufs):
"""Deserialize the buffer and execute the task.
Returns the result or throws exception.
"""
user_ns = locals()
user_ns.update({'__builtins__': __builtins__})
f, args, kwargs = unpack_apply_message(bufs, user_ns, copy=False)
# We might need to look into callability ... | [
"Deserialize",
"the",
"buffer",
"and",
"execute",
"the",
"task",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/high_throughput/process_worker_pool.py#L329-L364 | [
"def",
"execute_task",
"(",
"bufs",
")",
":",
"user_ns",
"=",
"locals",
"(",
")",
"user_ns",
".",
"update",
"(",
"{",
"'__builtins__'",
":",
"__builtins__",
"}",
")",
"f",
",",
"args",
",",
"kwargs",
"=",
"unpack_apply_message",
"(",
"bufs",
",",
"user_n... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | Manager.push_results | Listens on the pending_result_queue and sends out results via 0mq
Parameters:
-----------
kill_event : threading.Event
Event to let the thread know when it is time to die. | parsl/executors/high_throughput/process_worker_pool.py | def push_results(self, kill_event):
""" Listens on the pending_result_queue and sends out results via 0mq
Parameters:
-----------
kill_event : threading.Event
Event to let the thread know when it is time to die.
"""
logger.debug("[RESULT_PUSH_THREAD] Start... | def push_results(self, kill_event):
""" Listens on the pending_result_queue and sends out results via 0mq
Parameters:
-----------
kill_event : threading.Event
Event to let the thread know when it is time to die.
"""
logger.debug("[RESULT_PUSH_THREAD] Start... | [
"Listens",
"on",
"the",
"pending_result_queue",
"and",
"sends",
"out",
"results",
"via",
"0mq"
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/high_throughput/process_worker_pool.py#L241-L275 | [
"def",
"push_results",
"(",
"self",
",",
"kill_event",
")",
":",
"logger",
".",
"debug",
"(",
"\"[RESULT_PUSH_THREAD] Starting thread\"",
")",
"push_poll_period",
"=",
"max",
"(",
"10",
",",
"self",
".",
"poll_period",
")",
"/",
"1000",
"# push_poll_period must be... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | Manager.start | Start the worker processes.
TODO: Move task receiving to a thread | parsl/executors/high_throughput/process_worker_pool.py | def start(self):
""" Start the worker processes.
TODO: Move task receiving to a thread
"""
start = time.time()
self._kill_event = threading.Event()
self.procs = {}
for worker_id in range(self.worker_count):
p = multiprocessing.Process(target=worker, ... | def start(self):
""" Start the worker processes.
TODO: Move task receiving to a thread
"""
start = time.time()
self._kill_event = threading.Event()
self.procs = {}
for worker_id in range(self.worker_count):
p = multiprocessing.Process(target=worker, ... | [
"Start",
"the",
"worker",
"processes",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/high_throughput/process_worker_pool.py#L277-L326 | [
"def",
"start",
"(",
"self",
")",
":",
"start",
"=",
"time",
".",
"time",
"(",
")",
"self",
".",
"_kill_event",
"=",
"threading",
".",
"Event",
"(",
")",
"self",
".",
"procs",
"=",
"{",
"}",
"for",
"worker_id",
"in",
"range",
"(",
"self",
".",
"w... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | DataManager.get_data_manager | Return the DataManager of the currently loaded DataFlowKernel. | parsl/data_provider/data_manager.py | def get_data_manager(cls):
"""Return the DataManager of the currently loaded DataFlowKernel.
"""
from parsl.dataflow.dflow import DataFlowKernelLoader
dfk = DataFlowKernelLoader.dfk()
return dfk.executors['data_manager'] | def get_data_manager(cls):
"""Return the DataManager of the currently loaded DataFlowKernel.
"""
from parsl.dataflow.dflow import DataFlowKernelLoader
dfk = DataFlowKernelLoader.dfk()
return dfk.executors['data_manager'] | [
"Return",
"the",
"DataManager",
"of",
"the",
"currently",
"loaded",
"DataFlowKernel",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/data_provider/data_manager.py#L51-L57 | [
"def",
"get_data_manager",
"(",
"cls",
")",
":",
"from",
"parsl",
".",
"dataflow",
".",
"dflow",
"import",
"DataFlowKernelLoader",
"dfk",
"=",
"DataFlowKernelLoader",
".",
"dfk",
"(",
")",
"return",
"dfk",
".",
"executors",
"[",
"'data_manager'",
"]"
] | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | DataManager.shutdown | Shutdown the ThreadPool.
Kwargs:
- block (bool): To block for confirmations or not | parsl/data_provider/data_manager.py | def shutdown(self, block=False):
"""Shutdown the ThreadPool.
Kwargs:
- block (bool): To block for confirmations or not
"""
x = self.executor.shutdown(wait=block)
logger.debug("Done with executor shutdown")
return x | def shutdown(self, block=False):
"""Shutdown the ThreadPool.
Kwargs:
- block (bool): To block for confirmations or not
"""
x = self.executor.shutdown(wait=block)
logger.debug("Done with executor shutdown")
return x | [
"Shutdown",
"the",
"ThreadPool",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/data_provider/data_manager.py#L90-L99 | [
"def",
"shutdown",
"(",
"self",
",",
"block",
"=",
"False",
")",
":",
"x",
"=",
"self",
".",
"executor",
".",
"shutdown",
"(",
"wait",
"=",
"block",
")",
"logger",
".",
"debug",
"(",
"\"Done with executor shutdown\"",
")",
"return",
"x"
] | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | DataManager.stage_in | Transport the file from the input source to the executor.
This function returns a DataFuture.
Args:
- self
- file (File) : file to stage in
- executor (str) : an executor the file is going to be staged in to.
If the executor argument ... | parsl/data_provider/data_manager.py | def stage_in(self, file, executor):
"""Transport the file from the input source to the executor.
This function returns a DataFuture.
Args:
- self
- file (File) : file to stage in
- executor (str) : an executor the file is going to be staged in to.
... | def stage_in(self, file, executor):
"""Transport the file from the input source to the executor.
This function returns a DataFuture.
Args:
- self
- file (File) : file to stage in
- executor (str) : an executor the file is going to be staged in to.
... | [
"Transport",
"the",
"file",
"from",
"the",
"input",
"source",
"to",
"the",
"executor",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/data_provider/data_manager.py#L136-L166 | [
"def",
"stage_in",
"(",
"self",
",",
"file",
",",
"executor",
")",
":",
"if",
"file",
".",
"scheme",
"==",
"'ftp'",
":",
"working_dir",
"=",
"self",
".",
"dfk",
".",
"executors",
"[",
"executor",
"]",
".",
"working_dir",
"stage_in_app",
"=",
"self",
".... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | DataManager.stage_out | Transport the file from the local filesystem to the remote Globus endpoint.
This function returns a DataFuture.
Args:
- self
- file (File) - file to stage out
- executor (str) - Which executor the file is going to be staged out from.
... | parsl/data_provider/data_manager.py | def stage_out(self, file, executor):
"""Transport the file from the local filesystem to the remote Globus endpoint.
This function returns a DataFuture.
Args:
- self
- file (File) - file to stage out
- executor (str) - Which executor the file is going to be s... | def stage_out(self, file, executor):
"""Transport the file from the local filesystem to the remote Globus endpoint.
This function returns a DataFuture.
Args:
- self
- file (File) - file to stage out
- executor (str) - Which executor the file is going to be s... | [
"Transport",
"the",
"file",
"from",
"the",
"local",
"filesystem",
"to",
"the",
"remote",
"Globus",
"endpoint",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/data_provider/data_manager.py#L190-L213 | [
"def",
"stage_out",
"(",
"self",
",",
"file",
",",
"executor",
")",
":",
"if",
"file",
".",
"scheme",
"==",
"'http'",
"or",
"file",
".",
"scheme",
"==",
"'https'",
":",
"raise",
"Exception",
"(",
"'HTTP/HTTPS file staging out is not supported'",
")",
"elif",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | get_all_checkpoints | Finds the checkpoints from all last runs.
Note that checkpoints are incremental, and this helper will not find
previous checkpoints from earlier than the most recent run. It probably
should be made to do so.
Kwargs:
- rundir(str) : Path to the runinfo directory
Returns:
- a list sui... | parsl/utils.py | def get_all_checkpoints(rundir="runinfo"):
"""Finds the checkpoints from all last runs.
Note that checkpoints are incremental, and this helper will not find
previous checkpoints from earlier than the most recent run. It probably
should be made to do so.
Kwargs:
- rundir(str) : Path to the r... | def get_all_checkpoints(rundir="runinfo"):
"""Finds the checkpoints from all last runs.
Note that checkpoints are incremental, and this helper will not find
previous checkpoints from earlier than the most recent run. It probably
should be made to do so.
Kwargs:
- rundir(str) : Path to the r... | [
"Finds",
"the",
"checkpoints",
"from",
"all",
"last",
"runs",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/utils.py#L35-L65 | [
"def",
"get_all_checkpoints",
"(",
"rundir",
"=",
"\"runinfo\"",
")",
":",
"if",
"(",
"not",
"os",
".",
"path",
".",
"isdir",
"(",
"rundir",
")",
")",
":",
"return",
"[",
"]",
"dirs",
"=",
"sorted",
"(",
"os",
".",
"listdir",
"(",
"rundir",
")",
")... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | get_last_checkpoint | Find the checkpoint from the last run, if one exists.
Note that checkpoints are incremental, and this helper will not find
previous checkpoints from earlier than the most recent run. It probably
should be made to do so.
Kwargs:
- rundir(str) : Path to the runinfo directory
Returns:
- ... | parsl/utils.py | def get_last_checkpoint(rundir="runinfo"):
"""Find the checkpoint from the last run, if one exists.
Note that checkpoints are incremental, and this helper will not find
previous checkpoints from earlier than the most recent run. It probably
should be made to do so.
Kwargs:
- rundir(str) : P... | def get_last_checkpoint(rundir="runinfo"):
"""Find the checkpoint from the last run, if one exists.
Note that checkpoints are incremental, and this helper will not find
previous checkpoints from earlier than the most recent run. It probably
should be made to do so.
Kwargs:
- rundir(str) : P... | [
"Find",
"the",
"checkpoint",
"from",
"the",
"last",
"run",
"if",
"one",
"exists",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/utils.py#L68-L97 | [
"def",
"get_last_checkpoint",
"(",
"rundir",
"=",
"\"runinfo\"",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"isdir",
"(",
"rundir",
")",
":",
"return",
"[",
"]",
"dirs",
"=",
"sorted",
"(",
"os",
".",
"listdir",
"(",
"rundir",
")",
")",
"if",
"... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | wtime_to_minutes | wtime_to_minutes
Convert standard wallclock time string to minutes.
Args:
- Time_string in HH:MM:SS format
Returns:
(int) minutes | parsl/utils.py | def wtime_to_minutes(time_string):
''' wtime_to_minutes
Convert standard wallclock time string to minutes.
Args:
- Time_string in HH:MM:SS format
Returns:
(int) minutes
'''
hours, mins, seconds = time_string.split(':')
total_mins = int(hours) * 60 + int(mins)
if total... | def wtime_to_minutes(time_string):
''' wtime_to_minutes
Convert standard wallclock time string to minutes.
Args:
- Time_string in HH:MM:SS format
Returns:
(int) minutes
'''
hours, mins, seconds = time_string.split(':')
total_mins = int(hours) * 60 + int(mins)
if total... | [
"wtime_to_minutes"
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/utils.py#L132-L148 | [
"def",
"wtime_to_minutes",
"(",
"time_string",
")",
":",
"hours",
",",
"mins",
",",
"seconds",
"=",
"time_string",
".",
"split",
"(",
"':'",
")",
"total_mins",
"=",
"int",
"(",
"hours",
")",
"*",
"60",
"+",
"int",
"(",
"mins",
")",
"if",
"total_mins",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | interactive | Decorator for making functions appear as interactively defined.
This results in the function being linked to the user_ns as globals()
instead of the module globals(). | parsl/executors/serialize/canning.py | def interactive(f):
"""Decorator for making functions appear as interactively defined.
This results in the function being linked to the user_ns as globals()
instead of the module globals().
"""
# build new FunctionType, so it can have the right globals
# interactive functions never have closure... | def interactive(f):
"""Decorator for making functions appear as interactively defined.
This results in the function being linked to the user_ns as globals()
instead of the module globals().
"""
# build new FunctionType, so it can have the right globals
# interactive functions never have closure... | [
"Decorator",
"for",
"making",
"functions",
"appear",
"as",
"interactively",
"defined",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/serialize/canning.py#L41-L56 | [
"def",
"interactive",
"(",
"f",
")",
":",
"# build new FunctionType, so it can have the right globals",
"# interactive functions never have closures, that's kind of the point",
"if",
"isinstance",
"(",
"f",
",",
"FunctionType",
")",
":",
"mainmod",
"=",
"__import__",
"(",
"'_... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | use_pickle | Revert to using stdlib pickle.
Reverts custom serialization enabled by use_dill|cloudpickle. | parsl/executors/serialize/canning.py | def use_pickle():
"""Revert to using stdlib pickle.
Reverts custom serialization enabled by use_dill|cloudpickle.
"""
from . import serialize
serialize.pickle = serialize._stdlib_pickle
# restore special function handling
can_map[FunctionType] = _original_can_map[FunctionType] | def use_pickle():
"""Revert to using stdlib pickle.
Reverts custom serialization enabled by use_dill|cloudpickle.
"""
from . import serialize
serialize.pickle = serialize._stdlib_pickle
# restore special function handling
can_map[FunctionType] = _original_can_map[FunctionType] | [
"Revert",
"to",
"using",
"stdlib",
"pickle",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/serialize/canning.py#L87-L96 | [
"def",
"use_pickle",
"(",
")",
":",
"from",
".",
"import",
"serialize",
"serialize",
".",
"pickle",
"=",
"serialize",
".",
"_stdlib_pickle",
"# restore special function handling",
"can_map",
"[",
"FunctionType",
"]",
"=",
"_original_can_map",
"[",
"FunctionType",
"]... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | _import_mapping | Import any string-keys in a type mapping. | parsl/executors/serialize/canning.py | def _import_mapping(mapping, original=None):
"""Import any string-keys in a type mapping."""
#log = get_logger()
#log.debug("Importing canning map")
for key, value in list(mapping.items()):
if isinstance(key, string_types):
try:
cls = import_item(key)
exce... | def _import_mapping(mapping, original=None):
"""Import any string-keys in a type mapping."""
#log = get_logger()
#log.debug("Importing canning map")
for key, value in list(mapping.items()):
if isinstance(key, string_types):
try:
cls = import_item(key)
exce... | [
"Import",
"any",
"string",
"-",
"keys",
"in",
"a",
"type",
"mapping",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/serialize/canning.py#L305-L320 | [
"def",
"_import_mapping",
"(",
"mapping",
",",
"original",
"=",
"None",
")",
":",
"#log = get_logger()",
"#log.debug(\"Importing canning map\")",
"for",
"key",
",",
"value",
"in",
"list",
"(",
"mapping",
".",
"items",
"(",
")",
")",
":",
"if",
"isinstance",
"(... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | istype | Like isinstance(obj, check), but strict.
This won't catch subclasses. | parsl/executors/serialize/canning.py | def istype(obj, check):
"""Like isinstance(obj, check), but strict.
This won't catch subclasses.
"""
if isinstance(check, tuple):
for cls in check:
if type(obj) is cls:
return True
return False
else:
return type(obj) is check | def istype(obj, check):
"""Like isinstance(obj, check), but strict.
This won't catch subclasses.
"""
if isinstance(check, tuple):
for cls in check:
if type(obj) is cls:
return True
return False
else:
return type(obj) is check | [
"Like",
"isinstance",
"(",
"obj",
"check",
")",
"but",
"strict",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/serialize/canning.py#L323-L334 | [
"def",
"istype",
"(",
"obj",
",",
"check",
")",
":",
"if",
"isinstance",
"(",
"check",
",",
"tuple",
")",
":",
"for",
"cls",
"in",
"check",
":",
"if",
"type",
"(",
"obj",
")",
"is",
"cls",
":",
"return",
"True",
"return",
"False",
"else",
":",
"r... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | can | Prepare an object for pickling. | parsl/executors/serialize/canning.py | def can(obj):
"""Prepare an object for pickling."""
import_needed = False
for cls, canner in iteritems(can_map):
if isinstance(cls, string_types):
import_needed = True
break
elif istype(obj, cls):
return canner(obj)
if import_needed:
# perfor... | def can(obj):
"""Prepare an object for pickling."""
import_needed = False
for cls, canner in iteritems(can_map):
if isinstance(cls, string_types):
import_needed = True
break
elif istype(obj, cls):
return canner(obj)
if import_needed:
# perfor... | [
"Prepare",
"an",
"object",
"for",
"pickling",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/serialize/canning.py#L337-L354 | [
"def",
"can",
"(",
"obj",
")",
":",
"import_needed",
"=",
"False",
"for",
"cls",
",",
"canner",
"in",
"iteritems",
"(",
"can_map",
")",
":",
"if",
"isinstance",
"(",
"cls",
",",
"string_types",
")",
":",
"import_needed",
"=",
"True",
"break",
"elif",
"... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | can_dict | Can the *values* of a dict. | parsl/executors/serialize/canning.py | def can_dict(obj):
"""Can the *values* of a dict."""
if istype(obj, dict):
newobj = {}
for k, v in iteritems(obj):
newobj[k] = can(v)
return newobj
else:
return obj | def can_dict(obj):
"""Can the *values* of a dict."""
if istype(obj, dict):
newobj = {}
for k, v in iteritems(obj):
newobj[k] = can(v)
return newobj
else:
return obj | [
"Can",
"the",
"*",
"values",
"*",
"of",
"a",
"dict",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/serialize/canning.py#L364-L372 | [
"def",
"can_dict",
"(",
"obj",
")",
":",
"if",
"istype",
"(",
"obj",
",",
"dict",
")",
":",
"newobj",
"=",
"{",
"}",
"for",
"k",
",",
"v",
"in",
"iteritems",
"(",
"obj",
")",
":",
"newobj",
"[",
"k",
"]",
"=",
"can",
"(",
"v",
")",
"return",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | can_sequence | Can the elements of a sequence. | parsl/executors/serialize/canning.py | def can_sequence(obj):
"""Can the elements of a sequence."""
if istype(obj, sequence_types):
t = type(obj)
return t([can(i) for i in obj])
else:
return obj | def can_sequence(obj):
"""Can the elements of a sequence."""
if istype(obj, sequence_types):
t = type(obj)
return t([can(i) for i in obj])
else:
return obj | [
"Can",
"the",
"elements",
"of",
"a",
"sequence",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/serialize/canning.py#L378-L384 | [
"def",
"can_sequence",
"(",
"obj",
")",
":",
"if",
"istype",
"(",
"obj",
",",
"sequence_types",
")",
":",
"t",
"=",
"type",
"(",
"obj",
")",
"return",
"t",
"(",
"[",
"can",
"(",
"i",
")",
"for",
"i",
"in",
"obj",
"]",
")",
"else",
":",
"return"... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | uncan | Invert canning. | parsl/executors/serialize/canning.py | def uncan(obj, g=None):
"""Invert canning."""
import_needed = False
for cls, uncanner in iteritems(uncan_map):
if isinstance(cls, string_types):
import_needed = True
break
elif isinstance(obj, cls):
return uncanner(obj, g)
if import_needed:
# ... | def uncan(obj, g=None):
"""Invert canning."""
import_needed = False
for cls, uncanner in iteritems(uncan_map):
if isinstance(cls, string_types):
import_needed = True
break
elif isinstance(obj, cls):
return uncanner(obj, g)
if import_needed:
# ... | [
"Invert",
"canning",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/serialize/canning.py#L387-L403 | [
"def",
"uncan",
"(",
"obj",
",",
"g",
"=",
"None",
")",
":",
"import_needed",
"=",
"False",
"for",
"cls",
",",
"uncanner",
"in",
"iteritems",
"(",
"uncan_map",
")",
":",
"if",
"isinstance",
"(",
"cls",
",",
"string_types",
")",
":",
"import_needed",
"=... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | Strategy.unset_logging | Mute newly added handlers to the root level, right after calling executor.status | parsl/dataflow/strategy.py | def unset_logging(self):
""" Mute newly added handlers to the root level, right after calling executor.status
"""
if self.logger_flag is True:
return
root_logger = logging.getLogger()
for hndlr in root_logger.handlers:
if hndlr not in self.prior_loghandl... | def unset_logging(self):
""" Mute newly added handlers to the root level, right after calling executor.status
"""
if self.logger_flag is True:
return
root_logger = logging.getLogger()
for hndlr in root_logger.handlers:
if hndlr not in self.prior_loghandl... | [
"Mute",
"newly",
"added",
"handlers",
"to",
"the",
"root",
"level",
"right",
"after",
"calling",
"executor",
".",
"status"
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/dataflow/strategy.py#L141-L153 | [
"def",
"unset_logging",
"(",
"self",
")",
":",
"if",
"self",
".",
"logger_flag",
"is",
"True",
":",
"return",
"root_logger",
"=",
"logging",
".",
"getLogger",
"(",
")",
"for",
"hndlr",
"in",
"root_logger",
".",
"handlers",
":",
"if",
"hndlr",
"not",
"in"... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | Strategy._strategy_simple | Peek at the DFK and the executors specified.
We assume here that tasks are not held in a runnable
state, and that all tasks from an app would be sent to
a single specific executor, i.e tasks cannot be specified
to go to one of more executors.
Args:
- tasks (task_ids... | parsl/dataflow/strategy.py | def _strategy_simple(self, tasks, *args, kind=None, **kwargs):
"""Peek at the DFK and the executors specified.
We assume here that tasks are not held in a runnable
state, and that all tasks from an app would be sent to
a single specific executor, i.e tasks cannot be specified
to... | def _strategy_simple(self, tasks, *args, kind=None, **kwargs):
"""Peek at the DFK and the executors specified.
We assume here that tasks are not held in a runnable
state, and that all tasks from an app would be sent to
a single specific executor, i.e tasks cannot be specified
to... | [
"Peek",
"at",
"the",
"DFK",
"and",
"the",
"executors",
"specified",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/dataflow/strategy.py#L155-L274 | [
"def",
"_strategy_simple",
"(",
"self",
",",
"tasks",
",",
"*",
"args",
",",
"kind",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"for",
"label",
",",
"executor",
"in",
"self",
".",
"dfk",
".",
"executors",
".",
"items",
"(",
")",
":",
"if",
"... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | Globus.transfer_file | A Globus transfer job (task) can be in one of the three states: ACTIVE, SUCCEEDED, FAILED.
Parsl every 20 seconds polls a status of the transfer job (task) from the Globus Transfer service,
with 60 second timeout limit. If the task is ACTIVE after time runs out 'task_wait' returns False,
and Tru... | parsl/data_provider/globus.py | def transfer_file(cls, src_ep, dst_ep, src_path, dst_path):
tc = globus_sdk.TransferClient(authorizer=cls.authorizer)
td = globus_sdk.TransferData(tc, src_ep, dst_ep)
td.add_item(src_path, dst_path)
try:
task = tc.submit_transfer(td)
except Exception as e:
... | def transfer_file(cls, src_ep, dst_ep, src_path, dst_path):
tc = globus_sdk.TransferClient(authorizer=cls.authorizer)
td = globus_sdk.TransferData(tc, src_ep, dst_ep)
td.add_item(src_path, dst_path)
try:
task = tc.submit_transfer(td)
except Exception as e:
... | [
"A",
"Globus",
"transfer",
"job",
"(",
"task",
")",
"can",
"be",
"in",
"one",
"of",
"the",
"three",
"states",
":",
"ACTIVE",
"SUCCEEDED",
"FAILED",
".",
"Parsl",
"every",
"20",
"seconds",
"polls",
"a",
"status",
"of",
"the",
"transfer",
"job",
"(",
"ta... | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/data_provider/globus.py#L56-L98 | [
"def",
"transfer_file",
"(",
"cls",
",",
"src_ep",
",",
"dst_ep",
",",
"src_path",
",",
"dst_path",
")",
":",
"tc",
"=",
"globus_sdk",
".",
"TransferClient",
"(",
"authorizer",
"=",
"cls",
".",
"authorizer",
")",
"td",
"=",
"globus_sdk",
".",
"TransferData... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | get_parsl_logger | Parameters
----------
logger_name : str, optional
Name of the logger to use. Prevents adding repeat handlers or incorrect handlers
is_logging_server : Bool, optional
Used internally to determine which handler to return when using local db logging
monitoring_config : MonitoringConfig, opt... | parsl/monitoring/monitoring_base.py | def get_parsl_logger(
logger_name='parsl_monitor_logger',
is_logging_server=False,
monitoring_config=None,
**kwargs):
"""
Parameters
----------
logger_name : str, optional
Name of the logger to use. Prevents adding repeat ha... | def get_parsl_logger(
logger_name='parsl_monitor_logger',
is_logging_server=False,
monitoring_config=None,
**kwargs):
"""
Parameters
----------
logger_name : str, optional
Name of the logger to use. Prevents adding repeat ha... | [
"Parameters",
"----------",
"logger_name",
":",
"str",
"optional",
"Name",
"of",
"the",
"logger",
"to",
"use",
".",
"Prevents",
"adding",
"repeat",
"handlers",
"or",
"incorrect",
"handlers",
"is_logging_server",
":",
"Bool",
"optional",
"Used",
"internally",
"to",... | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/monitoring/monitoring_base.py#L130-L179 | [
"def",
"get_parsl_logger",
"(",
"logger_name",
"=",
"'parsl_monitor_logger'",
",",
"is_logging_server",
"=",
"False",
",",
"monitoring_config",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"logger",
"=",
"logging",
".",
"getLogger",
"(",
"logger_name",
")",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | Controller.start | Start the controller. | parsl/executors/ipp_controller.py | def start(self):
"""Start the controller."""
if self.mode == "manual":
return
if self.ipython_dir != '~/.ipython':
self.ipython_dir = os.path.abspath(os.path.expanduser(self.ipython_dir))
if self.log:
stdout = open(os.path.join(self.ipython_dir, "{0... | def start(self):
"""Start the controller."""
if self.mode == "manual":
return
if self.ipython_dir != '~/.ipython':
self.ipython_dir = os.path.abspath(os.path.expanduser(self.ipython_dir))
if self.log:
stdout = open(os.path.join(self.ipython_dir, "{0... | [
"Start",
"the",
"controller",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/ipp_controller.py#L66-L108 | [
"def",
"start",
"(",
"self",
")",
":",
"if",
"self",
".",
"mode",
"==",
"\"manual\"",
":",
"return",
"if",
"self",
".",
"ipython_dir",
"!=",
"'~/.ipython'",
":",
"self",
".",
"ipython_dir",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"os",
".",
"pat... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | Controller.engine_file | Specify path to the ipcontroller-engine.json file.
This file is stored in in the ipython_dir/profile folders.
Returns :
- str, File path to engine file | parsl/executors/ipp_controller.py | def engine_file(self):
"""Specify path to the ipcontroller-engine.json file.
This file is stored in in the ipython_dir/profile folders.
Returns :
- str, File path to engine file
"""
return os.path.join(self.ipython_dir,
'profile_{0}'.fo... | def engine_file(self):
"""Specify path to the ipcontroller-engine.json file.
This file is stored in in the ipython_dir/profile folders.
Returns :
- str, File path to engine file
"""
return os.path.join(self.ipython_dir,
'profile_{0}'.fo... | [
"Specify",
"path",
"to",
"the",
"ipcontroller",
"-",
"engine",
".",
"json",
"file",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/ipp_controller.py#L111-L121 | [
"def",
"engine_file",
"(",
"self",
")",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"ipython_dir",
",",
"'profile_{0}'",
".",
"format",
"(",
"self",
".",
"profile",
")",
",",
"'security/ipcontroller-engine.json'",
")"
] | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | Controller.client_file | Specify path to the ipcontroller-client.json file.
This file is stored in in the ipython_dir/profile folders.
Returns :
- str, File path to client file | parsl/executors/ipp_controller.py | def client_file(self):
"""Specify path to the ipcontroller-client.json file.
This file is stored in in the ipython_dir/profile folders.
Returns :
- str, File path to client file
"""
return os.path.join(self.ipython_dir,
'profile_{0}'.fo... | def client_file(self):
"""Specify path to the ipcontroller-client.json file.
This file is stored in in the ipython_dir/profile folders.
Returns :
- str, File path to client file
"""
return os.path.join(self.ipython_dir,
'profile_{0}'.fo... | [
"Specify",
"path",
"to",
"the",
"ipcontroller",
"-",
"client",
".",
"json",
"file",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/ipp_controller.py#L124-L134 | [
"def",
"client_file",
"(",
"self",
")",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"ipython_dir",
",",
"'profile_{0}'",
".",
"format",
"(",
"self",
".",
"profile",
")",
",",
"'security/ipcontroller-client.json'",
")"
] | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | Controller.close | Terminate the controller process and its child processes.
Args:
- None | parsl/executors/ipp_controller.py | def close(self):
"""Terminate the controller process and its child processes.
Args:
- None
"""
if self.reuse:
logger.debug("Ipcontroller not shutting down: reuse enabled")
return
if self.mode == "manual":
logger.debug("Ipcontrol... | def close(self):
"""Terminate the controller process and its child processes.
Args:
- None
"""
if self.reuse:
logger.debug("Ipcontroller not shutting down: reuse enabled")
return
if self.mode == "manual":
logger.debug("Ipcontrol... | [
"Terminate",
"the",
"controller",
"process",
"and",
"its",
"child",
"processes",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/ipp_controller.py#L136-L166 | [
"def",
"close",
"(",
"self",
")",
":",
"if",
"self",
".",
"reuse",
":",
"logger",
".",
"debug",
"(",
"\"Ipcontroller not shutting down: reuse enabled\"",
")",
"return",
"if",
"self",
".",
"mode",
"==",
"\"manual\"",
":",
"logger",
".",
"debug",
"(",
"\"Ipcon... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | Memoizer.make_hash | Create a hash of the task inputs.
This uses a serialization library borrowed from ipyparallel.
If this fails here, then all ipp calls are also likely to fail due to failure
at serialization.
Args:
- task (dict) : Task dictionary from dfk.tasks
Returns:
... | parsl/dataflow/memoization.py | def make_hash(self, task):
"""Create a hash of the task inputs.
This uses a serialization library borrowed from ipyparallel.
If this fails here, then all ipp calls are also likely to fail due to failure
at serialization.
Args:
- task (dict) : Task dictionary from df... | def make_hash(self, task):
"""Create a hash of the task inputs.
This uses a serialization library borrowed from ipyparallel.
If this fails here, then all ipp calls are also likely to fail due to failure
at serialization.
Args:
- task (dict) : Task dictionary from df... | [
"Create",
"a",
"hash",
"of",
"the",
"task",
"inputs",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/dataflow/memoization.py#L58-L79 | [
"def",
"make_hash",
"(",
"self",
",",
"task",
")",
":",
"# Function name TODO: Add fn body later",
"t",
"=",
"[",
"serialize_object",
"(",
"task",
"[",
"'func_name'",
"]",
")",
"[",
"0",
"]",
",",
"serialize_object",
"(",
"task",
"[",
"'fn_hash'",
"]",
")",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | Memoizer.check_memo | Create a hash of the task and its inputs and check the lookup table for this hash.
If present, the results are returned. The result is a tuple indicating whether a memo
exists and the result, since a Null result is possible and could be confusing.
This seems like a reasonable option without rel... | parsl/dataflow/memoization.py | def check_memo(self, task_id, task):
"""Create a hash of the task and its inputs and check the lookup table for this hash.
If present, the results are returned. The result is a tuple indicating whether a memo
exists and the result, since a Null result is possible and could be confusing.
... | def check_memo(self, task_id, task):
"""Create a hash of the task and its inputs and check the lookup table for this hash.
If present, the results are returned. The result is a tuple indicating whether a memo
exists and the result, since a Null result is possible and could be confusing.
... | [
"Create",
"a",
"hash",
"of",
"the",
"task",
"and",
"its",
"inputs",
"and",
"check",
"the",
"lookup",
"table",
"for",
"this",
"hash",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/dataflow/memoization.py#L81-L111 | [
"def",
"check_memo",
"(",
"self",
",",
"task_id",
",",
"task",
")",
":",
"if",
"not",
"self",
".",
"memoize",
"or",
"not",
"task",
"[",
"'memoize'",
"]",
":",
"task",
"[",
"'hashsum'",
"]",
"=",
"None",
"return",
"None",
",",
"None",
"hashsum",
"=",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | Memoizer.update_memo | Updates the memoization lookup table with the result from a task.
Args:
- task_id (int): Integer task id
- task (dict) : A task dict from dfk.tasks
- r (Result future): Result future
A warning is issued when a hash collision occurs during the update.
This... | parsl/dataflow/memoization.py | def update_memo(self, task_id, task, r):
"""Updates the memoization lookup table with the result from a task.
Args:
- task_id (int): Integer task id
- task (dict) : A task dict from dfk.tasks
- r (Result future): Result future
A warning is issued when a h... | def update_memo(self, task_id, task, r):
"""Updates the memoization lookup table with the result from a task.
Args:
- task_id (int): Integer task id
- task (dict) : A task dict from dfk.tasks
- r (Result future): Result future
A warning is issued when a h... | [
"Updates",
"the",
"memoization",
"lookup",
"table",
"with",
"the",
"result",
"from",
"a",
"task",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/dataflow/memoization.py#L130-L149 | [
"def",
"update_memo",
"(",
"self",
",",
"task_id",
",",
"task",
",",
"r",
")",
":",
"if",
"not",
"self",
".",
"memoize",
"or",
"not",
"task",
"[",
"'memoize'",
"]",
":",
"return",
"if",
"task",
"[",
"'hashsum'",
"]",
"in",
"self",
".",
"memo_lookup_t... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | _nbytes | Return byte-size of a memoryview or buffer. | parsl/executors/serialize/serialize.py | def _nbytes(buf):
"""Return byte-size of a memoryview or buffer."""
if isinstance(buf, memoryview):
if PY3:
# py3 introduces nbytes attribute
return buf.nbytes
else:
# compute nbytes on py2
size = buf.itemsize
for dim in buf.shape:
... | def _nbytes(buf):
"""Return byte-size of a memoryview or buffer."""
if isinstance(buf, memoryview):
if PY3:
# py3 introduces nbytes attribute
return buf.nbytes
else:
# compute nbytes on py2
size = buf.itemsize
for dim in buf.shape:
... | [
"Return",
"byte",
"-",
"size",
"of",
"a",
"memoryview",
"or",
"buffer",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/serialize/serialize.py#L38-L52 | [
"def",
"_nbytes",
"(",
"buf",
")",
":",
"if",
"isinstance",
"(",
"buf",
",",
"memoryview",
")",
":",
"if",
"PY3",
":",
"# py3 introduces nbytes attribute",
"return",
"buf",
".",
"nbytes",
"else",
":",
"# compute nbytes on py2",
"size",
"=",
"buf",
".",
"item... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | _extract_buffers | Extract buffers larger than a certain threshold. | parsl/executors/serialize/serialize.py | def _extract_buffers(obj, threshold=MAX_BYTES):
"""Extract buffers larger than a certain threshold."""
buffers = []
if isinstance(obj, CannedObject) and obj.buffers:
for i, buf in enumerate(obj.buffers):
nbytes = _nbytes(buf)
if nbytes > threshold:
# buffer la... | def _extract_buffers(obj, threshold=MAX_BYTES):
"""Extract buffers larger than a certain threshold."""
buffers = []
if isinstance(obj, CannedObject) and obj.buffers:
for i, buf in enumerate(obj.buffers):
nbytes = _nbytes(buf)
if nbytes > threshold:
# buffer la... | [
"Extract",
"buffers",
"larger",
"than",
"a",
"certain",
"threshold",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/serialize/serialize.py#L55-L71 | [
"def",
"_extract_buffers",
"(",
"obj",
",",
"threshold",
"=",
"MAX_BYTES",
")",
":",
"buffers",
"=",
"[",
"]",
"if",
"isinstance",
"(",
"obj",
",",
"CannedObject",
")",
"and",
"obj",
".",
"buffers",
":",
"for",
"i",
",",
"buf",
"in",
"enumerate",
"(",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | _restore_buffers | Restore extracted buffers. | parsl/executors/serialize/serialize.py | def _restore_buffers(obj, buffers):
"""Restore extracted buffers."""
if isinstance(obj, CannedObject) and obj.buffers:
for i, buf in enumerate(obj.buffers):
if buf is None:
obj.buffers[i] = buffers.pop(0) | def _restore_buffers(obj, buffers):
"""Restore extracted buffers."""
if isinstance(obj, CannedObject) and obj.buffers:
for i, buf in enumerate(obj.buffers):
if buf is None:
obj.buffers[i] = buffers.pop(0) | [
"Restore",
"extracted",
"buffers",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/serialize/serialize.py#L74-L79 | [
"def",
"_restore_buffers",
"(",
"obj",
",",
"buffers",
")",
":",
"if",
"isinstance",
"(",
"obj",
",",
"CannedObject",
")",
"and",
"obj",
".",
"buffers",
":",
"for",
"i",
",",
"buf",
"in",
"enumerate",
"(",
"obj",
".",
"buffers",
")",
":",
"if",
"buf"... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | serialize_object | Serialize an object into a list of sendable buffers.
Parameters
----------
obj : object
The object to be serialized
buffer_threshold : int
The threshold (in bytes) for pulling out data buffers
to avoid pickling them.
item_threshold : int
The maximum number of items ... | parsl/executors/serialize/serialize.py | def serialize_object(obj, buffer_threshold=MAX_BYTES, item_threshold=MAX_ITEMS):
"""Serialize an object into a list of sendable buffers.
Parameters
----------
obj : object
The object to be serialized
buffer_threshold : int
The threshold (in bytes) for pulling out data buffers
... | def serialize_object(obj, buffer_threshold=MAX_BYTES, item_threshold=MAX_ITEMS):
"""Serialize an object into a list of sendable buffers.
Parameters
----------
obj : object
The object to be serialized
buffer_threshold : int
The threshold (in bytes) for pulling out data buffers
... | [
"Serialize",
"an",
"object",
"into",
"a",
"list",
"of",
"sendable",
"buffers",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/serialize/serialize.py#L82-L118 | [
"def",
"serialize_object",
"(",
"obj",
",",
"buffer_threshold",
"=",
"MAX_BYTES",
",",
"item_threshold",
"=",
"MAX_ITEMS",
")",
":",
"buffers",
"=",
"[",
"]",
"if",
"istype",
"(",
"obj",
",",
"sequence_types",
")",
"and",
"len",
"(",
"obj",
")",
"<",
"it... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | deserialize_object | Reconstruct an object serialized by serialize_object from data buffers.
Parameters
----------
bufs : list of buffers/bytes
g : globals to be used when uncanning
Returns
-------
(newobj, bufs) : unpacked object, and the list of remaining unused buffers. | parsl/executors/serialize/serialize.py | def deserialize_object(buffers, g=None):
"""Reconstruct an object serialized by serialize_object from data buffers.
Parameters
----------
bufs : list of buffers/bytes
g : globals to be used when uncanning
Returns
-------
(newobj, bufs) : unpacked object, and the list of remaining un... | def deserialize_object(buffers, g=None):
"""Reconstruct an object serialized by serialize_object from data buffers.
Parameters
----------
bufs : list of buffers/bytes
g : globals to be used when uncanning
Returns
-------
(newobj, bufs) : unpacked object, and the list of remaining un... | [
"Reconstruct",
"an",
"object",
"serialized",
"by",
"serialize_object",
"from",
"data",
"buffers",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/serialize/serialize.py#L121-L153 | [
"def",
"deserialize_object",
"(",
"buffers",
",",
"g",
"=",
"None",
")",
":",
"bufs",
"=",
"list",
"(",
"buffers",
")",
"pobj",
"=",
"buffer_to_bytes_py2",
"(",
"bufs",
".",
"pop",
"(",
"0",
")",
")",
"canned",
"=",
"pickle",
".",
"loads",
"(",
"pobj... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | pack_apply_message | Pack up a function, args, and kwargs to be sent over the wire.
Each element of args/kwargs will be canned for special treatment,
but inspection will not go any deeper than that.
Any object whose data is larger than `threshold` will not have their data copied
(only numpy arrays and bytes/buffers suppo... | parsl/executors/serialize/serialize.py | def pack_apply_message(f, args, kwargs, buffer_threshold=MAX_BYTES, item_threshold=MAX_ITEMS):
"""Pack up a function, args, and kwargs to be sent over the wire.
Each element of args/kwargs will be canned for special treatment,
but inspection will not go any deeper than that.
Any object whose data is l... | def pack_apply_message(f, args, kwargs, buffer_threshold=MAX_BYTES, item_threshold=MAX_ITEMS):
"""Pack up a function, args, and kwargs to be sent over the wire.
Each element of args/kwargs will be canned for special treatment,
but inspection will not go any deeper than that.
Any object whose data is l... | [
"Pack",
"up",
"a",
"function",
"args",
"and",
"kwargs",
"to",
"be",
"sent",
"over",
"the",
"wire",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/serialize/serialize.py#L156-L185 | [
"def",
"pack_apply_message",
"(",
"f",
",",
"args",
",",
"kwargs",
",",
"buffer_threshold",
"=",
"MAX_BYTES",
",",
"item_threshold",
"=",
"MAX_ITEMS",
")",
":",
"arg_bufs",
"=",
"list",
"(",
"chain",
".",
"from_iterable",
"(",
"serialize_object",
"(",
"arg",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | unpack_apply_message | Unpack f,args,kwargs from buffers packed by pack_apply_message().
Returns: original f,args,kwargs | parsl/executors/serialize/serialize.py | def unpack_apply_message(bufs, g=None, copy=True):
"""Unpack f,args,kwargs from buffers packed by pack_apply_message().
Returns: original f,args,kwargs
"""
bufs = list(bufs) # allow us to pop
assert len(bufs) >= 2, "not enough buffers!"
pf = buffer_to_bytes_py2(bufs.pop(0))
f = uncan(pickl... | def unpack_apply_message(bufs, g=None, copy=True):
"""Unpack f,args,kwargs from buffers packed by pack_apply_message().
Returns: original f,args,kwargs
"""
bufs = list(bufs) # allow us to pop
assert len(bufs) >= 2, "not enough buffers!"
pf = buffer_to_bytes_py2(bufs.pop(0))
f = uncan(pickl... | [
"Unpack",
"f",
"args",
"kwargs",
"from",
"buffers",
"packed",
"by",
"pack_apply_message",
"()",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/serialize/serialize.py#L188-L214 | [
"def",
"unpack_apply_message",
"(",
"bufs",
",",
"g",
"=",
"None",
",",
"copy",
"=",
"True",
")",
":",
"bufs",
"=",
"list",
"(",
"bufs",
")",
"# allow us to pop",
"assert",
"len",
"(",
"bufs",
")",
">=",
"2",
",",
"\"not enough buffers!\"",
"pf",
"=",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | ClusterProvider._write_submit_script | Generate submit script and write it to a file.
Args:
- template (string) : The template string to be used for the writing submit script
- script_filename (string) : Name of the submit script
- job_name (string) : job name
- configs (dict) : configs that g... | parsl/providers/cluster_provider.py | def _write_submit_script(self, template, script_filename, job_name, configs):
"""Generate submit script and write it to a file.
Args:
- template (string) : The template string to be used for the writing submit script
- script_filename (string) : Name of the submit script
... | def _write_submit_script(self, template, script_filename, job_name, configs):
"""Generate submit script and write it to a file.
Args:
- template (string) : The template string to be used for the writing submit script
- script_filename (string) : Name of the submit script
... | [
"Generate",
"submit",
"script",
"and",
"write",
"it",
"to",
"a",
"file",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/cluster_provider.py#L88-L125 | [
"def",
"_write_submit_script",
"(",
"self",
",",
"template",
",",
"script_filename",
",",
"job_name",
",",
"configs",
")",
":",
"try",
":",
"submit_script",
"=",
"Template",
"(",
"template",
")",
".",
"substitute",
"(",
"jobname",
"=",
"job_name",
",",
"*",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | ClusterProvider.status | Get the status of a list of jobs identified by the job identifiers
returned from the submit request.
Args:
- job_ids (list) : A list of job identifiers
Returns:
- A list of status from ['PENDING', 'RUNNING', 'CANCELLED', 'COMPLETED',
'FAILED', 'TIMEOUT'... | parsl/providers/cluster_provider.py | def status(self, job_ids):
""" Get the status of a list of jobs identified by the job identifiers
returned from the submit request.
Args:
- job_ids (list) : A list of job identifiers
Returns:
- A list of status from ['PENDING', 'RUNNING', 'CANCELLED', 'COMPLET... | def status(self, job_ids):
""" Get the status of a list of jobs identified by the job identifiers
returned from the submit request.
Args:
- job_ids (list) : A list of job identifiers
Returns:
- A list of status from ['PENDING', 'RUNNING', 'CANCELLED', 'COMPLET... | [
"Get",
"the",
"status",
"of",
"a",
"list",
"of",
"jobs",
"identified",
"by",
"the",
"job",
"identifiers",
"returned",
"from",
"the",
"submit",
"request",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/cluster_provider.py#L151-L168 | [
"def",
"status",
"(",
"self",
",",
"job_ids",
")",
":",
"if",
"job_ids",
":",
"self",
".",
"_status",
"(",
")",
"return",
"[",
"self",
".",
"resources",
"[",
"jid",
"]",
"[",
"'status'",
"]",
"for",
"jid",
"in",
"job_ids",
"]"
] | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | LocalProvider.status | Get the status of a list of jobs identified by their ids.
Args:
- job_ids (List of ids) : List of identifiers for the jobs
Returns:
- List of status codes. | parsl/providers/local/local.py | def status(self, job_ids):
''' Get the status of a list of jobs identified by their ids.
Args:
- job_ids (List of ids) : List of identifiers for the jobs
Returns:
- List of status codes.
'''
logger.debug("Checking status of: {0}".format(job_ids))
... | def status(self, job_ids):
''' Get the status of a list of jobs identified by their ids.
Args:
- job_ids (List of ids) : List of identifiers for the jobs
Returns:
- List of status codes.
'''
logger.debug("Checking status of: {0}".format(job_ids))
... | [
"Get",
"the",
"status",
"of",
"a",
"list",
"of",
"jobs",
"identified",
"by",
"their",
"ids",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/local/local.py#L79-L120 | [
"def",
"status",
"(",
"self",
",",
"job_ids",
")",
":",
"logger",
".",
"debug",
"(",
"\"Checking status of: {0}\"",
".",
"format",
"(",
"job_ids",
")",
")",
"for",
"job_id",
"in",
"self",
".",
"resources",
":",
"if",
"self",
".",
"resources",
"[",
"job_i... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | LocalProvider.submit | Submits the command onto an Local Resource Manager job of blocksize parallel elements.
Submit returns an ID that corresponds to the task that was just submitted.
If tasks_per_node < 1:
1/tasks_per_node is provisioned
If tasks_per_node == 1:
A single node is provision... | parsl/providers/local/local.py | def submit(self, command, blocksize, tasks_per_node, job_name="parsl.auto"):
''' Submits the command onto an Local Resource Manager job of blocksize parallel elements.
Submit returns an ID that corresponds to the task that was just submitted.
If tasks_per_node < 1:
1/tasks_per_nod... | def submit(self, command, blocksize, tasks_per_node, job_name="parsl.auto"):
''' Submits the command onto an Local Resource Manager job of blocksize parallel elements.
Submit returns an ID that corresponds to the task that was just submitted.
If tasks_per_node < 1:
1/tasks_per_nod... | [
"Submits",
"the",
"command",
"onto",
"an",
"Local",
"Resource",
"Manager",
"job",
"of",
"blocksize",
"parallel",
"elements",
".",
"Submit",
"returns",
"an",
"ID",
"that",
"corresponds",
"to",
"the",
"task",
"that",
"was",
"just",
"submitted",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/local/local.py#L153-L221 | [
"def",
"submit",
"(",
"self",
",",
"command",
",",
"blocksize",
",",
"tasks_per_node",
",",
"job_name",
"=",
"\"parsl.auto\"",
")",
":",
"job_name",
"=",
"\"{0}.{1}\"",
".",
"format",
"(",
"job_name",
",",
"time",
".",
"time",
"(",
")",
")",
"# Set script ... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | LocalProvider.cancel | Cancels the jobs specified by a list of job ids
Args:
job_ids : [<job_id> ...]
Returns :
[True/False...] : If the cancel operation fails the entire list will be False. | parsl/providers/local/local.py | def cancel(self, job_ids):
''' Cancels the jobs specified by a list of job ids
Args:
job_ids : [<job_id> ...]
Returns :
[True/False...] : If the cancel operation fails the entire list will be False.
'''
for job in job_ids:
logger.debug("Terminating j... | def cancel(self, job_ids):
''' Cancels the jobs specified by a list of job ids
Args:
job_ids : [<job_id> ...]
Returns :
[True/False...] : If the cancel operation fails the entire list will be False.
'''
for job in job_ids:
logger.debug("Terminating j... | [
"Cancels",
"the",
"jobs",
"specified",
"by",
"a",
"list",
"of",
"job",
"ids"
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/local/local.py#L223-L248 | [
"def",
"cancel",
"(",
"self",
",",
"job_ids",
")",
":",
"for",
"job",
"in",
"job_ids",
":",
"logger",
".",
"debug",
"(",
"\"Terminating job/proc_id: {0}\"",
".",
"format",
"(",
"job",
")",
")",
"# Here we are assuming that for local, the job_ids are the process id's",... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | CobaltProvider.submit | Submits the command onto an Local Resource Manager job of blocksize parallel elements.
Submit returns an ID that corresponds to the task that was just submitted.
If tasks_per_node < 1 : ! This is illegal. tasks_per_node should be integer
If tasks_per_node == 1:
A single node is p... | parsl/providers/cobalt/cobalt.py | def submit(self, command, blocksize, tasks_per_node, job_name="parsl.auto"):
""" Submits the command onto an Local Resource Manager job of blocksize parallel elements.
Submit returns an ID that corresponds to the task that was just submitted.
If tasks_per_node < 1 : ! This is illegal. tasks_pe... | def submit(self, command, blocksize, tasks_per_node, job_name="parsl.auto"):
""" Submits the command onto an Local Resource Manager job of blocksize parallel elements.
Submit returns an ID that corresponds to the task that was just submitted.
If tasks_per_node < 1 : ! This is illegal. tasks_pe... | [
"Submits",
"the",
"command",
"onto",
"an",
"Local",
"Resource",
"Manager",
"job",
"of",
"blocksize",
"parallel",
"elements",
".",
"Submit",
"returns",
"an",
"ID",
"that",
"corresponds",
"to",
"the",
"task",
"that",
"was",
"just",
"submitted",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/cobalt/cobalt.py#L129-L212 | [
"def",
"submit",
"(",
"self",
",",
"command",
",",
"blocksize",
",",
"tasks_per_node",
",",
"job_name",
"=",
"\"parsl.auto\"",
")",
":",
"if",
"self",
".",
"provisioned_blocks",
">=",
"self",
".",
"max_blocks",
":",
"logger",
".",
"warn",
"(",
"\"[%s] at cap... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | AWSProvider.initialize_boto_client | Initialize the boto client. | parsl/providers/aws/aws.py | def initialize_boto_client(self):
"""Initialize the boto client."""
self.session = self.create_session()
self.client = self.session.client('ec2')
self.ec2 = self.session.resource('ec2')
self.instances = []
self.instance_states = {}
self.vpc_id = 0
self.sg... | def initialize_boto_client(self):
"""Initialize the boto client."""
self.session = self.create_session()
self.client = self.session.client('ec2')
self.ec2 = self.session.resource('ec2')
self.instances = []
self.instance_states = {}
self.vpc_id = 0
self.sg... | [
"Initialize",
"the",
"boto",
"client",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/aws/aws.py#L171-L181 | [
"def",
"initialize_boto_client",
"(",
"self",
")",
":",
"self",
".",
"session",
"=",
"self",
".",
"create_session",
"(",
")",
"self",
".",
"client",
"=",
"self",
".",
"session",
".",
"client",
"(",
"'ec2'",
")",
"self",
".",
"ec2",
"=",
"self",
".",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | AWSProvider.read_state_file | Read the state file, if it exists.
If this script has been run previously, resource IDs will have been written to a
state file. On starting a run, a state file will be looked for before creating new
infrastructure. Information on VPCs, security groups, and subnets are saved, as
well as ... | parsl/providers/aws/aws.py | def read_state_file(self, state_file):
"""Read the state file, if it exists.
If this script has been run previously, resource IDs will have been written to a
state file. On starting a run, a state file will be looked for before creating new
infrastructure. Information on VPCs, security ... | def read_state_file(self, state_file):
"""Read the state file, if it exists.
If this script has been run previously, resource IDs will have been written to a
state file. On starting a run, a state file will be looked for before creating new
infrastructure. Information on VPCs, security ... | [
"Read",
"the",
"state",
"file",
"if",
"it",
"exists",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/aws/aws.py#L183-L205 | [
"def",
"read_state_file",
"(",
"self",
",",
"state_file",
")",
":",
"try",
":",
"fh",
"=",
"open",
"(",
"state_file",
",",
"'r'",
")",
"state",
"=",
"json",
".",
"load",
"(",
"fh",
")",
"self",
".",
"vpc_id",
"=",
"state",
"[",
"'vpcID'",
"]",
"sel... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | AWSProvider.write_state_file | Save information that must persist to a file.
We do not want to create a new VPC and new identical security groups, so we save
information about them in a file between runs. | parsl/providers/aws/aws.py | def write_state_file(self):
"""Save information that must persist to a file.
We do not want to create a new VPC and new identical security groups, so we save
information about them in a file between runs.
"""
fh = open('awsproviderstate.json', 'w')
state = {}
sta... | def write_state_file(self):
"""Save information that must persist to a file.
We do not want to create a new VPC and new identical security groups, so we save
information about them in a file between runs.
"""
fh = open('awsproviderstate.json', 'w')
state = {}
sta... | [
"Save",
"information",
"that",
"must",
"persist",
"to",
"a",
"file",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/aws/aws.py#L207-L220 | [
"def",
"write_state_file",
"(",
"self",
")",
":",
"fh",
"=",
"open",
"(",
"'awsproviderstate.json'",
",",
"'w'",
")",
"state",
"=",
"{",
"}",
"state",
"[",
"'vpcID'",
"]",
"=",
"self",
".",
"vpc_id",
"state",
"[",
"'sgID'",
"]",
"=",
"self",
".",
"sg... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | AWSProvider.create_session | Create a session.
First we look in self.key_file for a path to a json file with the
credentials. The key file should have 'AWSAccessKeyId' and 'AWSSecretKey'.
Next we look at self.profile for a profile name and try
to use the Session call to automatically pick up the keys for the profi... | parsl/providers/aws/aws.py | def create_session(self):
"""Create a session.
First we look in self.key_file for a path to a json file with the
credentials. The key file should have 'AWSAccessKeyId' and 'AWSSecretKey'.
Next we look at self.profile for a profile name and try
to use the Session call to automat... | def create_session(self):
"""Create a session.
First we look in self.key_file for a path to a json file with the
credentials. The key file should have 'AWSAccessKeyId' and 'AWSSecretKey'.
Next we look at self.profile for a profile name and try
to use the Session call to automat... | [
"Create",
"a",
"session",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/aws/aws.py#L222-L275 | [
"def",
"create_session",
"(",
"self",
")",
":",
"session",
"=",
"None",
"if",
"self",
".",
"key_file",
"is",
"not",
"None",
":",
"credfile",
"=",
"os",
".",
"path",
".",
"expandvars",
"(",
"os",
".",
"path",
".",
"expanduser",
"(",
"self",
".",
"key_... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | AWSProvider.create_vpc | Create and configure VPC
We create a VPC with CIDR 10.0.0.0/16, which provides up to 64,000 instances.
We attach a subnet for each availability zone within the region specified in the
config. We give each subnet an ip range like 10.0.X.0/20, which is large enough
for approx. 4000 insta... | parsl/providers/aws/aws.py | def create_vpc(self):
"""Create and configure VPC
We create a VPC with CIDR 10.0.0.0/16, which provides up to 64,000 instances.
We attach a subnet for each availability zone within the region specified in the
config. We give each subnet an ip range like 10.0.X.0/20, which is large enou... | def create_vpc(self):
"""Create and configure VPC
We create a VPC with CIDR 10.0.0.0/16, which provides up to 64,000 instances.
We attach a subnet for each availability zone within the region specified in the
config. We give each subnet an ip range like 10.0.X.0/20, which is large enou... | [
"Create",
"and",
"configure",
"VPC"
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/aws/aws.py#L277-L334 | [
"def",
"create_vpc",
"(",
"self",
")",
":",
"try",
":",
"# We use a large VPC so that the cluster can get large",
"vpc",
"=",
"self",
".",
"ec2",
".",
"create_vpc",
"(",
"CidrBlock",
"=",
"'10.0.0.0/16'",
",",
"AmazonProvidedIpv6CidrBlock",
"=",
"False",
",",
")",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | AWSProvider.security_group | Create and configure a new security group.
Allows all ICMP in, all TCP and UDP in within VPC.
This security group is very open. It allows all incoming ping requests on all
ports. It also allows all outgoing traffic on all ports. This can be limited by
changing the allowed port ranges.
... | parsl/providers/aws/aws.py | def security_group(self, vpc):
"""Create and configure a new security group.
Allows all ICMP in, all TCP and UDP in within VPC.
This security group is very open. It allows all incoming ping requests on all
ports. It also allows all outgoing traffic on all ports. This can be limited by
... | def security_group(self, vpc):
"""Create and configure a new security group.
Allows all ICMP in, all TCP and UDP in within VPC.
This security group is very open. It allows all incoming ping requests on all
ports. It also allows all outgoing traffic on all ports. This can be limited by
... | [
"Create",
"and",
"configure",
"a",
"new",
"security",
"group",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/aws/aws.py#L336-L413 | [
"def",
"security_group",
"(",
"self",
",",
"vpc",
")",
":",
"sg",
"=",
"vpc",
".",
"create_security_group",
"(",
"GroupName",
"=",
"\"private-subnet\"",
",",
"Description",
"=",
"\"security group for remote executors\"",
")",
"ip_ranges",
"=",
"[",
"{",
"'CidrIp'"... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | AWSProvider.config_route_table | Configure route table for Virtual Private Cloud (VPC).
Parameters
----------
vpc : dict
Representation of the VPC (created by create_vpc()).
internet_gateway : dict
Representation of the internet gateway (created by create_vpc()). | parsl/providers/aws/aws.py | def config_route_table(self, vpc, internet_gateway):
"""Configure route table for Virtual Private Cloud (VPC).
Parameters
----------
vpc : dict
Representation of the VPC (created by create_vpc()).
internet_gateway : dict
Representation of the internet gat... | def config_route_table(self, vpc, internet_gateway):
"""Configure route table for Virtual Private Cloud (VPC).
Parameters
----------
vpc : dict
Representation of the VPC (created by create_vpc()).
internet_gateway : dict
Representation of the internet gat... | [
"Configure",
"route",
"table",
"for",
"Virtual",
"Private",
"Cloud",
"(",
"VPC",
")",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/aws/aws.py#L415-L429 | [
"def",
"config_route_table",
"(",
"self",
",",
"vpc",
",",
"internet_gateway",
")",
":",
"route_table",
"=",
"vpc",
".",
"create_route_table",
"(",
")",
"route_table",
".",
"create_route",
"(",
"DestinationCidrBlock",
"=",
"'0.0.0.0/0'",
",",
"GatewayId",
"=",
"... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | AWSProvider.spin_up_instance | Start an instance in the VPC in the first available subnet.
N instances will be started if nodes_per_block > 1.
Not supported. We only do 1 node per block.
Parameters
----------
command : str
Command string to execute on the node.
job_name : str
... | parsl/providers/aws/aws.py | def spin_up_instance(self, command, job_name):
"""Start an instance in the VPC in the first available subnet.
N instances will be started if nodes_per_block > 1.
Not supported. We only do 1 node per block.
Parameters
----------
command : str
Command string t... | def spin_up_instance(self, command, job_name):
"""Start an instance in the VPC in the first available subnet.
N instances will be started if nodes_per_block > 1.
Not supported. We only do 1 node per block.
Parameters
----------
command : str
Command string t... | [
"Start",
"an",
"instance",
"in",
"the",
"VPC",
"in",
"the",
"first",
"available",
"subnet",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/aws/aws.py#L434-L502 | [
"def",
"spin_up_instance",
"(",
"self",
",",
"command",
",",
"job_name",
")",
":",
"command",
"=",
"Template",
"(",
"template_string",
")",
".",
"substitute",
"(",
"jobname",
"=",
"job_name",
",",
"user_script",
"=",
"command",
",",
"linger",
"=",
"str",
"... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | AWSProvider.shut_down_instance | Shut down a list of instances, if provided.
If no instance is provided, the last instance started up will be shut down. | parsl/providers/aws/aws.py | def shut_down_instance(self, instances=None):
"""Shut down a list of instances, if provided.
If no instance is provided, the last instance started up will be shut down.
"""
if instances and len(self.instances) > 0:
print(instances)
try:
print([i.... | def shut_down_instance(self, instances=None):
"""Shut down a list of instances, if provided.
If no instance is provided, the last instance started up will be shut down.
"""
if instances and len(self.instances) > 0:
print(instances)
try:
print([i.... | [
"Shut",
"down",
"a",
"list",
"of",
"instances",
"if",
"provided",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/aws/aws.py#L504-L526 | [
"def",
"shut_down_instance",
"(",
"self",
",",
"instances",
"=",
"None",
")",
":",
"if",
"instances",
"and",
"len",
"(",
"self",
".",
"instances",
")",
">",
"0",
":",
"print",
"(",
"instances",
")",
"try",
":",
"print",
"(",
"[",
"i",
".",
"id",
"f... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | AWSProvider.get_instance_state | Get states of all instances on EC2 which were started by this file. | parsl/providers/aws/aws.py | def get_instance_state(self, instances=None):
"""Get states of all instances on EC2 which were started by this file."""
if instances:
desc = self.client.describe_instances(InstanceIds=instances)
else:
desc = self.client.describe_instances(InstanceIds=self.instances)
... | def get_instance_state(self, instances=None):
"""Get states of all instances on EC2 which were started by this file."""
if instances:
desc = self.client.describe_instances(InstanceIds=instances)
else:
desc = self.client.describe_instances(InstanceIds=self.instances)
... | [
"Get",
"states",
"of",
"all",
"instances",
"on",
"EC2",
"which",
"were",
"started",
"by",
"this",
"file",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/aws/aws.py#L528-L538 | [
"def",
"get_instance_state",
"(",
"self",
",",
"instances",
"=",
"None",
")",
":",
"if",
"instances",
":",
"desc",
"=",
"self",
".",
"client",
".",
"describe_instances",
"(",
"InstanceIds",
"=",
"instances",
")",
"else",
":",
"desc",
"=",
"self",
".",
"c... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | AWSProvider.status | Get the status of a list of jobs identified by their ids.
Parameters
----------
job_ids : list of str
Identifiers for the jobs.
Returns
-------
list of int
The status codes of the requsted jobs. | parsl/providers/aws/aws.py | def status(self, job_ids):
"""Get the status of a list of jobs identified by their ids.
Parameters
----------
job_ids : list of str
Identifiers for the jobs.
Returns
-------
list of int
The status codes of the requsted jobs.
"""
... | def status(self, job_ids):
"""Get the status of a list of jobs identified by their ids.
Parameters
----------
job_ids : list of str
Identifiers for the jobs.
Returns
-------
list of int
The status codes of the requsted jobs.
"""
... | [
"Get",
"the",
"status",
"of",
"a",
"list",
"of",
"jobs",
"identified",
"by",
"their",
"ids",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/aws/aws.py#L540-L564 | [
"def",
"status",
"(",
"self",
",",
"job_ids",
")",
":",
"all_states",
"=",
"[",
"]",
"status",
"=",
"self",
".",
"client",
".",
"describe_instances",
"(",
"InstanceIds",
"=",
"job_ids",
")",
"for",
"r",
"in",
"status",
"[",
"'Reservations'",
"]",
":",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | AWSProvider.submit | Submit the command onto a freshly instantiated AWS EC2 instance.
Submit returns an ID that corresponds to the task that was just submitted.
Parameters
----------
command : str
Command to be invoked on the remote side.
blocksize : int
Number of blocks req... | parsl/providers/aws/aws.py | def submit(self, command='sleep 1', blocksize=1, tasks_per_node=1, job_name="parsl.auto"):
"""Submit the command onto a freshly instantiated AWS EC2 instance.
Submit returns an ID that corresponds to the task that was just submitted.
Parameters
----------
command : str
... | def submit(self, command='sleep 1', blocksize=1, tasks_per_node=1, job_name="parsl.auto"):
"""Submit the command onto a freshly instantiated AWS EC2 instance.
Submit returns an ID that corresponds to the task that was just submitted.
Parameters
----------
command : str
... | [
"Submit",
"the",
"command",
"onto",
"a",
"freshly",
"instantiated",
"AWS",
"EC2",
"instance",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/aws/aws.py#L566-L608 | [
"def",
"submit",
"(",
"self",
",",
"command",
"=",
"'sleep 1'",
",",
"blocksize",
"=",
"1",
",",
"tasks_per_node",
"=",
"1",
",",
"job_name",
"=",
"\"parsl.auto\"",
")",
":",
"job_name",
"=",
"\"parsl.auto.{0}\"",
".",
"format",
"(",
"time",
".",
"time",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | AWSProvider.cancel | Cancel the jobs specified by a list of job ids.
Parameters
----------
job_ids : list of str
List of of job identifiers
Returns
-------
list of bool
Each entry in the list will contain False if the operation fails. Otherwise, the entry will be Tru... | parsl/providers/aws/aws.py | def cancel(self, job_ids):
"""Cancel the jobs specified by a list of job ids.
Parameters
----------
job_ids : list of str
List of of job identifiers
Returns
-------
list of bool
Each entry in the list will contain False if the operation f... | def cancel(self, job_ids):
"""Cancel the jobs specified by a list of job ids.
Parameters
----------
job_ids : list of str
List of of job identifiers
Returns
-------
list of bool
Each entry in the list will contain False if the operation f... | [
"Cancel",
"the",
"jobs",
"specified",
"by",
"a",
"list",
"of",
"job",
"ids",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/aws/aws.py#L610-L642 | [
"def",
"cancel",
"(",
"self",
",",
"job_ids",
")",
":",
"if",
"self",
".",
"linger",
"is",
"True",
":",
"logger",
".",
"debug",
"(",
"\"Ignoring cancel requests due to linger mode\"",
")",
"return",
"[",
"False",
"for",
"x",
"in",
"job_ids",
"]",
"try",
":... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | AWSProvider.show_summary | Print human readable summary of current AWS state to log and to console. | parsl/providers/aws/aws.py | def show_summary(self):
"""Print human readable summary of current AWS state to log and to console."""
self.get_instance_state()
status_string = "EC2 Summary:\n\tVPC IDs: {}\n\tSubnet IDs: \
{}\n\tSecurity Group ID: {}\n\tRunning Instance IDs: {}\n".format(
self.vpc_id, self.sn_ids, ... | def show_summary(self):
"""Print human readable summary of current AWS state to log and to console."""
self.get_instance_state()
status_string = "EC2 Summary:\n\tVPC IDs: {}\n\tSubnet IDs: \
{}\n\tSecurity Group ID: {}\n\tRunning Instance IDs: {}\n".format(
self.vpc_id, self.sn_ids, ... | [
"Print",
"human",
"readable",
"summary",
"of",
"current",
"AWS",
"state",
"to",
"log",
"and",
"to",
"console",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/aws/aws.py#L644-L659 | [
"def",
"show_summary",
"(",
"self",
")",
":",
"self",
".",
"get_instance_state",
"(",
")",
"status_string",
"=",
"\"EC2 Summary:\\n\\tVPC IDs: {}\\n\\tSubnet IDs: \\\n{}\\n\\tSecurity Group ID: {}\\n\\tRunning Instance IDs: {}\\n\"",
".",
"format",
"(",
"self",
".",
"vpc_id",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | AWSProvider.teardown | Teardown the EC2 infastructure.
Terminate all EC2 instances, delete all subnets, delete security group, delete VPC,
and reset all instance variables. | parsl/providers/aws/aws.py | def teardown(self):
"""Teardown the EC2 infastructure.
Terminate all EC2 instances, delete all subnets, delete security group, delete VPC,
and reset all instance variables.
"""
self.shut_down_instance(self.instances)
self.instances = []
try:
self.cli... | def teardown(self):
"""Teardown the EC2 infastructure.
Terminate all EC2 instances, delete all subnets, delete security group, delete VPC,
and reset all instance variables.
"""
self.shut_down_instance(self.instances)
self.instances = []
try:
self.cli... | [
"Teardown",
"the",
"EC2",
"infastructure",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/aws/aws.py#L661-L689 | [
"def",
"teardown",
"(",
"self",
")",
":",
"self",
".",
"shut_down_instance",
"(",
"self",
".",
"instances",
")",
"self",
".",
"instances",
"=",
"[",
"]",
"try",
":",
"self",
".",
"client",
".",
"delete_internet_gateway",
"(",
"InternetGatewayId",
"=",
"sel... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | JetstreamProvider.scale_out | Scale out the existing resources. | parsl/providers/jetstream/jetstream.py | def scale_out(self, blocks=1, block_size=1):
''' Scale out the existing resources.
'''
self.config['sites.jetstream.{0}'.format(self.pool)]['flavor']
count = 0
if blocks == 1:
block_id = len(self.blocks)
self.blocks[block_id] = []
for instance_... | def scale_out(self, blocks=1, block_size=1):
''' Scale out the existing resources.
'''
self.config['sites.jetstream.{0}'.format(self.pool)]['flavor']
count = 0
if blocks == 1:
block_id = len(self.blocks)
self.blocks[block_id] = []
for instance_... | [
"Scale",
"out",
"the",
"existing",
"resources",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/jetstream/jetstream.py#L91-L117 | [
"def",
"scale_out",
"(",
"self",
",",
"blocks",
"=",
"1",
",",
"block_size",
"=",
"1",
")",
":",
"self",
".",
"config",
"[",
"'sites.jetstream.{0}'",
".",
"format",
"(",
"self",
".",
"pool",
")",
"]",
"[",
"'flavor'",
"]",
"count",
"=",
"0",
"if",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | JetstreamProvider.scale_in | Scale in resources | parsl/providers/jetstream/jetstream.py | def scale_in(self, blocks=0, machines=0, strategy=None):
''' Scale in resources
'''
count = 0
instances = self.client.servers.list()
for instance in instances[0:machines]:
print("Deleting : ", instance)
instance.delete()
count += 1
ret... | def scale_in(self, blocks=0, machines=0, strategy=None):
''' Scale in resources
'''
count = 0
instances = self.client.servers.list()
for instance in instances[0:machines]:
print("Deleting : ", instance)
instance.delete()
count += 1
ret... | [
"Scale",
"in",
"resources"
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/jetstream/jetstream.py#L119-L129 | [
"def",
"scale_in",
"(",
"self",
",",
"blocks",
"=",
"0",
",",
"machines",
"=",
"0",
",",
"strategy",
"=",
"None",
")",
":",
"count",
"=",
"0",
"instances",
"=",
"self",
".",
"client",
".",
"servers",
".",
"list",
"(",
")",
"for",
"instance",
"in",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | execute_task | Deserialize the buffer and execute the task.
# Returns the result or exception. | parsl/executors/low_latency/lowlatency_worker.py | def execute_task(f, args, kwargs, user_ns):
"""
Deserialize the buffer and execute the task.
# Returns the result or exception.
"""
fname = getattr(f, '__name__', 'f')
prefix = "parsl_"
fname = prefix + "f"
argname = prefix + "args"
kwargname = prefix + "kwargs"
resultname = pre... | def execute_task(f, args, kwargs, user_ns):
"""
Deserialize the buffer and execute the task.
# Returns the result or exception.
"""
fname = getattr(f, '__name__', 'f')
prefix = "parsl_"
fname = prefix + "f"
argname = prefix + "args"
kwargname = prefix + "kwargs"
resultname = pre... | [
"Deserialize",
"the",
"buffer",
"and",
"execute",
"the",
"task",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/low_latency/lowlatency_worker.py#L18-L46 | [
"def",
"execute_task",
"(",
"f",
",",
"args",
",",
"kwargs",
",",
"user_ns",
")",
":",
"fname",
"=",
"getattr",
"(",
"f",
",",
"'__name__'",
",",
"'f'",
")",
"prefix",
"=",
"\"parsl_\"",
"fname",
"=",
"prefix",
"+",
"\"f\"",
"argname",
"=",
"prefix",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | start_file_logger | Add a stream log handler.
Args:
- filename (string): Name of the file to write logs to
- name (string): Logger name
- level (logging.LEVEL): Set the logging level.
- format_string (string): Set the format string
Returns:
- None | parsl/executors/low_latency/lowlatency_worker.py | def start_file_logger(filename, rank, name='parsl', level=logging.DEBUG, format_string=None):
"""Add a stream log handler.
Args:
- filename (string): Name of the file to write logs to
- name (string): Logger name
- level (logging.LEVEL): Set the logging level.
- format_string (s... | def start_file_logger(filename, rank, name='parsl', level=logging.DEBUG, format_string=None):
"""Add a stream log handler.
Args:
- filename (string): Name of the file to write logs to
- name (string): Logger name
- level (logging.LEVEL): Set the logging level.
- format_string (s... | [
"Add",
"a",
"stream",
"log",
"handler",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/low_latency/lowlatency_worker.py#L49-L77 | [
"def",
"start_file_logger",
"(",
"filename",
",",
"rank",
",",
"name",
"=",
"'parsl'",
",",
"level",
"=",
"logging",
".",
"DEBUG",
",",
"format_string",
"=",
"None",
")",
":",
"try",
":",
"os",
".",
"makedirs",
"(",
"os",
".",
"path",
".",
"dirname",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | worker | TODO: docstring
TODO : Cleanup debug, logdir and uid to function correctly | parsl/executors/low_latency/lowlatency_worker.py | def worker(worker_id, task_url, debug=True, logdir="workers", uid="1"):
""" TODO: docstring
TODO : Cleanup debug, logdir and uid to function correctly
"""
start_file_logger('{}/{}/worker_{}.log'.format(logdir, uid, worker_id),
0,
level=logging.DEBUG if debug... | def worker(worker_id, task_url, debug=True, logdir="workers", uid="1"):
""" TODO: docstring
TODO : Cleanup debug, logdir and uid to function correctly
"""
start_file_logger('{}/{}/worker_{}.log'.format(logdir, uid, worker_id),
0,
level=logging.DEBUG if debug... | [
"TODO",
":",
"docstring"
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/low_latency/lowlatency_worker.py#L80-L111 | [
"def",
"worker",
"(",
"worker_id",
",",
"task_url",
",",
"debug",
"=",
"True",
",",
"logdir",
"=",
"\"workers\"",
",",
"uid",
"=",
"\"1\"",
")",
":",
"start_file_logger",
"(",
"'{}/{}/worker_{}.log'",
".",
"format",
"(",
"logdir",
",",
"uid",
",",
"worker_... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | CondorProvider._status | Update the resource dictionary with job statuses. | parsl/providers/condor/condor.py | def _status(self):
"""Update the resource dictionary with job statuses."""
job_id_list = ' '.join(self.resources.keys())
cmd = "condor_q {0} -af:jr JobStatus".format(job_id_list)
retcode, stdout, stderr = super().execute_wait(cmd)
"""
Example output:
$ condor_q ... | def _status(self):
"""Update the resource dictionary with job statuses."""
job_id_list = ' '.join(self.resources.keys())
cmd = "condor_q {0} -af:jr JobStatus".format(job_id_list)
retcode, stdout, stderr = super().execute_wait(cmd)
"""
Example output:
$ condor_q ... | [
"Update",
"the",
"resource",
"dictionary",
"with",
"job",
"statuses",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/condor/condor.py#L108-L126 | [
"def",
"_status",
"(",
"self",
")",
":",
"job_id_list",
"=",
"' '",
".",
"join",
"(",
"self",
".",
"resources",
".",
"keys",
"(",
")",
")",
"cmd",
"=",
"\"condor_q {0} -af:jr JobStatus\"",
".",
"format",
"(",
"job_id_list",
")",
"retcode",
",",
"stdout",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | CondorProvider.submit | Submits the command onto an Local Resource Manager job of blocksize parallel elements.
example file with the complex case of multiple submits per job:
Universe =vanilla
output = out.$(Cluster).$(Process)
error = err.$(Cluster).$(Process)
log = log.$(Cluster)
... | parsl/providers/condor/condor.py | def submit(self, command, blocksize, tasks_per_node, job_name="parsl.auto"):
"""Submits the command onto an Local Resource Manager job of blocksize parallel elements.
example file with the complex case of multiple submits per job:
Universe =vanilla
output = out.$(Cluster).$(Proc... | def submit(self, command, blocksize, tasks_per_node, job_name="parsl.auto"):
"""Submits the command onto an Local Resource Manager job of blocksize parallel elements.
example file with the complex case of multiple submits per job:
Universe =vanilla
output = out.$(Cluster).$(Proc... | [
"Submits",
"the",
"command",
"onto",
"an",
"Local",
"Resource",
"Manager",
"job",
"of",
"blocksize",
"parallel",
"elements",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/condor/condor.py#L145-L248 | [
"def",
"submit",
"(",
"self",
",",
"command",
",",
"blocksize",
",",
"tasks_per_node",
",",
"job_name",
"=",
"\"parsl.auto\"",
")",
":",
"logger",
".",
"debug",
"(",
"\"Attempting to launch with blocksize: {}\"",
".",
"format",
"(",
"blocksize",
")",
")",
"if",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | IPyParallelExecutor.compose_containerized_launch_cmd | Reads the json contents from filepath and uses that to compose the engine launch command.
Notes: Add this to the ipengine launch for debug logs :
--log-to-file --debug
Args:
filepath (str): Path to the engine file
engine_dir (str): CWD for the engines .... | parsl/executors/ipp.py | def compose_containerized_launch_cmd(self, filepath, engine_dir, container_image):
"""Reads the json contents from filepath and uses that to compose the engine launch command.
Notes: Add this to the ipengine launch for debug logs :
--log-to-file --debug
Args:
... | def compose_containerized_launch_cmd(self, filepath, engine_dir, container_image):
"""Reads the json contents from filepath and uses that to compose the engine launch command.
Notes: Add this to the ipengine launch for debug logs :
--log-to-file --debug
Args:
... | [
"Reads",
"the",
"json",
"contents",
"from",
"filepath",
"and",
"uses",
"that",
"to",
"compose",
"the",
"engine",
"launch",
"command",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/ipp.py#L162-L204 | [
"def",
"compose_containerized_launch_cmd",
"(",
"self",
",",
"filepath",
",",
"engine_dir",
",",
"container_image",
")",
":",
"self",
".",
"engine_file",
"=",
"os",
".",
"path",
".",
"expanduser",
"(",
"filepath",
")",
"uid",
"=",
"str",
"(",
"uuid",
".",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | IPyParallelExecutor.scale_out | Scales out the number of active workers by 1.
This method is notImplemented for threads and will raise the error if called.
Parameters:
blocks : int
Number of blocks to be provisioned. | parsl/executors/ipp.py | def scale_out(self, blocks=1):
"""Scales out the number of active workers by 1.
This method is notImplemented for threads and will raise the error if called.
Parameters:
blocks : int
Number of blocks to be provisioned.
"""
r = []
for i in rang... | def scale_out(self, blocks=1):
"""Scales out the number of active workers by 1.
This method is notImplemented for threads and will raise the error if called.
Parameters:
blocks : int
Number of blocks to be provisioned.
"""
r = []
for i in rang... | [
"Scales",
"out",
"the",
"number",
"of",
"active",
"workers",
"by",
"1",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/ipp.py#L229-L252 | [
"def",
"scale_out",
"(",
"self",
",",
"blocks",
"=",
"1",
")",
":",
"r",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"blocks",
")",
":",
"if",
"self",
".",
"provider",
":",
"block",
"=",
"self",
".",
"provider",
".",
"submit",
"(",
"self",
"... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | IPyParallelExecutor.scale_in | Scale in the number of active blocks by the specified number. | parsl/executors/ipp.py | def scale_in(self, blocks):
"""Scale in the number of active blocks by the specified number.
"""
status = dict(zip(self.engines, self.provider.status(self.engines)))
# This works for blocks=0
to_kill = [engine for engine in status if status[engine] == "RUNNING"][:blocks]
... | def scale_in(self, blocks):
"""Scale in the number of active blocks by the specified number.
"""
status = dict(zip(self.engines, self.provider.status(self.engines)))
# This works for blocks=0
to_kill = [engine for engine in status if status[engine] == "RUNNING"][:blocks]
... | [
"Scale",
"in",
"the",
"number",
"of",
"active",
"blocks",
"by",
"the",
"specified",
"number",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/ipp.py#L254-L269 | [
"def",
"scale_in",
"(",
"self",
",",
"blocks",
")",
":",
"status",
"=",
"dict",
"(",
"zip",
"(",
"self",
".",
"engines",
",",
"self",
".",
"provider",
".",
"status",
"(",
"self",
".",
"engines",
")",
")",
")",
"# This works for blocks=0",
"to_kill",
"=... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | IPyParallelExecutor.status | Returns the status of the executor via probing the execution providers. | parsl/executors/ipp.py | def status(self):
"""Returns the status of the executor via probing the execution providers."""
if self.provider:
status = self.provider.status(self.engines)
else:
status = []
return status | def status(self):
"""Returns the status of the executor via probing the execution providers."""
if self.provider:
status = self.provider.status(self.engines)
else:
status = []
return status | [
"Returns",
"the",
"status",
"of",
"the",
"executor",
"via",
"probing",
"the",
"execution",
"providers",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/ipp.py#L271-L279 | [
"def",
"status",
"(",
"self",
")",
":",
"if",
"self",
".",
"provider",
":",
"status",
"=",
"self",
".",
"provider",
".",
"status",
"(",
"self",
".",
"engines",
")",
"else",
":",
"status",
"=",
"[",
"]",
"return",
"status"
] | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | IPyParallelExecutor.shutdown | Shutdown the executor, including all workers and controllers.
The interface documentation for IPP is `here <http://ipyparallel.readthedocs.io/en/latest/api/ipyparallel.html#ipyparallel.Client.shutdown>`_
Kwargs:
- hub (Bool): Whether the hub should be shutdown, Default:True,
- ... | parsl/executors/ipp.py | def shutdown(self, hub=True, targets='all', block=False):
"""Shutdown the executor, including all workers and controllers.
The interface documentation for IPP is `here <http://ipyparallel.readthedocs.io/en/latest/api/ipyparallel.html#ipyparallel.Client.shutdown>`_
Kwargs:
- hub (Bo... | def shutdown(self, hub=True, targets='all', block=False):
"""Shutdown the executor, including all workers and controllers.
The interface documentation for IPP is `here <http://ipyparallel.readthedocs.io/en/latest/api/ipyparallel.html#ipyparallel.Client.shutdown>`_
Kwargs:
- hub (Bo... | [
"Shutdown",
"the",
"executor",
"including",
"all",
"workers",
"and",
"controllers",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/ipp.py#L281-L306 | [
"def",
"shutdown",
"(",
"self",
",",
"hub",
"=",
"True",
",",
"targets",
"=",
"'all'",
",",
"block",
"=",
"False",
")",
":",
"if",
"self",
".",
"controller",
":",
"logger",
".",
"debug",
"(",
"\"IPP:Shutdown sequence: Attempting controller kill\"",
")",
"sel... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | AppFuture.parent_callback | Callback from a parent future to update the AppFuture.
Used internally by AppFuture, and should not be called by code using AppFuture.
Args:
- executor_fu (Future): Future returned by the executor along with callback.
This may not be the current parent future, as the parent f... | parsl/dataflow/futures.py | def parent_callback(self, executor_fu):
"""Callback from a parent future to update the AppFuture.
Used internally by AppFuture, and should not be called by code using AppFuture.
Args:
- executor_fu (Future): Future returned by the executor along with callback.
This ma... | def parent_callback(self, executor_fu):
"""Callback from a parent future to update the AppFuture.
Used internally by AppFuture, and should not be called by code using AppFuture.
Args:
- executor_fu (Future): Future returned by the executor along with callback.
This ma... | [
"Callback",
"from",
"a",
"parent",
"future",
"to",
"update",
"the",
"AppFuture",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/dataflow/futures.py#L83-L130 | [
"def",
"parent_callback",
"(",
"self",
",",
"executor_fu",
")",
":",
"with",
"self",
".",
"_update_lock",
":",
"if",
"not",
"executor_fu",
".",
"done",
"(",
")",
":",
"raise",
"ValueError",
"(",
"\"done callback called, despite future not reporting itself as done\"",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | AppFuture.update_parent | Add a callback to the parent to update the state.
This handles the case where the user has called result on the AppFuture
before the parent exists. | parsl/dataflow/futures.py | def update_parent(self, fut):
"""Add a callback to the parent to update the state.
This handles the case where the user has called result on the AppFuture
before the parent exists.
"""
self.parent = fut
try:
fut.add_done_callback(self.parent_callback)
... | def update_parent(self, fut):
"""Add a callback to the parent to update the state.
This handles the case where the user has called result on the AppFuture
before the parent exists.
"""
self.parent = fut
try:
fut.add_done_callback(self.parent_callback)
... | [
"Add",
"a",
"callback",
"to",
"the",
"parent",
"to",
"update",
"the",
"state",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/dataflow/futures.py#L144-L155 | [
"def",
"update_parent",
"(",
"self",
",",
"fut",
")",
":",
"self",
".",
"parent",
"=",
"fut",
"try",
":",
"fut",
".",
"add_done_callback",
"(",
"self",
".",
"parent_callback",
")",
"except",
"Exception",
"as",
"e",
":",
"logger",
".",
"error",
"(",
"\"... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | DataFuture.parent_callback | Callback from executor future to update the parent.
Args:
- parent_fu (Future): Future returned by the executor along with callback
Returns:
- None
Updates the super() with the result() or exception() | parsl/app/futures.py | def parent_callback(self, parent_fu):
"""Callback from executor future to update the parent.
Args:
- parent_fu (Future): Future returned by the executor along with callback
Returns:
- None
Updates the super() with the result() or exception()
"""
... | def parent_callback(self, parent_fu):
"""Callback from executor future to update the parent.
Args:
- parent_fu (Future): Future returned by the executor along with callback
Returns:
- None
Updates the super() with the result() or exception()
"""
... | [
"Callback",
"from",
"executor",
"future",
"to",
"update",
"the",
"parent",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/app/futures.py#L26-L43 | [
"def",
"parent_callback",
"(",
"self",
",",
"parent_fu",
")",
":",
"if",
"parent_fu",
".",
"done",
"(",
")",
"is",
"True",
":",
"e",
"=",
"parent_fu",
".",
"_exception",
"if",
"e",
":",
"super",
"(",
")",
".",
"set_exception",
"(",
"e",
")",
"else",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | remote_side_bash_executor | Execute the bash app type function and return the command line string.
This string is reformatted with the *args, and **kwargs
from call time. | parsl/app/bash.py | def remote_side_bash_executor(func, *args, **kwargs):
"""Execute the bash app type function and return the command line string.
This string is reformatted with the *args, and **kwargs
from call time.
"""
import os
import time
import subprocess
import logging
import parsl.app.errors ... | def remote_side_bash_executor(func, *args, **kwargs):
"""Execute the bash app type function and return the command line string.
This string is reformatted with the *args, and **kwargs
from call time.
"""
import os
import time
import subprocess
import logging
import parsl.app.errors ... | [
"Execute",
"the",
"bash",
"app",
"type",
"function",
"and",
"return",
"the",
"command",
"line",
"string",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/app/bash.py#L12-L111 | [
"def",
"remote_side_bash_executor",
"(",
"func",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"import",
"os",
"import",
"time",
"import",
"subprocess",
"import",
"logging",
"import",
"parsl",
".",
"app",
".",
"errors",
"as",
"pe",
"logging",
".",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | GoogleCloudProvider.submit | The submit method takes the command string to be executed upon
instantiation of a resource most often to start a pilot.
Args :
- command (str) : The bash command string to be executed.
- blocksize (int) : Blocksize to be requested
- tasks_per_node (int) : command ... | parsl/providers/googlecloud/googlecloud.py | def submit(self, command, blocksize, tasks_per_node, job_name="parsl.auto"):
''' The submit method takes the command string to be executed upon
instantiation of a resource most often to start a pilot.
Args :
- command (str) : The bash command string to be executed.
- b... | def submit(self, command, blocksize, tasks_per_node, job_name="parsl.auto"):
''' The submit method takes the command string to be executed upon
instantiation of a resource most often to start a pilot.
Args :
- command (str) : The bash command string to be executed.
- b... | [
"The",
"submit",
"method",
"takes",
"the",
"command",
"string",
"to",
"be",
"executed",
"upon",
"instantiation",
"of",
"a",
"resource",
"most",
"often",
"to",
"start",
"a",
"pilot",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/googlecloud/googlecloud.py#L112-L137 | [
"def",
"submit",
"(",
"self",
",",
"command",
",",
"blocksize",
",",
"tasks_per_node",
",",
"job_name",
"=",
"\"parsl.auto\"",
")",
":",
"wrapped_cmd",
"=",
"self",
".",
"launcher",
"(",
"command",
",",
"tasks_per_node",
",",
"1",
")",
"instance",
",",
"na... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | GoogleCloudProvider.status | Get the status of a list of jobs identified by the job identifiers
returned from the submit request.
Args:
- job_ids (list) : A list of job identifiers
Returns:
- A list of status from ['PENDING', 'RUNNING', 'CANCELLED', 'COMPLETED',
'FAILED', 'TIMEOUT'... | parsl/providers/googlecloud/googlecloud.py | def status(self, job_ids):
''' Get the status of a list of jobs identified by the job identifiers
returned from the submit request.
Args:
- job_ids (list) : A list of job identifiers
Returns:
- A list of status from ['PENDING', 'RUNNING', 'CANCELLED', 'COMPLET... | def status(self, job_ids):
''' Get the status of a list of jobs identified by the job identifiers
returned from the submit request.
Args:
- job_ids (list) : A list of job identifiers
Returns:
- A list of status from ['PENDING', 'RUNNING', 'CANCELLED', 'COMPLET... | [
"Get",
"the",
"status",
"of",
"a",
"list",
"of",
"jobs",
"identified",
"by",
"the",
"job",
"identifiers",
"returned",
"from",
"the",
"submit",
"request",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/googlecloud/googlecloud.py#L139-L159 | [
"def",
"status",
"(",
"self",
",",
"job_ids",
")",
":",
"statuses",
"=",
"[",
"]",
"for",
"job_id",
"in",
"job_ids",
":",
"instance",
"=",
"self",
".",
"client",
".",
"instances",
"(",
")",
".",
"get",
"(",
"instance",
"=",
"job_id",
",",
"project",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | GoogleCloudProvider.cancel | Cancels the resources identified by the job_ids provided by the user.
Args:
- job_ids (list): A list of job identifiers
Returns:
- A list of status from cancelling the job which can be True, False
Raises:
- ExecutionProviderException or its subclasses | parsl/providers/googlecloud/googlecloud.py | def cancel(self, job_ids):
''' Cancels the resources identified by the job_ids provided by the user.
Args:
- job_ids (list): A list of job identifiers
Returns:
- A list of status from cancelling the job which can be True, False
Raises:
- Executio... | def cancel(self, job_ids):
''' Cancels the resources identified by the job_ids provided by the user.
Args:
- job_ids (list): A list of job identifiers
Returns:
- A list of status from cancelling the job which can be True, False
Raises:
- Executio... | [
"Cancels",
"the",
"resources",
"identified",
"by",
"the",
"job_ids",
"provided",
"by",
"the",
"user",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/providers/googlecloud/googlecloud.py#L161-L181 | [
"def",
"cancel",
"(",
"self",
",",
"job_ids",
")",
":",
"statuses",
"=",
"[",
"]",
"for",
"job_id",
"in",
"job_ids",
":",
"try",
":",
"self",
".",
"delete_instance",
"(",
"job_id",
")",
"statuses",
".",
"append",
"(",
"True",
")",
"self",
".",
"provi... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | runner | This is a function that mocks the Swift-T side.
It listens on the the incoming_q for tasks and posts returns on the outgoing_q.
Args:
- incoming_q (Queue object) : The queue to listen on
- outgoing_q (Queue object) : Queue to post results on
The messages posted on the incoming_q will be... | parsl/executors/swift_t.py | def runner(incoming_q, outgoing_q):
"""This is a function that mocks the Swift-T side.
It listens on the the incoming_q for tasks and posts returns on the outgoing_q.
Args:
- incoming_q (Queue object) : The queue to listen on
- outgoing_q (Queue object) : Queue to post results on
Th... | def runner(incoming_q, outgoing_q):
"""This is a function that mocks the Swift-T side.
It listens on the the incoming_q for tasks and posts returns on the outgoing_q.
Args:
- incoming_q (Queue object) : The queue to listen on
- outgoing_q (Queue object) : Queue to post results on
Th... | [
"This",
"is",
"a",
"function",
"that",
"mocks",
"the",
"Swift",
"-",
"T",
"side",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/swift_t.py#L27-L147 | [
"def",
"runner",
"(",
"incoming_q",
",",
"outgoing_q",
")",
":",
"logger",
".",
"debug",
"(",
"\"[RUNNER] Starting\"",
")",
"def",
"execute_task",
"(",
"bufs",
")",
":",
"\"\"\"Deserialize the buffer and execute the task.\n\n Returns the serialized result or exception.... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | TurbineExecutor._queue_management_worker | Listen to the queue for task status messages and handle them.
Depending on the message, tasks will be updated with results, exceptions,
or updates. It expects the following messages:
.. code:: python
{
"task_id" : <task_id>
"result" : serialized resu... | parsl/executors/swift_t.py | def _queue_management_worker(self):
"""Listen to the queue for task status messages and handle them.
Depending on the message, tasks will be updated with results, exceptions,
or updates. It expects the following messages:
.. code:: python
{
"task_id" : <task... | def _queue_management_worker(self):
"""Listen to the queue for task status messages and handle them.
Depending on the message, tasks will be updated with results, exceptions,
or updates. It expects the following messages:
.. code:: python
{
"task_id" : <task... | [
"Listen",
"to",
"the",
"queue",
"for",
"task",
"status",
"messages",
"and",
"handle",
"them",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/swift_t.py#L205-L272 | [
"def",
"_queue_management_worker",
"(",
"self",
")",
":",
"while",
"True",
":",
"logger",
".",
"debug",
"(",
"\"[MTHREAD] Management thread active\"",
")",
"try",
":",
"msg",
"=",
"self",
".",
"incoming_q",
".",
"get",
"(",
"block",
"=",
"True",
",",
"timeou... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | TurbineExecutor.shutdown | Shutdown method, to kill the threads and workers. | parsl/executors/swift_t.py | def shutdown(self):
"""Shutdown method, to kill the threads and workers."""
self.is_alive = False
logging.debug("Waking management thread")
self.incoming_q.put(None) # Wake up the thread
self._queue_management_thread.join() # Force join
logging.debug("Exiting thread")
... | def shutdown(self):
"""Shutdown method, to kill the threads and workers."""
self.is_alive = False
logging.debug("Waking management thread")
self.incoming_q.put(None) # Wake up the thread
self._queue_management_thread.join() # Force join
logging.debug("Exiting thread")
... | [
"Shutdown",
"method",
"to",
"kill",
"the",
"threads",
"and",
"workers",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/swift_t.py#L296-L304 | [
"def",
"shutdown",
"(",
"self",
")",
":",
"self",
".",
"is_alive",
"=",
"False",
"logging",
".",
"debug",
"(",
"\"Waking management thread\"",
")",
"self",
".",
"incoming_q",
".",
"put",
"(",
"None",
")",
"# Wake up the thread",
"self",
".",
"_queue_management... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | TurbineExecutor.submit | Submits work to the the outgoing_q.
The outgoing_q is an external process listens on this
queue for new work. This method is simply pass through and behaves like a
submit call as described here `Python docs: <https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ThreadPoo... | parsl/executors/swift_t.py | def submit(self, func, *args, **kwargs):
"""Submits work to the the outgoing_q.
The outgoing_q is an external process listens on this
queue for new work. This method is simply pass through and behaves like a
submit call as described here `Python docs: <https://docs.python.org/3/library/... | def submit(self, func, *args, **kwargs):
"""Submits work to the the outgoing_q.
The outgoing_q is an external process listens on this
queue for new work. This method is simply pass through and behaves like a
submit call as described here `Python docs: <https://docs.python.org/3/library/... | [
"Submits",
"work",
"to",
"the",
"the",
"outgoing_q",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/swift_t.py#L306-L340 | [
"def",
"submit",
"(",
"self",
",",
"func",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"task_id",
"=",
"uuid",
".",
"uuid4",
"(",
")",
"logger",
".",
"debug",
"(",
"\"Pushing function {} to queue with args {}\"",
".",
"format",
"(",
"func",
",",... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | File.filepath | Return the resolved filepath on the side where it is called from.
The appropriate filepath will be returned when called from within
an app running remotely as well as regular python on the client side.
Args:
- self
Returns:
- filepath (string) | parsl/data_provider/files.py | def filepath(self):
"""Return the resolved filepath on the side where it is called from.
The appropriate filepath will be returned when called from within
an app running remotely as well as regular python on the client side.
Args:
- self
Returns:
- file... | def filepath(self):
"""Return the resolved filepath on the side where it is called from.
The appropriate filepath will be returned when called from within
an app running remotely as well as regular python on the client side.
Args:
- self
Returns:
- file... | [
"Return",
"the",
"resolved",
"filepath",
"on",
"the",
"side",
"where",
"it",
"is",
"called",
"from",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/data_provider/files.py#L61-L80 | [
"def",
"filepath",
"(",
"self",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"'local_path'",
")",
":",
"return",
"self",
".",
"local_path",
"if",
"self",
".",
"scheme",
"in",
"[",
"'ftp'",
",",
"'http'",
",",
"'https'",
",",
"'globus'",
"]",
":",
"re... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | LocalChannel.execute_wait | Synchronously execute a commandline string on the shell.
Args:
- cmd (string) : Commandline string to execute
- walltime (int) : walltime in seconds, this is not really used now.
Kwargs:
- envs (dict) : Dictionary of env variables. This will be used
to... | parsl/channels/local/local.py | def execute_wait(self, cmd, walltime=None, envs={}):
''' Synchronously execute a commandline string on the shell.
Args:
- cmd (string) : Commandline string to execute
- walltime (int) : walltime in seconds, this is not really used now.
Kwargs:
- envs (dict) ... | def execute_wait(self, cmd, walltime=None, envs={}):
''' Synchronously execute a commandline string on the shell.
Args:
- cmd (string) : Commandline string to execute
- walltime (int) : walltime in seconds, this is not really used now.
Kwargs:
- envs (dict) ... | [
"Synchronously",
"execute",
"a",
"commandline",
"string",
"on",
"the",
"shell",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/channels/local/local.py#L35-L83 | [
"def",
"execute_wait",
"(",
"self",
",",
"cmd",
",",
"walltime",
"=",
"None",
",",
"envs",
"=",
"{",
"}",
")",
":",
"retcode",
"=",
"-",
"1",
"stdout",
"=",
"None",
"stderr",
"=",
"None",
"current_env",
"=",
"copy",
".",
"deepcopy",
"(",
"self",
".... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | LocalChannel.push_file | If the source files dirpath is the same as dest_dir, a copy
is not necessary, and nothing is done. Else a copy is made.
Args:
- source (string) : Path to the source file
- dest_dir (string) : Path to the directory to which the files is to be copied
Returns:
... | parsl/channels/local/local.py | def push_file(self, source, dest_dir):
''' If the source files dirpath is the same as dest_dir, a copy
is not necessary, and nothing is done. Else a copy is made.
Args:
- source (string) : Path to the source file
- dest_dir (string) : Path to the directory to which the f... | def push_file(self, source, dest_dir):
''' If the source files dirpath is the same as dest_dir, a copy
is not necessary, and nothing is done. Else a copy is made.
Args:
- source (string) : Path to the source file
- dest_dir (string) : Path to the directory to which the f... | [
"If",
"the",
"source",
"files",
"dirpath",
"is",
"the",
"same",
"as",
"dest_dir",
"a",
"copy",
"is",
"not",
"necessary",
"and",
"nothing",
"is",
"done",
".",
"Else",
"a",
"copy",
"is",
"made",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/channels/local/local.py#L121-L147 | [
"def",
"push_file",
"(",
"self",
",",
"source",
",",
"dest_dir",
")",
":",
"local_dest",
"=",
"dest_dir",
"+",
"'/'",
"+",
"os",
".",
"path",
".",
"basename",
"(",
"source",
")",
"# Only attempt to copy if the target dir and source dir are different",
"if",
"os",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | App | The App decorator function.
Args:
- apptype (string) : Apptype can be bash|python
Kwargs:
- data_flow_kernel (DataFlowKernel): The :class:`~parsl.dataflow.dflow.DataFlowKernel` responsible for
managing this app. This can be omitted only
after calling :meth:`parsl.dataflow.d... | parsl/app/app.py | def App(apptype, data_flow_kernel=None, walltime=60, cache=False, executors='all'):
"""The App decorator function.
Args:
- apptype (string) : Apptype can be bash|python
Kwargs:
- data_flow_kernel (DataFlowKernel): The :class:`~parsl.dataflow.dflow.DataFlowKernel` responsible for
... | def App(apptype, data_flow_kernel=None, walltime=60, cache=False, executors='all'):
"""The App decorator function.
Args:
- apptype (string) : Apptype can be bash|python
Kwargs:
- data_flow_kernel (DataFlowKernel): The :class:`~parsl.dataflow.dflow.DataFlowKernel` responsible for
... | [
"The",
"App",
"decorator",
"function",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/app/app.py#L78-L116 | [
"def",
"App",
"(",
"apptype",
",",
"data_flow_kernel",
"=",
"None",
",",
"walltime",
"=",
"60",
",",
"cache",
"=",
"False",
",",
"executors",
"=",
"'all'",
")",
":",
"from",
"parsl",
".",
"app",
".",
"python",
"import",
"PythonApp",
"from",
"parsl",
".... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | python_app | Decorator function for making python apps.
Parameters
----------
function : function
Do not pass this keyword argument directly. This is needed in order to allow for omitted parenthesis,
for example, `@python_app` if using all defaults or `@python_app(walltime=120)`. If the
decorato... | parsl/app/app.py | def python_app(function=None, data_flow_kernel=None, walltime=60, cache=False, executors='all'):
"""Decorator function for making python apps.
Parameters
----------
function : function
Do not pass this keyword argument directly. This is needed in order to allow for omitted parenthesis,
... | def python_app(function=None, data_flow_kernel=None, walltime=60, cache=False, executors='all'):
"""Decorator function for making python apps.
Parameters
----------
function : function
Do not pass this keyword argument directly. This is needed in order to allow for omitted parenthesis,
... | [
"Decorator",
"function",
"for",
"making",
"python",
"apps",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/app/app.py#L119-L151 | [
"def",
"python_app",
"(",
"function",
"=",
"None",
",",
"data_flow_kernel",
"=",
"None",
",",
"walltime",
"=",
"60",
",",
"cache",
"=",
"False",
",",
"executors",
"=",
"'all'",
")",
":",
"from",
"parsl",
".",
"app",
".",
"python",
"import",
"PythonApp",
... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | bash_app | Decorator function for making bash apps.
Parameters
----------
function : function
Do not pass this keyword argument directly. This is needed in order to allow for omitted parenthesis,
for example, `@bash_app` if using all defaults or `@bash_app(walltime=120)`. If the
decorator is u... | parsl/app/app.py | def bash_app(function=None, data_flow_kernel=None, walltime=60, cache=False, executors='all'):
"""Decorator function for making bash apps.
Parameters
----------
function : function
Do not pass this keyword argument directly. This is needed in order to allow for omitted parenthesis,
for ... | def bash_app(function=None, data_flow_kernel=None, walltime=60, cache=False, executors='all'):
"""Decorator function for making bash apps.
Parameters
----------
function : function
Do not pass this keyword argument directly. This is needed in order to allow for omitted parenthesis,
for ... | [
"Decorator",
"function",
"for",
"making",
"bash",
"apps",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/app/app.py#L154-L186 | [
"def",
"bash_app",
"(",
"function",
"=",
"None",
",",
"data_flow_kernel",
"=",
"None",
",",
"walltime",
"=",
"60",
",",
"cache",
"=",
"False",
",",
"executors",
"=",
"'all'",
")",
":",
"from",
"parsl",
".",
"app",
".",
"bash",
"import",
"BashApp",
"def... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | make_rundir | When a path has not been specified, make the run directory.
Creates a rundir with the following hierarchy:
./runinfo <- Home of all run directories
|----000
|----001 <- Directories for each run
| ....
|----NNN
Kwargs:
- path (str): String path to a speci... | parsl/dataflow/rundirs.py | def make_rundir(path):
"""When a path has not been specified, make the run directory.
Creates a rundir with the following hierarchy:
./runinfo <- Home of all run directories
|----000
|----001 <- Directories for each run
| ....
|----NNN
Kwargs:
- path... | def make_rundir(path):
"""When a path has not been specified, make the run directory.
Creates a rundir with the following hierarchy:
./runinfo <- Home of all run directories
|----000
|----001 <- Directories for each run
| ....
|----NNN
Kwargs:
- path... | [
"When",
"a",
"path",
"has",
"not",
"been",
"specified",
"make",
"the",
"run",
"directory",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/dataflow/rundirs.py#L8-L42 | [
"def",
"make_rundir",
"(",
"path",
")",
":",
"try",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"path",
")",
":",
"os",
".",
"makedirs",
"(",
"path",
")",
"prev_rundirs",
"=",
"glob",
"(",
"os",
".",
"path",
".",
"join",
"(",
"path",... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | TasksOutgoing.put | TODO: docstring | parsl/executors/low_latency/zmq_pipes.py | def put(self, task_id, buffer):
""" TODO: docstring """
task_id_bytes = task_id.to_bytes(4, "little")
message = [b"", task_id_bytes] + buffer
self.zmq_socket.send_multipart(message)
logger.debug("Sent task {}".format(task_id)) | def put(self, task_id, buffer):
""" TODO: docstring """
task_id_bytes = task_id.to_bytes(4, "little")
message = [b"", task_id_bytes] + buffer
self.zmq_socket.send_multipart(message)
logger.debug("Sent task {}".format(task_id)) | [
"TODO",
":",
"docstring"
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/executors/low_latency/zmq_pipes.py#L23-L29 | [
"def",
"put",
"(",
"self",
",",
"task_id",
",",
"buffer",
")",
":",
"task_id_bytes",
"=",
"task_id",
".",
"to_bytes",
"(",
"4",
",",
"\"little\"",
")",
"message",
"=",
"[",
"b\"\"",
",",
"task_id_bytes",
"]",
"+",
"buffer",
"self",
".",
"zmq_socket",
"... | d7afb3bc37f50dcf224ae78637944172edb35dac |
valid | monitor | Internal
Monitors the Parsl task's resources by pointing psutil to the task's pid and watching it and its children. | parsl/monitoring/monitoring.py | def monitor(pid, task_id, monitoring_hub_url, run_id, sleep_dur=10):
"""Internal
Monitors the Parsl task's resources by pointing psutil to the task's pid and watching it and its children.
"""
import psutil
radio = UDPRadio(monitoring_hub_url,
source_id=task_id)
# these val... | def monitor(pid, task_id, monitoring_hub_url, run_id, sleep_dur=10):
"""Internal
Monitors the Parsl task's resources by pointing psutil to the task's pid and watching it and its children.
"""
import psutil
radio = UDPRadio(monitoring_hub_url,
source_id=task_id)
# these val... | [
"Internal",
"Monitors",
"the",
"Parsl",
"task",
"s",
"resources",
"by",
"pointing",
"psutil",
"to",
"the",
"task",
"s",
"pid",
"and",
"watching",
"it",
"and",
"its",
"children",
"."
] | Parsl/parsl | python | https://github.com/Parsl/parsl/blob/d7afb3bc37f50dcf224ae78637944172edb35dac/parsl/monitoring/monitoring.py#L389-L448 | [
"def",
"monitor",
"(",
"pid",
",",
"task_id",
",",
"monitoring_hub_url",
",",
"run_id",
",",
"sleep_dur",
"=",
"10",
")",
":",
"import",
"psutil",
"radio",
"=",
"UDPRadio",
"(",
"monitoring_hub_url",
",",
"source_id",
"=",
"task_id",
")",
"# these values are s... | d7afb3bc37f50dcf224ae78637944172edb35dac |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.