【发布时间】:2020-08-18 05:19:37
【问题描述】:
我想要两件事:
- python 中的作业号
- 输入输出文件。
我的提交脚本如下所示:
####################
#
# Simple HTCondor submit description file
#
####################
Executable = test_condor.py
Log = condor_job_log.out
Output = condor_job_stdout.out
Error = condor_job_stdout.out
# Use this to make sure 1 gpu is available. The key words are case insensitive.
REquest_gpus = 1
# Note: to use multiple CPUs instead of the default (one CPU), use request_cpus as well
Request_cpus = 4
# E-mail option
Notify_user = me@gmail.com
# "Queue" means add the setup until this line to the queue (needs to be at the end of script).
Queue
我希望输出文件的作业编号附加如下:
Log = condor_job_log{$JOB_ID}.out
我尝试通过在 python 中打印所有环境变量来查找环境名称,但没有帮助:
os.environ = environ({'_CONDOR_ANCESTOR_2148': '3092:1586844319:3811816668', '_CONDOR_ANCESTOR_18122': '18123:1588528659:3276981140', '_CONDOR_ANCESTOR_3092': '18122:1588528659:978447114', 'TEMP': '/srv/condor/execute/dir_18122', '_CONDOR_SCRATCH_DIR': '/srv/condor/execute/dir_18122', '_CONDOR_SLOT': 'slot1_4', 'BATCH_SYSTEM': 'HTCondor', 'TMPDIR': '/srv/condor/execute/dir_18122', '_CONDOR_CHIRP_CONFIG': '/srv/condor/execute/dir_18122/.chirp.config', '_CONDOR_JOB_PIDS': '', 'TMP': '/srv/condor/execute/dir_18122', 'OMP_NUM_THREADS': '4', '_CONDOR_AssignedGPUs': 'CUDA1', '_CONDOR_JOB_AD': '/srv/condor/execute/dir_18122/.job.ad', 'CUDA_VISIBLE_DEVICES': '1', '_CONDOR_JOB_IWD': '/home/me/repo/repo-proj/code', '_CHIRP_DELAYED_UPDATE_PREFIX': 'Chirp', 'GPU_DEVICE_ORDINAL': '1', '_CONDOR_MACHINE_AD': '/srv/condor/execute/dir_18122/.machine.ad'})
因为 jobnumber 应该是其他类似的东西:
Submitting job(s).
1 job(s) submitted to cluster 11011.
我尝试在其中搜索该号码,但没有运气。所以我无法从 python 中获取它...那我该如何获取呢?
这没有帮助:https://www-auth.cs.wisc.edu/lists/htcondor-users/2005-February/msg00202.shtml
因为我不知道 `no env 变量作为标准是什么,但预定义宏还有另一种方法
将其包含在环境中(例如) environment = CONDOR_ID=$(Cluster).$(Process)`的意思。我在我的提交脚本中这样做吗?但是我的提交脚本是一个python脚本......我很困惑。我尝试查看所有环境变量名称,但没有任何符合我预期的名称。
【问题讨论】:
-
为什么链接没有帮助?
-
@AlexeyMints 感谢您的澄清!我会更新。我不知道
no env variable as standard but there is another way with the predefined macros include it the environment with (for example) environment = CONDOR_ID=$(Cluster).$(Process)是什么意思。我在我的提交脚本中这样做吗?但是我的提交脚本是一个python脚本......我很困惑。我尝试查看所有环境变量名称,但没有符合我的预期。