diff options
Diffstat (limited to 'src/im-sandbox.c')
-rw-r--r-- | src/im-sandbox.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/im-sandbox.c b/src/im-sandbox.c index d9348b37..8097c273 100644 --- a/src/im-sandbox.c +++ b/src/im-sandbox.c @@ -87,6 +87,7 @@ struct sandbox int *running; time_t *last_response; int last_ping[MAX_NUM_WORKERS]; + int profile; /* Whether to do wall-clock time profiling */ /* Streams to read from (NB not the same indices as the above) */ int n_read; @@ -488,7 +489,7 @@ static int run_work(const struct index_args *iargs, Stream *st, free(iargs->hdf5_peak_path); free_imagefile_field_list(iargs->copyme); cell_free(iargs->cell); - if ( iargs->profile ) time_accounts_print(taccs); + if ( sb->profile ) time_accounts_print(taccs); time_accounts_free(taccs); return 0; } @@ -1051,7 +1052,7 @@ char *create_tempdir(const char *temp_location) int create_sandbox(struct index_args *iargs, int n_proc, char *prefix, int config_basename, FILE *fh, Stream *stream, const char *tmpdir, int serial_start, - const char *zmq_address, int timeout) + const char *zmq_address, int timeout, int profile) { int i; struct sandbox *sb; @@ -1080,6 +1081,7 @@ int create_sandbox(struct index_args *iargs, int n_proc, char *prefix, sb->iargs = iargs; sb->serial = serial_start; sb->tmpdir = tmpdir; + sb->profile = profile; sb->timeout = timeout; if ( zmq_address != NULL ) { sb->zmq = 1; @@ -1234,7 +1236,7 @@ int create_sandbox(struct index_args *iargs, int n_proc, char *prefix, * waitpid() returns -1 and the loop still exits. */ } - if ( iargs->profile ) time_accounts_print(taccs); + if ( profile ) time_accounts_print(taccs); time_accounts_free(taccs); sem_unlink(semname_q); |