<commit_before>from parsl import *
import parsl
import libsubmit
#libsubmit.set_stream_logger()
#parsl.set_stream_logger()

config = {
    "sites" : [
        { "site" : "OSG_Remote",
          "auth" : {
              "channel" : "ssh",
              "hostname" : "login.osgconnect.net",
              "username" : "yadunand",
              "scriptDir" : "/home/yadunand/parsl_scripts/"
              #"scriptDir" : "/tmp/parsl_scripts/"
          },
          "execution" : {
              "executor" : "ipp",
              "provider" : "condor",  # LIKELY SHOULD BE BOUND TO SITE
              "scriptDir" : ".scripts",
              "block" : { # Definition of a block
                  "nodes" : 1,            # of nodes in that block
                  "taskBlocks" : 1,       # total tasks in a block
                  "walltime" : "00:05:00",
                  "initBlocks" : 1,
                  "minBlocks" : 0,
                  "maxBlocks" : 1,
                  "scriptDir" : ".",
                  "options" : {
                      "partition" : "debug",
                      "overrides" : "",
                      "workerSetup" : """module load python/3.5.2;
python3 -m venv parsl_env;
source parsl_env/bin/activate;
pip3 install ipyparallel """
                  }
              }
          }
        }
    ],
    "globals" : {"lazyErrors" : True },
    "controller" : { "publicIp" : "172.16.58.3" }
}

dfk = DataFlowKernel(config=config)

@App("python", dfk)
def test():
    import platform
    return "Hello from {0}".format(platform.uname())


if __name__ == "__main__" :

    results = {}
    for i in range(0,5):
        results[i] = test()

    print("Waiting ....")
    print(results[0].result())
<commit_msg>Minor updates to OSG test script<commit_after>from parsl import *
import parsl
import libsubmit
#libsubmit.set_stream_logger()
#parsl.set_stream_logger()

config = {
    "sites" : [
        { "site" : "OSG_Remote",
          "auth" : {
              "channel" : "ssh",
              "hostname" : "login.osgconnect.net",
              "username" : "yadunand",
              "scriptDir" : "/home/yadunand/parsl_scripts/"
              #"scriptDir" : "/tmp/parsl_scripts/"
          },
          "execution" : {
              "executor" : "ipp",
              "provider" : "condor",  # LIKELY SHOULD BE BOUND TO SITE
              "scriptDir" : ".scripts",
              "block" : { # Definition of a block
                  "nodes" : 1,            # of nodes in that block
                  "taskBlocks" : 1,       # total tasks in a block
                  "walltime" : "00:05:00",
                  "initBlocks" : 4,
                  "minBlocks" : 0,
                  "maxBlocks" : 1,
                  "scriptDir" : ".",
                  "options" : {
                      "partition" : "debug",
                      "overrides" : "requirements = (HAS_CVMFS_oasis_opensciencegrid_org =?= TRUE)",
                      "workerSetup" : """module load python/3.5.2;
python3 -m venv parsl_env;
source parsl_env/bin/activate;
pip3 install ipyparallel"""
                  }
              }
          }
        }
    ],
    "globals" : {"lazyErrors" : True },
    "controller" : { "publicIp" : "*" }
}

dfk = DataFlowKernel(config=config)

@App("python", dfk)
def test(duration=0):
    import platform
    import time
    time.sleep(duration)
    return "Hello from {0}".format(platform.uname())


if __name__ == "__main__" :

    results = {}
    print("Launching tasks...")
    for i in range(0,10):
        results[i] = test(20)

    print("Waiting ....")

    for key in results:
        print(results[key].result())


{'fraction_non_alphanumeric': 0.14273995077932733, 'fraction_numerical': 0.01394585726004922, 'mean_word_length': 1.542043085476025, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7055716', 'n_tokens_mistral': 1177, 'n_tokens_neox': 1112, 'n_words': 240}