aboutsummaryrefslogtreecommitdiff
path: root/src/gui_index.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-07-15 15:13:03 +0200
committerThomas White <taw@physics.org>2021-07-15 17:05:05 +0200
commitc5a89386f273473954ec5f9e460052c175236c16 (patch)
tree897babdf9e14812de44260bc5305e55ea4823b7a /src/gui_index.c
parent81071755af6d46edd21735ecd749b72695629f11 (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_index.c')
-rw-r--r--src/gui_index.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui_index.c b/src/gui_index.c
index ad1206e0..645af05e 100644
--- a/src/gui_index.c
+++ b/src/gui_index.c
@@ -811,6 +811,7 @@ static char **indexamajig_command_line(const char *geom_filename,
const char *n_thread_str,
const char *files_list,
const char *stream_filename,
+ const char *harvest_filename,
const char *serial_start,
struct peak_params *peak_search_params,
struct index_params *indexing_params,
@@ -975,7 +976,7 @@ static char **indexamajig_command_line(const char *geom_filename,
add_arg_string(args, n_args++, "serial-start", serial_start);
}
- add_arg_string(args, n_args++, "harvest-file", "parameters.json");
+ add_arg_string(args, n_args++, "harvest-file", harvest_filename);
args[n_args] = NULL;
return args;
@@ -1022,8 +1023,10 @@ int write_indexamajig_script(const char *script_filename,
const char *n_thread_str,
const char *files_list,
const char *stream_filename,
+ const char *stdout_filename,
+ const char *stderr_filename,
+ const char *harvest_filename,
const char *serial_start,
- int redirect_output,
struct peak_params *peak_search_params,
struct index_params *indexing_params,
double wavelength_estimate,
@@ -1037,6 +1040,7 @@ int write_indexamajig_script(const char *script_filename,
n_thread_str,
files_list,
stream_filename,
+ harvest_filename,
serial_start,
peak_search_params,
indexing_params,
@@ -1056,8 +1060,8 @@ int write_indexamajig_script(const char *script_filename,
i++;
};
free(cmdline);
- if ( redirect_output ) {
- fprintf(fh, ">stdout.log 2>stderr.log\n");
+ if ( stdout_filename != NULL ) {
+ fprintf(fh, ">%s 2>%s\n", stdout_filename, stderr_filename);
}
fclose(fh);