There can be occasions when we want to add variables dynamically i.e In this example we want to configure the ECF_LOGHOST to the machine where the job is running. ECF_LOGHOST is used by the log server, to view the running output in the GUI.
Code Block |
---|
language | bash |
---|
title | example.ecf |
---|
|
%include <head.h>
ecflow_client --alter add variable ECG_LOGHOST %HOST% %ECF_NAME%
ecflow_client --alter add variable ECG_LOGPORT 9316 %ECF_NAME%
....
....
ecflow_client --alter delete variable ECG_LOGHOST %ECF_NAME%
ecflow_client --alter delete variable ECG_LOGPORT %ECF_NAME%
%include <tail.h> |
All this works, it does add a lot of overhead.
In ecflow 5, we can now add/remove variable with the standard child commands init and complete
Code Block |
---|
|
......
ecflow_client --init=$$ --add "ECF_LOGHOST=%HOST%" "ECF_LOGPORT=9316" |
Code Block |
---|
|
....
ecflow_client --complete --remove ECF_LOGHOST ECF_LOGPORT |