我想要两件事:
我的提交脚本如下所示:
####################
#
# 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'})因为这个职位号码应该是其他的,比如:
Submitting job(s).
1 job(s) submitted to cluster 11011.我试着在里面找那个号码却没有运气。所以我不能从python...so那里得到它,我怎么得到它呢?
这没什么用:https://www-auth.cs.wisc.edu/lists/htcondor-users/2005-February/msg00202.shtml
因为我不知道什么‘`no env变量作为标准,但有另一种方式与预定义的宏
用(例如) environment =CONDOR_ID=$(集群).$(Process)的方式将其包含在环境中。我在提交脚本中这样做了吗?但我的投稿脚本是python脚本.我很困惑。我试着查看所有环境变量的名称,但没有任何东西与我所期望的相匹配。
发布于 2020-05-04 01:02:00
如果您想要输出文件名称中的作业id,请尝试如下
output = my_job_$(CLUSTER).out请注意,秃鹰作业id有两个部分,“集群”和"proc“。如果您只是将提交文件以
queue语句。如果每个集群提交多个procs,则
queue 100然后procs将从0到99。
在这种情况下,您可能希望将集群和proc放入文件名中,如下所示
output = my_job_$(CLUSTER).$(PROCESS).out将集群id输入到环境中并不太困难,假设您希望它位于环境变量MY_JOB_ID中。
environment = MY_JOB_ID = $(CLUSTER)然后,python脚本将在名为MY_JOB_ID的环境变量中看到集群id。
https://stackoverflow.com/questions/61581092
复制相似问题