1 |
|
|
/*************************************** |
2 |
|
|
Auteur : Pierre Aubert |
3 |
|
|
Mail : pierre.aubert@lapp.in2p3.fr |
4 |
|
|
Licence : CeCILL-C |
5 |
|
|
****************************************/ |
6 |
|
|
|
7 |
|
|
#include "backend_getFileName.h" |
8 |
|
|
|
9 |
|
|
#include "backend_condorSubmit.h" |
10 |
|
|
|
11 |
|
|
///Save the corresponding condor submit of the given scene |
12 |
|
|
/** @param fileName : name of the submit file to be written |
13 |
|
|
* @param scene : Scene to be used |
14 |
|
|
* @param computingCenter : Computing center to be used for the submit |
15 |
|
|
* @return true on success, false otherwise |
16 |
|
|
*/ |
17 |
|
2 |
bool backend_condorSubmit(const std::string & fileName, const Scene & scene, const ComputingCenter & computingCenter){ |
18 |
✓✓✓ |
6 |
std::string body(""), baseFileName(".submit/" + backend_getSceneBaseFileName(scene)); |
19 |
✓ |
2 |
body += "# Executable name\n"; |
20 |
✓ |
2 |
body += "executable="; |
21 |
✓✓✗✓
|
2 |
if(scene.getCustumScript() != ""){ |
22 |
|
|
body += scene.getCustumScript(); |
23 |
|
|
}else{ |
24 |
✓✓ |
2 |
body += baseFileName + ".sh"; |
25 |
|
|
} |
26 |
✓ |
2 |
body += "\n"; |
27 |
✓ |
2 |
body += "# We tell condor we want an empty environnement\n"; |
28 |
✓ |
2 |
body += "universe=vanilla\n"; |
29 |
✓ |
2 |
body += "# Standard output\n"; |
30 |
✓✓✓ |
2 |
body += "output="+baseFileName+".$(Process).output\n"; |
31 |
✓ |
2 |
body += "# Error output\n"; |
32 |
✓✓✓ |
2 |
body += "error="+baseFileName+".$(Process).error\n"; |
33 |
✓ |
2 |
body += "# Condor log\n"; |
34 |
✓✓✓ |
2 |
body += "log="+baseFileName+".$(Process).log\n"; |
35 |
✓ |
2 |
body += "# Gives the environnement to the job\n"; |
36 |
✓ |
2 |
body += "getenv = True\n"; |
37 |
✓ |
2 |
body += "\n"; |
38 |
✓✓✓✗ ✓✓✓✗ ✓✗ |
2 |
if(computingCenter.getNotification() != "" && computingCenter.getNotifyUser() != ""){ |
39 |
✓✓✓✓
|
2 |
body += "notification="+computingCenter.getNotification()+"\n"; |
40 |
✓✓✓✓
|
2 |
body += "notify_user="+computingCenter.getNotifyUser()+"\n"; |
41 |
|
|
} |
42 |
✓ |
2 |
body += "\n"; |
43 |
✓ |
2 |
body += "# Requested RAM : 2GB/CPU\n"; |
44 |
✓✓✓✓ ✓ |
2 |
body += "request_memory = "+convertToString(scene.getRequestMemory())+"\n"; |
45 |
✓ |
2 |
body += "\n"; |
46 |
✓✓✗ |
2 |
if(scene.getVecGpuType().size() != 0lu){ |
47 |
✓ |
2 |
body += "# We want one GPU GPU\n"; |
48 |
✓ |
2 |
body += "request_gpus = 1\n"; |
49 |
✓ |
2 |
body += "\n"; |
50 |
✓ |
2 |
body += "# for a specific GPU type, replace XXX with k80, v100, p6000, t4, a100 or a100 80gb\n"; |
51 |
✓✓✓✓
|
2 |
body += "+wantGpuType = \""+scene.getVecGpuType().front()+"\"\n"; |
52 |
|
|
} |
53 |
✓ |
2 |
body += "\n"; |
54 |
✓ |
2 |
body += "# We only start one job\n"; |
55 |
✓ |
2 |
body += "queue\n"; |
56 |
✓ |
2 |
body += "\n\n"; |
57 |
✓ |
4 |
return saveFileContent(fileName, body); |
58 |
|
|
} |
59 |
|
|
|
60 |
|
|
|