diff options
author | Thomas White <taw@physics.org> | 2021-07-15 15:13:03 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2021-07-15 17:05:05 +0200 |
commit | c5a89386f273473954ec5f9e460052c175236c16 (patch) | |
tree | 897babdf9e14812de44260bc5305e55ea4823b7a /src/gui_ambi.c | |
parent | 81071755af6d46edd21735ecd749b72695629f11 (diff) |
GUI: Run all jobs with same CWD as GUI itself
This requires changing all the paths to relative ones.
Previously, the jobs ran with their CWDs set to the corresponding
"result" folder. The trouble is, this breaks everything that uses a
relative location: image filenames, mask/satmap files referenced by the
geometry, etc.
Note that this change also means that the temporary folders
("indexamajig.XXX") are now produced in the top-level working directory.
Eventually, a GUI option should be added to allow these folders to be
put somewhere better (i.e. somewhere fast).
Closes: https://gitlab.desy.de/thomas.white/crystfel/-/issues/44
Diffstat (limited to 'src/gui_ambi.c')
-rw-r--r-- | src/gui_ambi.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/gui_ambi.c b/src/gui_ambi.c index 6e28f194..fd997a9d 100644 --- a/src/gui_ambi.c +++ b/src/gui_ambi.c @@ -482,7 +482,12 @@ int write_ambigator_script(const char *filename, struct gui_indexing_result *input, const char *n_thread_str, struct ambi_params *params, - const char *out_stream) + const char *out_stream, + const char *stdout_filename, + const char *stderr_filename, + const char *fg_filename, + const char *intermediate_rel_filename, + const char *harvest_filename) { FILE *fh; char *exe_path; @@ -495,13 +500,13 @@ int write_ambigator_script(const char *filename, fprintf(fh, "cat \\\n"); for ( i=0; i<input->n_streams; i++ ) { - fprintf(fh, "\"../%s\" \\\n", input->streams[i]); + fprintf(fh, "\"%s\" \\\n", input->streams[i]); } - fprintf(fh, " > ambigator-input.stream\n"); + fprintf(fh, " > %s\n", intermediate_rel_filename); exe_path = get_crystfel_exe("ambigator"); if ( exe_path == NULL ) return 1; - fprintf(fh, "%s ambigator-input.stream \\\n", exe_path); + fprintf(fh, "%s %s \\\n", exe_path, intermediate_rel_filename); fprintf(fh, " -j %s", n_thread_str); fprintf(fh, " -o \"%s\"", out_stream); @@ -522,8 +527,8 @@ int write_ambigator_script(const char *filename, } fprintf(fh, " --iterations=%i", params->niter); - fprintf(fh, " --fg-graph=fg.dat"); - fprintf(fh, " >stdout.log 2>stderr.log\n"); + fprintf(fh, " --fg-graph=%s", fg_filename); + fprintf(fh, " >%s 2>%s\n", stdout_filename, stderr_filename); fclose(fh); return 0; |