remote job submission, C++ interface: support remote input files

This is a first step toward letting Condor job submissions
have remote input files.
Todo: change the GAHP protocol to specify this.
This commit is contained in:
David Anderson 2016-07-22 13:51:04 -07:00
parent d738c4e879
commit cd87e03c5e
3 changed files with 52 additions and 10 deletions

View File

@ -355,13 +355,33 @@ int submit_jobs(
}
for (unsigned int j=0; j<job.infiles.size(); j++) {
INFILE infile = job.infiles[j];
sprintf(buf,
"<input_file>\n"
"<mode>local_staged</mode>\n"
"<source>%s</source>\n"
"</input_file>\n",
infile.physical_name
);
switch (infile.mode) {
case FILE_MODE_LOCAL_STAGED:
sprintf(buf,
"<input_file>\n"
"<mode>local_staged</mode>\n"
"<source>%s</source>\n"
"</input_file>\n",
infile.physical_name
);
break;
case FILE_MODE_REMOTE:
sprintf(buf,
"<input_file>\n"
"<mode>remote</mode>\n"
"<url>%s</url>\n"
"<nbytes>%f</nbytes>\n"
"<md5>%s</md5>\n"
"</input_file>\n",
infile.url,
infile.nbytes,
infile.md5
);
break;
default:
fprintf(stderr, "unsupported file mode %d\n", infile.mode);
exit(1);
}
request += buf;
}
request += "</job>\n";

View File

@ -32,12 +32,33 @@ using std::string;
using std::vector;
using std::map;
// Input file modes.
// Only LOCAL_STAGED and REMOTE are implemented now.
//
#define FILE_MODE_LOCAL 1
#define FILE_MODE_LOCAL_STAGED 2
#define FILE_MODE_SEMILOCAL 3
#define FILE_MODE_INLINE 4
#define FILE_MODE_REMOTE 5
struct INFILE {
char physical_name[256]; // BOINC physical name
char src_path[256]; // path on submit machine
int mode; // see above
char logical_name[256];
// filename on execution machine.
// not used; could be used to check consistency w/ input template
// Supplied by Condor, but not currently used.
// could be used to check consistency w/ input template
char src_path[256];
// path on submit machine
// used by Condor GAHP; not part of the API
// the following used for LOCAL_STAGED
char physical_name[256]; // BOINC physical name
// the following used for REMOTE
char url[256];
double nbytes;
char md5[256];
};
struct JOB {

View File

@ -236,6 +236,7 @@ int COMMAND::parse_submit(char* p) {
int ninfiles = atoi(strtok_r(NULL, " ", &p));
for (int j=0; j<ninfiles; j++) {
INFILE infile;
infile.mode = FILE_MODE_LOCAL_STAGED;
strlcpy(infile.src_path, strtok_r(NULL, " ", &p), sizeof(infile.src_path));
strlcpy(infile.logical_name, strtok_r(NULL, " ", &p), sizeof(infile.logical_name));
job.infiles.push_back(infile);