Example #1
0
import argparse
import logging

import zmq
from multiprocessing import Process

from parsl.serialize import ParslSerializer
parsl_serializer = ParslSerializer()
unpack_apply_message = parsl_serializer.unpack_apply_message
serialize_object = parsl_serializer.serialize

logger = logging.getLogger(__name__)
logger.setLevel("DEBUG")

from constants import CLIENT_IP_FILE, INTERCHANGE_IP_FILE
from utils import ping_time


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 = prefix + "result"
Example #2
0
import zmq
import os
import sys
import platform
import random
import time
import datetime
import pickle
import logging
import queue
import threading
import json

from parsl.version import VERSION as PARSL_VERSION
from parsl.serialize import ParslSerializer
serialize_object = ParslSerializer().serialize

from parsl.app.errors import RemoteExceptionWrapper
from parsl.monitoring.message_type import MessageType

HEARTBEAT_CODE = (2**32) - 1
PKL_HEARTBEAT_CODE = pickle.dumps((2**32) - 1)


class ShutdownRequest(Exception):
    ''' Exception raised when any async component receives a ShutdownRequest
    '''
    def __init__(self):
        self.tstamp = time.time()

    def __repr__(self):