[go: up one dir, main page]

File: min_client

package info (click to toggle)
cctools 9.9-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 44,624 kB
  • sloc: ansic: 192,539; python: 20,827; cpp: 20,199; sh: 11,719; perl: 4,106; xml: 3,688; makefile: 1,224
file content (34 lines) | stat: -rwxr-xr-x 923 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python

# Copyright (C) 2020- The University of Notre Dame
# This software is distributed under the GNU General Public License.
# See the file COPYING for details.

# This is a simple dataswarm test program intended to test the
# basic functionality and work out the detailed user's API.
# The objective is to process a single large dictionary file
# by running N tasks, where each task performs a grep to search
# for words beginning with a different letter.

# Note that this example is not yet correct or complete --
# it needs to evolve along with the emerging DataSwarm API.

import os
import sys
import json
import time

from dataswarm import DataSwarm

def main():
    task = {
        "command": "exit 123"
    }

    with DataSwarm(host='127.0.0.1', port='1234') as ds:
        response = ds.task_submit(task)
        print(response)
        print(ds.wait(0))

if __name__ == "__main__":
    main()