启动suite

ecflow_start.sh 脚本会自动启动 ecflow_server。 手动启动 ecFlow 后,服务器处于 halted 状态,需要 restart 服务器。 halted 状态的服务器不会调度任务。

文本方式

检查服务器的状态,输入下列 unix 命令

  1. ecflow_client --stats

stats 命令的运行结果:

  1. $ecflow_client --host=login05 --port=33083 --stats
  2. Server statistics
  3. Version Ecflow version(4.7.1) boost(1.53.0) compiler(gcc 4.8.5) protocol(TEXT_ARCHIVE) Compiled on Jan 18 2018 01:15:48
  4. Status RUNNING
  5. Host a303r6n1
  6. Port 33083
  7. Up since 2018-Jan-30 04:31:46
  8. Job sub' interval 60s
  9. ECF_HOME /g3/wangdp/ecf_home
  10. ECF_LOG /g3/wangdp/ecf_home/a303r6n1.33083.ecf.log
  11. ECF_CHECK /g3/wangdp/ecf_home/a303r6n1.33083.check
  12. Check pt interval 120s
  13. Check pt mode CHECK_ON_TIME
  14. Check pt save time alarm 20s
  15. Number of Suites 1
  16. Request's per 1,5,15,30,60 min 0.02 0.01 0.03 0.02 0.01
  17. Restart server 1
  18. Ping 7
  19. Sync 9
  20. News 20
  21. Task init 2
  22. Task complete 2
  23. Load definition 3
  24. Begin 2
  25. Node delete 2
  26. Run 1
  27. Suites 3
  28. stats cmd 8

如果 ecflow_server 处于 halted 状态,需要重新启动服务器

手动进入 halted 状态

  1. $ecflow_client --host=login05 --port=33083 --halt
  2. Are you sure you want to halt the server ? y

启动 suite - 图1

重新启动

  1. $ecflow_client --host=login05 --port=33083 --restart

一旦 ecflow_server 处于 running 状态,就可以启动 suite

  1. $ecflow_client --host=login05 --port=33083 --begin=/test

检查状态

启动 suite - 图2

Python方式

重新启动和开始调度 suite 可以通过 Client Server API 完成,修改 client.py 并重新运行。

译者注:如果之前加载过 suite,则注释掉 ci.load(...) 行。

  1. import os
  2. from pathlib import Path
  3. import ecflow
  4. home = os.path.abspath(Path(Path(__file__).parent, "../../../build/course"))
  5. try:
  6. print("Loading definition in 'test.def' into the server")
  7. ci = ecflow.Client('login05', '33083')
  8. ci.load(str(Path(home, "test.def"))) # read definition from disk and load into the server
  9. print("Restarting the server. This starts job scheduling")
  10. ci.restart_server()
  11. print("Begin the suite named 'test'")
  12. ci.begin_suite("test")
  13. except RuntimeError as e:
  14. print("Failed:", e)

在运行上述代码前,需要先手动删除之前加载的 test:

  1. $ecflow_client --host=login05 --port=33083 --delete=/test
  2. Are you sure want to delete nodes at paths:
  3. /test ? y
  4. $python test_client.py
  5. Loading definition in 'test.def' into the server
  6. Restarting the server. This starts job scheduling
  7. Begin the suite named 'test'

任务

  1. 重新启动 ecflow_server
  2. 开始调度 suite