简体   繁体   English

HTCondor 输出文件:获取创建的目录

[英]HTCondor output files: obtain created directory

I am using HTcondor to generate some data (txt, png).我正在使用 HTcondor 生成一些数据(txt、png)。 By running my program, it creates a directory next to the .sub file, named datasets, where the datasets are stored into.通过运行我的程序,它会在 .sub 文件旁边创建一个名为 datasets 的目录,其中存储了数据集。 Unfortunately, condor does not give me back this created data when finished.不幸的是,神鹰完成后并没有将这些创建的数据还给我。 In other words, my goal is to get the created data in a "Datasets" subfolder next to the .sub file.换句话说,我的目标是在 .sub 文件旁边的“Datasets”子文件夹中获取创建的数据。

I tried: 1) to not put the data under the datasets subfolder, and I obtained them as thought.我尝试过:1)不要将数据放在 datasets 子文件夹下,我按照想法获得了它们。 Howerver, this is not a smooth solution, since I generate like 100 files which are now mixed up with the .sub file and all the other.然而,这不是一个顺利的解决方案,因为我生成了 100 个文件,这些文件现在与 .sub 文件和所有其他文件混合在一起。

2) Also I tried to set this up in the sub file, leading to this: 2)我也尝试在子文件中设置它,导致:

notification = Always
should_transfer_files = YES
RunAsOwner = True
When_To_Transfer_Output = ON_EXIT_OR_EVICT
getenv = True

transfer_input_files = main.py
transfer_output_files = Datasets

universe      = vanilla
log           = log/test-$(Cluster).log
error         = log/test-$(Cluster)-$(Process).err
output        = log/test-$(Cluster)-$(Process).log
executable    = Simulation.bat

queue

This time I get the error, that Datasets was not found.这次我收到错误,未找到数据集。 Spelling was checked already.拼写已经检查过了。

3) Another option would be, to pack everything in a zip, but since I have to run hundreds of jobs, I do not want to unpack all this files afterwards. 3)另一种选择是,将所有内容打包在一个 zip 文件中,但由于我必须运行数百个作业,因此我不想在之后解压缩所有这些文件。

I hope somebody comes up with a good idea on how to solve this.我希望有人想出一个关于如何解决这个问题的好主意。

Just for the record here: HTCondor does not transfer created directories at the end of the run or its contents.仅供参考:HTCondor 不会在运行结束时传输创建的目录或其内容。 The best way to get the content back is to write a wrapper script that will run your executable and then compress the created directory at the root of the working directory.获取内容的最佳方法是编写一个包装脚本,该脚本将运行您的可执行文件,然后在工作目录的根目录下压缩创建的目录。 This file will be transferred with all other files.此文件将与所有其他文件一起传输。 For example, create run.exe:例如,创建 run.exe:

./Simulation.bat
tar zcf Datasets.tar.gz Datasets

and in your condor submission script put:并在您的秃鹰提交脚本中输入:

executable    = run.exe

However, if you do not want to do this and if HTCondor is using a common shared space like an AFS you can simply copy the whole directory out:但是,如果您不想这样做,并且 HTCondor 正在使用像 AFS 这样的公共共享空间,您可以简单地复制整个目录:

./Simulation.bat
cp -r Datasets <AFS location>

The other alternative is to define an initialdir as described at the end of: https://research.cs.wisc.edu/htcondor/manual/quickstart.html另一种选择是定义一个初始目录,如以下末尾所述: https ://research.cs.wisc.edu/htcondor/manual/quickstart.html

But one must create the directory structure by hand.但是必须手动创建目录结构。

also, look around pg.另外,环顾四周。 65 of: https://indico.cern.ch/event/611296/contributions/2604376/attachments/1471164/2276521/TannenbaumT_UserTutorial.pdf第 65 页: https : //indico.cern.ch/event/611296/contributions/2604376/attachments/1471164/2276521/TannenbaumT_UserTutorial.pdf

This document is, in general, a very useful one for beginners.总的来说,这份文件对初学者来说非常有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM