Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
uecker committed Sep 29, 2024
1 parent 848b211 commit eb33200
Show file tree
Hide file tree
Showing 25 changed files with 119 additions and 117 deletions.
24 changes: 12 additions & 12 deletions scripts/rtreco.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Authors:
# 2024 Moritz Blumenthal <blumenthal@tugraz.at>
# 2024 Philip Schaten <philip.schaten@tugraz.at>

set -e

LOGFILE=/dev/stderr
Expand Down Expand Up @@ -73,7 +73,7 @@ while getopts "hl:t:fRTp:SG" opt; do
GEOM=true
;;
\?)
echo "$usage" >&2
echo "$usage" >&2
exit 1
;;
esac
Expand Down Expand Up @@ -230,11 +230,11 @@ trajectory () (

#FIXME DEADLOCK:
#> ksp_tmp.fifo &

READ=$(($(bart show -d 1 meta0.fifo)/2))
PHS1=$(bart show -d 2 meta1.fifo)
TOT=$(bart show -d 10 meta2.fifo)

topts=(-o2 -r -D -l -x"$READ" -y"$PHS1" -t"$TURNS" -O)

bart traj "${topts[@]}" trj_tmp
Expand All @@ -249,7 +249,7 @@ trajectory () (
bart -t4 -r - estdelay -p10 -R -r2 -- trj_gd - predelay.fifo | \

delay 11 $DELAY $DELAY predelay.fifo postdelay.fifo &

bart -t4 -r postdelay.fifo traj "${topts[@]}" -V postdelay.fifo -- - | \
bart reshape -s 1024 -- $(bart bitmask 2 10 11) $PHS1 $TOT 1 - $DST
)
Expand Down Expand Up @@ -289,9 +289,9 @@ coilcompression_svd () (
bart tee tmp.fifo | \
bart reshape -s1024 -- $(bart bitmask 2 10) $((PHS*TURNS)) $((TOT/TURNS)) - - | \
bart -r - cc -M -- - predelay.fifo &

delay 10 $DELAY $DELAY predelay.fifo cc.fifo &

bart -r cc.fifo repmat -- 9 $TURNS cc.fifo - | \
bart reshape -s1024 -- $(bart bitmask 9 10) 1 $TOT - - | \
bart -r - ccapply -p$CHANNELS -- tmp.fifo - $DST
Expand Down Expand Up @@ -334,7 +334,7 @@ coilcompression_svd_first () (
bart reshape -s1024 -- $(bart bitmask 2 10) $((PHS*TURNS)) $((TOT/TURNS)) - - | \
bart -r - cc -M -- - - | bart tee -n cc.fifo &

bart -l 1024 copy -- cc.fifo cc2
bart -l 1024 copy -- cc.fifo cc2

bart -r tmp.fifo ccapply -p$CHANNELS -- tmp.fifo cc2 $DST
)
Expand Down Expand Up @@ -400,7 +400,7 @@ coilcompression_rovir () (
cat ksp_tmp.fifo | \
bart tee tmp.fifo | \
bart reshape -s1024 -- $(bart bitmask 2 10) $((PHS*TURNS)) $((TOT/TURNS)) - ksp_rovir.fifo &

cat $TRJ | \
bart -t4 -r - scale -- 2 - - | \
bart reshape -s1024 -- $(bart bitmask 2 10) $((PHS*TURNS)) $((TOT/TURNS)) - - | \
Expand All @@ -415,9 +415,9 @@ coilcompression_rovir () (
bart -t4 -r trj_rovir2.fifo nufft -p pat -- trj_rovir2.fifo ineg.fifo neg.fifo &

bart -t4 -r pos.fifo rovir -- pos.fifo neg.fifo predelay.fifo &

delay 10 $DELAY $DELAY predelay.fifo cc.fifo &

bart -r cc.fifo repmat -- 9 $TURNS cc.fifo - | \
bart reshape -s1024 -- $(bart bitmask 9 10) 1 $TOT - - | \
bart -r - ccapply -p$CHANNELS -- tmp.fifo - $DST
Expand Down Expand Up @@ -520,7 +520,7 @@ bart tee $TIME | \
bart -r - flip -- 3 - - | \
bart -r - resize -c -- 0 $RDIMS 1 $RDIMS - reco.fifo &

if $FILTER ; then
if $FILTER ; then

mkfifo reco_fil.fifo

Expand Down
8 changes: 5 additions & 3 deletions src/bart.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ static void parse_bart_opts(int* argcp, char*** argvp)
if (NULL == s) {

// normal reference file:

unmap_cfl(DIMS, ref_dims, tmp);

} else {

// reference stream:
Expand Down Expand Up @@ -299,7 +299,7 @@ static int batch_wrapper(main_fun_t* dispatch_func, int argc, char *argv[argc],
char* thread_argv[argc + 1];
char* thread_argv_save[argc];

for(int m = 0; m < argc; m++) {
for (int m = 0; m < argc; m++) {

thread_argv[m] = strdup(argv[m]);
thread_argv_save[m] = thread_argv[m];
Expand All @@ -309,11 +309,12 @@ static int batch_wrapper(main_fun_t* dispatch_func, int argc, char *argv[argc],

set_cfl_loop_index(pos);
num_rand_init(0ULL);

int ret = (*dispatch_func)(argc, thread_argv);

io_memory_cleanup();

for(int m = 0; m < argc; ++m)
for (int m = 0; m < argc; ++m)
free(thread_argv_save[m]);

return ret;
Expand Down Expand Up @@ -393,6 +394,7 @@ int main_bart(int argc, char* argv[argc])
}
}
}

} else {

long start = cfl_loop_worker_id();
Expand Down
4 changes: 4 additions & 0 deletions src/ccapply.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ int main_ccapply(int argc, char* argv[argc])

long in_dims_t[DIMS];
md_set_dims(DIMS, in_dims_t, 0);

long cc_dims_t[DIMS];

complex float* in_data_t = NULL;
Expand All @@ -98,6 +99,7 @@ int main_ccapply(int argc, char* argv[argc])

strm_in = stream_lookup(in_data_t);
strm_cc = stream_lookup(cc_data_t);

} else {

in_data = load_cfl(ksp_file, DIMS, in_dims);
Expand Down Expand Up @@ -138,6 +140,7 @@ int main_ccapply(int argc, char* argv[argc])

out_data_t = create_async_cfl(out_file, rtflags, DIMS, out_dims_t);
strm_out = stream_lookup(out_data_t);

} else {

out_data = create_cfl(out_file, DIMS, out_dims);
Expand Down Expand Up @@ -278,6 +281,7 @@ int main_ccapply(int argc, char* argv[argc])

unmap_cfl(DIMS, in_dims_t, in_data_t);
unmap_cfl(DIMS, out_dims_t, out_data_t);

} else {

unmap_cfl(DIMS, in_dims, in_data);
Expand Down
4 changes: 2 additions & 2 deletions src/iter/batch_gen.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ static void batch_gen_del(const nlop_data_t* _data)
* @param type methode to compose new batches
* @param seed seed for random reshuffeling of batches
*/
const struct nlop_s* batch_gen_create(int D, const int Ns[D], const long* bat_dims[D], const long* tot_dims[D], const _Complex float* data[D], long Nc, enum BATCH_GEN_TYPE type, unsigned long long seed)
const struct nlop_s* batch_gen_create(int D, const int Ns[D], const long* bat_dims[D], const long* tot_dims[D], const complex float* data[D], long Nc, enum BATCH_GEN_TYPE type, unsigned long long seed)
{
int N = 0;

Expand Down Expand Up @@ -317,7 +317,7 @@ const struct nlop_s* batch_gen_create(int D, const int Ns[D], const long* bat_di

}

const struct nlop_s* batch_gen_create_from_iter(struct iter6_conf_s* iter_conf, int D, const int Ns[D], const long* bat_dims[D], const long* tot_dims[D], const _Complex float* data[D], long Nc)
const struct nlop_s* batch_gen_create_from_iter(struct iter6_conf_s* iter_conf, int D, const int Ns[D], const long* bat_dims[D], const long* tot_dims[D], const complex float* data[D], long Nc)
{
return batch_gen_create(D, Ns, bat_dims, tot_dims, data, Nc, iter_conf->batchgen_type, iter_conf->batch_seed);
}
Expand Down
4 changes: 2 additions & 2 deletions src/join.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ int main_join(int argc, char* argv[argc])
}

complex float* out_data = NULL;

if (stream)
out_data = create_async_cfl(out_file, MD_BIT(dim), N, out_dims);
else
Expand Down Expand Up @@ -196,7 +196,7 @@ int main_join(int argc, char* argv[argc])

long opos[N];
long ipos[N];

md_singleton_strides(N, opos);
md_singleton_strides(N, ipos);

Expand Down
2 changes: 1 addition & 1 deletion src/misc/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void dump_cfl(const char* name, int D, const long dimensions[D], const complex f
unmap_cfl(D, dimensions, out);
}

void dump_multi_cfl(const char* name, int N, int D[N], const long* dimensions[N], const _Complex float* x[N])
void dump_multi_cfl(const char* name, int N, int D[N], const long* dimensions[N], const complex float* x[N])
{
complex float* args[N];
create_multi_cfl(name, N, D, dimensions, args);
Expand Down
11 changes: 6 additions & 5 deletions src/misc/mmio.c
Original file line number Diff line number Diff line change
Expand Up @@ -858,8 +858,9 @@ static complex float* create_cfl_internal(const char* name, int D, const long di

if (mmio_file_locking) {

#pragma omp critical (bart_file_access)
#pragma omp critical (bart_file_access)
addr = create_cfl_typed(type, name, D, dims, stream_flags);

} else {

assert(!cfl_loop_desc_active());
Expand Down Expand Up @@ -1289,7 +1290,7 @@ void unmap_shared_cfl(int D, const long dims[D], const complex float* x)
* @param dimensions[N] pointer to dimensions of each array
* @param args[N] pointer to the first element of each memory mapped array
*/
void create_multi_cfl(const char* name, int N, int D[N], const long* dimensions[N], _Complex float* args[N])
void create_multi_cfl(const char* name, int N, int D[N], const long* dimensions[N], complex float* args[N])
{
io_register_output(name);

Expand Down Expand Up @@ -1347,7 +1348,7 @@ void create_multi_cfl(const char* name, int N, int D[N], const long* dimensions[
}


static int load_multi_cfl_internal(const char* name, int N_max, int D_max, int D[N_max], long dimensions[N_max][D_max], _Complex float* args[N_max], bool priv)
static int load_multi_cfl_internal(const char* name, int N_max, int D_max, int D[N_max], long dimensions[N_max][D_max], complex float* args[N_max], bool priv)
{
io_register_input(name);

Expand Down Expand Up @@ -1441,7 +1442,7 @@ static int load_multi_cfl_internal(const char* name, int N_max, int D_max, int D
* @param dimensions[N_max][D_max] dimensions read from header
* @param args[N] returned pointer to the first element of each memory mapped array
*/
int load_multi_cfl(const char* name, int N_max, int D_max, int D[N_max], long dimensions[N_max][D_max], _Complex float* args[N_max])
int load_multi_cfl(const char* name, int N_max, int D_max, int D[N_max], long dimensions[N_max][D_max], complex float* args[N_max])
{
return load_multi_cfl_internal(name, N_max, D_max, D, dimensions, args, true);
}
Expand All @@ -1454,7 +1455,7 @@ int load_multi_cfl(const char* name, int N_max, int D_max, int D[N_max], long di
* @param dimensions[N] pointer to dimensions of each array
* @param args[N] pointer to the first element of each memory mapped array
*/
void unmap_multi_cfl(int N, int D[N], const long* dimensions[N], _Complex float* args[N])
void unmap_multi_cfl(int N, int D[N], const long* dimensions[N], complex float* args[N])
{
#ifdef MEMONLY_CFL
error("multi cfl not supported with MEMONLY_CFL\n");
Expand Down
Loading

0 comments on commit eb33200

Please sign in to comment.