2010年5月27日 星期四

Job description language

JDL (Job Description Language )
JDL 描述我們將要執行一個 Job 的開發環境, 包括定義這
1. 工作的輸入, 輸出檔. (Input/OutputSandbox)
2. 工作執行檔名. (Executable)
3. 工作的需要的 CE 屬性

而 JDL 在 UI 上 剖析後, JDL 會送到 WMS 作 ??


Note:
1. attribute = expression;
. 注意分號後不行有空格及 Tab key
2. 註解有 # 和 double slash (//), 和 /* */


指令介紹:
1. 傳送 Job 指令: glite-wms-job-submit -a -o joblist XXX.jdl
2. 觀察 Job 狀態指令: glite-wms-job-status -i joblist
3. 取得 Job 回傳檔案 :glite-wms-job-output -i joblist --dir argument
. 此處 dir 表示會建立一個 argument 資料夾並將 output 放置此處
. Output 只會被取一次, 再取一次顯示 clear
. 執行過程中, 預設的 output 會儲存於 Work node 上


Example:
1. Define a simple job
{{{
Executable = "/bin/hostname";
StdOutput = "std.out";
StdError = "std.err";
}}}

Executable 說明要執行的命令是一個執行檔.
StdOutput 是指定要輸出的檔名.
StdError 是輸出錯誤的檔名.

---------------------------------------------------------------------
2. 加入 InputSandBox 及 OutputSandBox
{{{
Executable = "hostname";
StdOutput = "std.out";
StdError = "std.err";
InputSandbox = {"/bin/hostname"};
OutputSandbox = {"std.out", "std.err"};
}}}

InputSandbox 為要夾帶到 CE 執行的檔案, 包括執行檔, 執行需要的輸入檔.
OutputSandbox 為回傳的檔案, 可以是執行後的結果, 此處包括 std.out, std.err 為 CE 上處理的錯
誤輸出. 注意的是要用字串表示輸出.

------------------------------------------------------------------
3. 傳送一個自己寫的執行 Shell 到 CE 上執行
a. 先作能在本機執行的 shell 為 test.sh , 會印出兩個 Input 檔的內容
假設
bash test.sh fileA fileB
{{{
#!/bin/sh
echo "First file:";
cat $1;
echo "Second file:";
cat $2;
}}}

fileA
{{{
fileA is hi
}}}

fileB
{{{
fileB is hello
}}}

[ui01] /home/dhc00/PracticeGlite/test100527/2 > bash test.sh fileA fileB
First file:
fileA is hi
Second file:
fileB is hello

b. 編寫一個 test.jdl, 其實將本機的 test.sh 和要執行的檔案描述成 JDL 格式
{{{
Executable = "test.sh";
Arguments = "fileA fileB";
StdOutput = "std.out";
StdError = "std.err";
InputSandbox = {"test.sh", "fileA", "fileB"};
OutputSandbox = {"std.out", "std.err"};
}}}

---------------------------------------------------------------------
4. 說明 Job 需要的執行環境說明 Requirements

範例:送一個 Job 到 w-ce04, 使用 requirements 條件敘述

hostnameForRequirement.jdl
{{{
Executable = "hostname";
InputSandbox = {"/bin/hostname"};
StdOutput = "std.out";
StdError = "std.err";
OutputSandbox = {"std.out", "std.err"};

Requirements =
other.GlueCeUniqueID == "w-ce04.grid.sinica.edu.tw:8443/cream-pbs-euasia";

}}}

說明 Requirements:
1. 可以使用且 (&&) 與或 (||) 連結不同條件, 且最後是分號.
2. 每個條件會是 GLUE schme 的一個資訊.
3. 條件的比較子為 >, >=, ==, <, <=
4. 還有兩種比較句為不同字串處理:
I. Member : 找出哪個 CE 有什麼 GLUE 條件
軟體: Member("MPI-CH", other.GlueHostApplicationSotwareRunTimeEnvironment);
II. 使用 Reqular expression
* RegExp(Search pattern, CLUESchme);
* 如: 找出為 cern.ch 的 CE, RegExp("cern.ch", other.GlueCEUniqueID);

沒有留言:

張貼留言