aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-03-04 14:48:17 +0100
committerThomas White <taw@physics.org>2021-03-04 14:48:17 +0100
commit7ad46ee64f13892667c370c1f06f94a3f4e42d76 (patch)
treed83a56c0abfa4b526fa9afde07742b914fdbb8f0 /src
parentbbb08bef7ede9050c23a0309475d170a68631d6e (diff)
SLURM: Set serial offset for indexamajig jobs
Diffstat (limited to 'src')
-rw-r--r--src/gui_backend_local.c2
-rw-r--r--src/gui_backend_slurm.c5
-rw-r--r--src/gui_index.c7
-rw-r--r--src/gui_index.h1
4 files changed, 13 insertions, 2 deletions
diff --git a/src/gui_backend_local.c b/src/gui_backend_local.c
index 829909ac..f12dfd07 100644
--- a/src/gui_backend_local.c
+++ b/src/gui_backend_local.c
@@ -531,7 +531,7 @@ static void *run_indexing(const char *job_title,
n_thread_str,
"files.lst",
"crystfel.stream",
- 1,
+ NULL, 1,
&proj->peak_search_params,
&proj->indexing_params) )
{
diff --git a/src/gui_backend_slurm.c b/src/gui_backend_slurm.c
index f9e5d0a1..57e8686f 100644
--- a/src/gui_backend_slurm.c
+++ b/src/gui_backend_slurm.c
@@ -579,6 +579,7 @@ static void *run_indexing(const char *job_title,
char *sc_filename;
int n_blocks;
char array_inx[128];
+ char serial_offs[128];
workdir = make_job_folder(job_title, job_notes);
if ( workdir == NULL ) return NULL;
@@ -621,13 +622,15 @@ static void *run_indexing(const char *job_title,
if ( sc_filename == NULL ) return NULL;
snprintf(array_inx, 127, "0-%i", n_blocks-1);
+ snprintf(serial_offs, 127, "$((${SLURM_ARRAY_TASK_ID}*%i))",
+ opts->block_size);
if ( !write_indexamajig_script(sc_filename,
proj->geom_filename,
"`nproc`",
"files-${SLURM_ARRAY_TASK_ID}.lst",
"crystfel-${SLURM_ARRAY_TASK_ID}.stream",
- 0,
+ serial_offs, 0,
&proj->peak_search_params,
&proj->indexing_params) )
{
diff --git a/src/gui_index.c b/src/gui_index.c
index 98f8a84c..abd6c4a8 100644
--- a/src/gui_index.c
+++ b/src/gui_index.c
@@ -671,6 +671,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 *serial_start,
struct peak_params *peak_search_params,
struct index_params *indexing_params)
{
@@ -786,6 +787,10 @@ static char **indexamajig_command_line(const char *geom_filename,
indexing_params->metadata_to_copy[i]);
}
+ if ( serial_start != NULL ) {
+ add_arg_string(args, n_args++, "serial-start", serial_start);
+ }
+
args[n_args] = NULL;
return args;
}
@@ -831,6 +836,7 @@ int write_indexamajig_script(const char *script_filename,
const char *n_thread_str,
const char *files_list,
const char *stream_filename,
+ const char *serial_start,
int redirect_output,
struct peak_params *peak_search_params,
struct index_params *indexing_params)
@@ -843,6 +849,7 @@ int write_indexamajig_script(const char *script_filename,
n_thread_str,
files_list,
stream_filename,
+ serial_start,
peak_search_params,
indexing_params);
if ( cmdline == NULL ) return 1;
diff --git a/src/gui_index.h b/src/gui_index.h
index e0f42aad..8b062b98 100644
--- a/src/gui_index.h
+++ b/src/gui_index.h
@@ -48,6 +48,7 @@ extern int write_indexamajig_script(const char *script_filename,
const char *n_thread_str,
const char *files_list,
const char *stream_filename,
+ const char *serial_start,
int redirect_output,
struct peak_params *peak_search_params,
struct index_params *indexing_params);