天æ°äºå ±ã§ã使ãããï¼ ã¯ã¼ã¯ããã¼ã¨ã³ã¸ã³ecflowã®ããã
äºæ¥éçºé¨æå±ã¨ã³ã¸ãã¢ã®ç±éã§ãã
ãã©ã«ã·ã¢ã§ã¯ãã¼ã¿ã®åãè¾¼ã¿ã»DBã®æ§ç¯ã¨ãã£ããããå¦çã«ã¤ãã¦ãã©ã«ã·ã¢ç¬èªã®ãã¼ã«ãéçºãã管çã»å®è¡ãã¦ãã¾ããããã®ç¬èªãã¼ã«ã¯ãããããã決ããããããã¼ããè¨å®ãå¤ãã¦å®è¡ãããããªä½ãã«ãªã£ã¦ãããã¿ã¹ã¯å®è¡é ã®çµã¿æããã¢ããªç¬èªã®å¦çã追å ããã«ã¯ãã¼ã«èªä½ãã¢ããªãã¨ã«ã«ã¹ã¿ãã¤ãºããå¿ è¦ãããã¾ããã
ãã®ã¢ããªãã¨ã®ã«ã¹ã¿ãã¤ãºãããç°¡åã«è¡ãããããæè¿ãã©ã«ã·ã¢ã§ã¯ãecflowãã¨ããã¯ã¼ã¯ããã¼ã¨ã³ã¸ã³ãå°å ¥ãå§ãã¾ãããæ¬è¨äºã§ã¯ç°¡åãªã¯ã¼ã¯ããã¼ãä½ããªãããecflowã«ã¤ãã¦ç´¹ä»ãããã¨æãã¾ãã
ecflowã¨ã¯ï¼
ecflowã¯æ¬§å·ä¸æäºå ±ã»ã³ã¿ã¼(ECMWF)ãéçºããã¯ã¼ã¯ããã¼ã¨ã³ã¸ã³ã§ããã天æ°äºå ±ã®ããã®ããã°ã©ã å®è¡ãæ
ã£ã¦ãã¾ãããã¡ãã®è¨äºã§ãç´¹ä»ãã¦ãã¾ãããè¤éãªä¾åé¢ä¿ãæã£ã大éã®ã¿ã¹ã¯ãå¦çã§ããã ãã§ãªããã¿ã¹ã¯éã®å¾
ã¡æéãçããã¨ãç¹å¾´ã§ãã
ãã©ã«ã·ã¢ã¯ããã³ãã§ã®æ¤ç´¢é度ã ãã§ãªããããã®éãã«ãéããç½®ãã¦ããããããã®ãªã¼ãã¼ããããç縮ããããã¨ã¯å¤§ããªã¡ãªããã§ããã
ecflowã§ã¯ç¬èªå½¢å¼ã®ãã¡ã¤ã«ãçµã¿åããããã¨ã§ãä¸ã¤ã®ã¯ã¼ã¯ããã¼ãæ§ç¯ãã¦ããã¾ããã©ã®ãããªãã¡ã¤ã«ãç¨æããå¿
è¦ãããã®ããå
·ä½çã«ç´¹ä»ãã¦ããããã¨æãã¾ãã
â»ecflowã®ã¤ã³ã¹ãã¼ã«ã¯æ¬å®¶ã®ããã¥ã¡ã³ããåèã«ãã¦ãã ããã
ã¿ã¹ã¯ã®å®ç¾©
ä»åã¯åç´ã«ãHello!!ãã¨åºåããã ãã®ã¯ã¼ã¯ããã¼ãä½ã£ã¦ã¿ã¾ãã
ãã¡ã¤ã«æ§æã¯ä»¥ä¸ã®ããã«ãªãã¾ãã
âââ ecf_files â âââ echo.ecf âââ ecf_include â âââ head.h â âââ tail.h âââ test.py
.ecfãã¡ã¤ã«
ecflowã§å®è¡ãããå¦çã¯.ecfãã¡ã¤ã«ã«è¨è¼ãã¾ãã
ä¾ãã°ãä»åä½æããecho.ecf
ã¯ä»¥ä¸ã®ããã«ãªã£ã¦ãããä»»æã®åèªãåºåã§ããããã«ãªã£ã¦ãã¾ãã
%include <head.h> echo "%WORD%" %include <tail.h>
å¤æ°ã®åãè¾¼ã¿
.ecfãã¡ã¤ã«ã§ã¯å¤æ°åã%
ã§å²ããã¨ã§ä»»æã®æååãåãè¾¼ããã¨ãã§ãã¾ããä¾ã«æããecho.ecf
ã§ã¯%WORD%
é¨åã«ä»»æã®æååãåãè¾¼ããã¨ã§ãåºåããæååãè¨å®ã§ããããã«ãªã£ã¦ãã¾ãã
include
%include <{{ file_name }}>
ã¨è¨è¼ãããã¨ã§ãä»»æã®å¦çãå.ecfãã¡ã¤ã«ã«è¿½å ãããã¨ãã§ãã¾ããåã¿ã¹ã¯ã§å
±éã«å®è¡ãããã¹ãå¦çã¯å¥ã®ãã¡ã¤ã«ã«åãåºããã¨ãã§ããã®ã§ãã
ä»åã¯ecflowã«å¯¾ãã¦ãå®è¡éå§/çµäºãç¥ãããå¦çãhead.h
ã¨tail.h
ã«åãåºãã¦ãã¾ãã
ãhead.hã
#!/bin/bash set -eux set -o pipefail # ecflowã¨ã®ããåãã«å¿ è¦ãªå¤æ° export ECF_PORT=%ECF_PORT% export ECF_HOST=%ECF_HOST% export ECF_NAME=%ECF_NAME% export ECF_PASS=%ECF_PASS% export ECF_TRYNO=%ECF_TRYNO% export ECF_RID=$$ export PATH=/usr/local/ecflow-%ECF_VERSION%/bin:$PATH # ecflowã«ã¿ã¹ã¯éå§ãç¥ãããã ecflow_client --init=$$ # ã¿ã¹ã¯ä¸ã§ã¨ã©ã¼ãçºçããå ´åã«å®è¡ããã ERROR() { set +e wait ecflow_client --abort=trap trap 0 exit 0 } trap ERROR 0 trap '{ echo "Killed by a signal"; ERROR ; }' 1 2 3 4 5 6 7 8 10 12 13 15
ãtail.hã
wait # ecflowã«ã¿ã¹ã¯çµäºãç¥ãããã ecflow_client --complete trap 0 exit 0
ã¯ã¼ã¯ããã¼ã®æ§ç¯
ç¨æãã.ecfãã¡ã¤ã«ãçµã¿åããã¦ãä¸ã¤ã®ã¯ã¼ã¯ããã¼ãæ§æããå¿ è¦ãããã¾ãããã®ããã«ã¯ãããããã®.ecfãã¡ã¤ã«ãã©ã®ãããªé çªã§å®è¡ãããããè¨è¼ãããã¡ã¤ã«ãç¨æããecflowã«èªã¿è¾¼ã¾ããå¿ è¦ãããã¾ãã
ããããããã¼ãè¤éã«ãªã£ã¦ããã¨ããã®è¨å®ã0ããç¨æããã®ãããªãé£ãããªã£ã¦ãã¾ããããã§ecflowãç¨æãã¦ããPythonã©ã¤ãã©ãªãå©ç¨ãã¾ãã
ãtest.pyã
import os from ecflow import Defs, Suite, Family, Task, Edit THIS_DIR = os.path.dirname(os.path.abspath(__file__)) ECF_DIR = os.path.join(THIS_DIR, "ecf_files") INCLUDE_DIR = os.path.join(THIS_DIR, "ecf_include") print("Creating suite definition") # Suite: ä¸ã¤ã®ã¯ã¼ã¯ããã¼ã示ã suite = Suite( "test", Edit( ECF_HOME=THIS_DIR, ECF_FILES=ECF_DIR, # ecfãã¡ã¤ã«ãç½®ãããã£ã¬ã¯ã㪠ECF_INCLUDE=INCLUDE_DIR #includeãããã¡ã¤ã«ãç½®ãããã£ã¬ã¯ã㪠) ) # Family: è¤æ°ã®ã¿ã¹ã¯ãFamilyãã¾ã¨ãããã® # ä»»æã®ååãä»ãã(ä»åã¯"hello") hello = Family("hello") # Task: ecfãã¡ã¤ã«ãèªã¿è¾¼ã¿å¦çãå®è¡ãã hello.add_task( Task( "echo", # ecfãã¡ã¤ã«ãæå® Edit( WORD="Hello!!" # %WORD%ã«åãè¾¼ãæåå ) ) ) suite.add_family(hello) defs = Defs() defs.add_suite(suite) print("Checking job creation: .ecf -> .job0") print(defs.check_job_creation()) print("Saving definition to file 'test.def'") defs.save_as_defs("test.def")
ä¸è¨ãå®è¡ããã¨ä»¥ä¸ã®ããã«æ°ãããã¡ã¤ã«ãçæããã¾ãã
âââ ecf_files â âââ echo.ecf âââ ecf_include â âââ head.h â âââ tail.h âââ test â âââ hello â âââ echo.job0 â NEW âââ test.def â NEW âââ test.py
.defãã¡ã¤ã«
æ°ããçæãããtest.def
ããå
ã«ç´¹ä»ãããããããã®.ecfãã¡ã¤ã«ãã©ã®ãããªé çªã§å®è¡ãããããè¨å®ãããã¡ã¤ã«ã«ãªãã¾ãããã®ãã¡ã¤ã«ãecflowãèªã¿è¾¼ããã¨ã§ã¯ã¼ã¯ããã¼ãæ§ç¯ããã¾ãã
#5.1.0 suite test edit ECF_HOME '/home/forcia/ecflow_test' edit ECF_FILES '/home/forcia/ecflow_test/ecf_files' edit ECF_INCLUDE '/home/forcia/ecflow_test/ecf_include' family hello task echo edit WORD 'Hello!!' endfamily endsuite # enddef
.jobãã¡ã¤ã«
ã§ã¯ãecho.job0
ã¨ã¯ä½ãªã®ã§ããããï¼ãã¡ã¤ã«ã®ä¸èº«ã¯ä»¥ä¸ã®ããã«ãªã£ã¦ãã¾ãã
#!/bin/bash set -eux set -o pipefail # ecflowã¨ã®ããåãã«å¿ è¦ãªå¤æ° export ECF_PORT=3141 export ECF_HOST=localhost export ECF_NAME=/test/hello/echo export ECF_PASS=XXXXXX export ECF_TRYNO=0 export ECF_RID=$$ export PATH=/usr/local/ecflow-5.1.0/bin:$PATH # ecflowã«ã¿ã¹ã¯éå§ãç¥ãããã ecflow_client --init=$$ # ã¿ã¹ã¯ä¸ã§ã¨ã©ã¼ãçºçããå ´åã«å®è¡ããã ERROR() { set +e wait ecflow_client --abort=trap trap 0 exit 0 } trap ERROR 0 trap '{ echo "Killed by a signal"; ERROR ; }' 1 2 3 4 5 6 7 8 10 12 13 15 echo "Hello!!" wait # ecflowã«ã¿ã¹ã¯çµäºãç¥ãããã ecflow_client --complete trap 0 exit 0
ãã¡ããè¦ã¦ãããããã«ãecho.ecf
ã§ã¯%include
ã%WORD%
ã§è¨è¼ããã¦ããé¨åãå±éããã¦é常ã®bashãã¡ã¤ã«ãçæããã¦ãã¾ãã
ecflowã§ã¯åå¤æ°ãå±éãã¦çæããããã¡ã¤ã«ããdefãã¡ã¤ã«ã§æå®ããé çªã§å®è¡ãããã¨ã§ã¯ã¼ã¯ããã¼ãå®è¡ãã¦ããã®ã§ãã
ã¯ã¼ã¯ããã¼ã®å®è¡
çæãããdefãã¡ã¤ã«ãecflowã«èªã¿è¾¼ã¾ãã¦å®è¡ãã¦ã¿ã¾ãã
$ ecflow_client --load=test.def # è¨å®ã®èªã¿è¾¼ã¿ $ ecflow_client --begin=test
ä»åã®å®è¡ãã°ã¯./test/hello/echo.1
ã«åºåããã¾ãã
ãã®ãã¡ã¤ã«ã確èªããã¨Hello!!
ã¨åºåããã¦ãããç¡äºã¿ã¹ã¯ãå®è¡ããããã¨ããããã¾ãã
...ç¥... + echo 'Hello!!' Hello!! ...ç¥...
æå¾ã«
ä»åç´¹ä»ããããã«ãecflowã§ã¯ã¯ã¼ã¯ããã¼å
ã®ã¿ã¹ã¯ãä¸ã¤ã®å®è¡ãã¡ã¤ã«ã¨ãã¦çæããã¾ãããã®ãããjobãã¡ã¤ã«ãè¦ãã°ã¿ã¹ã¯å®è¡æã«ä½ãèµ·ãã¦ããã®ããä¸çºã§ãããããããã°çããããããã§ãã
ã¾ããã¹ã¯ãªããã«è½ã¨ãè¾¼ããå¦çã¯ä½ã§ãå®è¡ã§ããã®ã§ãã¿ã¹ã¯çæã®èªç±åº¦ãé«ãã®ã§ã¯ãªããã¨æãã¦ãã¾ãã
ä»åã®å 容以å¤ã«ãGUIã«ããã¯ã¼ã¯ããã¼ã®ç®¡çãããªã¬ã¼è¨å®ãã¿ã¹ã¯å¤±ææã®å¾å¦ç・・・ãªã©ãecflowã§ã§ãããã¨ã¯ããããããã¾ãããããã«ã¤ãã¦ããä»å¾æ©ä¼ãããã°ç´¹ä»ãããã¨æãã¾ãã
ç±é æ
2018å¹´æ°åå
¥ç¤¾ãäºæ¥éçºé¨æå±ã¨ã³ã¸ãã¢ã
ecflowãdeployä½æ¥ã®èªååã«é©ç¨ä¸ã