Horizontal Navigation Bar |
---|
Button Group |
---|
Button Hyperlink |
---|
title | Previous |
---|
type | standard |
---|
url | https://confluence.ecmwf.int/display/ECFLOW/Checking+the+job |
---|
|
Button Hyperlink |
---|
title | Up |
---|
type | standard |
---|
url | https://confluence.ecmwf.int/display/ECFLOW/Tutorial |
---|
|
Button Hyperlink |
---|
title | Next |
---|
type | standard |
---|
url | https://confluence.ecmwf.int/display/ECFLOW/Load+the+file |
---|
|
|
|
All communication with the ecflow_server is done with ecflow_client
For any communication with the server, the client needs to know the machine
where the server is running and the port on the server. There can be multiple
servers running on the same machine, each with unique port numbers.
This tutorial will show examples of using the client via the shell and in a Python script.
Client Shell Interface
¶For a full list of available commands type:
The
ecflow_client uses the following method of determining the
host and
port:Client Python Interface
¶The python interface uses the same algorithm for determining the host and port,
and allows the host and port to be set explicitly. See class
ecflow.ClientThis is shown by the following python example:
#!/usr/bin/env python2.7
Code Block |
---|
language | py |
---|
title | How to ping ecflow server in python |
---|
|
import ecflow |
try:
# When no arguments specified uses ECF_ |
NODEHOST and/or ECF_PORT,
# otherwise defaults to localhost:3141
ci = ecflow.Client() # inherit from shell variables
ci.ping()
# Explicitly set host and port using the same client
# For alternative argument list see ecflow.Client.set_host_port()
ci.set_host_port("machineX:4141") # actually set the host and port (change to your host and port)
ci.ping()
# Create a new client, Explicitly setting host and port.
# For alternative argument list see ecflow.Client
ci = ecflow.Client("oetzi:3444") # another server
ci.ping()
# Ping inlined
ecflow.Client("polonius:4266").ping()
except RuntimeError |
, +;
What to do
:If your
ecflow_server was started with
ecfecflow_start.sh and you want to use the shell
interface, then set ECF_NODE HOST and ECF_PORT environment variables.
It should be noted that, if the server was started with ecf ecflow_start.sh script
e.
g. in KSH
Code Block |
---|
export ECF_HOST=<HOST> # as given when setting up ecflow server
export ECF_PORT=<PORT> # as given when setting up ecflow server |
netstat can be used to determine the port number If the server was started on your local machine, use netstat to determine the port number.
Horizontal Navigation Bar |
---|
Button Group |
---|
Button Hyperlink |
---|
title | Previous |
---|
type | standard |
---|
url | https://confluence.ecmwf.int/display/ECFLOW/Checking+the+job |
---|
|
Button Hyperlink |
---|
title | Up |
---|
type | standard |
---|
url | https://confluence.ecmwf.int/display/ECFLOW/Tutorial |
---|
|
Button Hyperlink |
---|
title | Next |
---|
type | standard |
---|
url | https://confluence.ecmwf.int/display/ECFLOW/Load+the+file |
---|
|
|
|
...