Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
77 changes: 0 additions & 77 deletions .github/workflows/portability.yml

This file was deleted.

11 changes: 2 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,8 @@ ifeq ($(UNAME),CYGWIN_NT-10.0)
endif


ifneq (,$(findstring MSYS,$(UNAME))$(findstring MINGW,$(UNAME)))
ifneq (,$(findstring MSYS,$(UNAME)))
BUILDTYPE = MSYS
CPPFLAGS += -DNO_FIFO -DBARTLIB_STATIC
#LDFLAGS += -lucrtbase # support for %F, %T formatting codes in strftime()
#LDFLAGS += -static-libgomp
NOLAPACKE ?= 1
Expand Down Expand Up @@ -188,10 +187,6 @@ endif
#OPT += -ffp-contract=off
CPPFLAGS ?= -Wall -Wextra
CFLAGS ?= $(OPT) -Wmissing-prototypes -Wincompatible-pointer-types -Wsign-conversion -Wwrite-strings
# A format that does not match the width of its argument, or an array of one
# integer type passed where another is expected, is wrong on some platform
# even where the two happen to have the same width here.
CFLAGS += -Werror=format -Werror=incompatible-pointer-types
CXXFLAGS ?= $(OPT)

ifeq ($(BUILDTYPE), MacOSX)
Expand Down Expand Up @@ -734,8 +729,6 @@ CPPFLAGS += $(BLAS_H)
# librt
ifeq ($(BUILDTYPE), MacOSX)
LIBRT :=
else ifeq ($(BUILDTYPE), MSYS)
LIBRT :=
else
ifeq ($(BARTDLL),1)
LIBRT :=
Expand Down Expand Up @@ -938,7 +931,7 @@ MODULES_test_pulseq += -lseq -lnoncart
MODULES_test_seq_asl += -lseq -lsimu -lnoncart

# lib num
UTARGETS += test_multind test_dimtypes test_flpmath test_splines test_linalg test_polynom test_window test_conv
UTARGETS += test_multind test_flpmath test_splines test_linalg test_polynom test_window test_conv
UTARGETS += test_ode test_nlmeans test_rand test_matexp test_delayed
UTARGETS += test_blas test_mdfft test_ops test_ops_p test_flpmath2 test_convcorr test_specfun test_qform test_fft test_gaussians test_md_gaussians
UTARGETS += test_lapack
Expand Down
16 changes: 8 additions & 8 deletions src/affinereg.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ int main_affinereg(int argc, char* argv[argc])

num_init_gpu_support();

bart_dim_t rdims[DIMS];
bart_dim_t mdims[DIMS];
long rdims[DIMS];
long mdims[DIMS];

complex float* ref_ptr = load_cfl(ref_file, DIMS, rdims);
complex float* mov_ptr = load_cfl(mov_file, DIMS, mdims);

if ( (0 != (~UINT64_C(7) & md_nontriv_dims(DIMS, rdims)))
|| (0 != (~UINT64_C(7) & md_nontriv_dims(DIMS, mdims))))
if ( (0 != (~7ul & md_nontriv_dims(DIMS, rdims)))
|| (0 != (~7ul & md_nontriv_dims(DIMS, mdims))))
error("Affine registration only supports the first three dimensions.\nUse bart looping for higher dimensions.\n");

md_zabs(DIMS, mdims, mov_ptr, mov_ptr);
Expand All @@ -97,13 +97,13 @@ int main_affinereg(int argc, char* argv[argc])

if (NULL != msk_mov_file) {

bart_dim_t tdims[DIMS];
long tdims[DIMS];

msk_mov_ptr = load_cfl(msk_mov_file, DIMS, tdims);
assert(md_check_equal_dims(DIMS, mdims, tdims, ~UINT64_C(0)));
assert(md_check_equal_dims(DIMS, mdims, tdims, ~0ul));

msk_ref_ptr = load_cfl(msk_ref_file, DIMS, tdims);
assert(md_check_equal_dims(DIMS, rdims, tdims, ~UINT64_C(0)));
assert(md_check_equal_dims(DIMS, rdims, tdims, ~0ul));
}

const struct nlop_s* trafo = NULL; // false positive
Expand All @@ -123,7 +123,7 @@ int main_affinereg(int argc, char* argv[argc])
break;
}

bart_dim_t aff_dims[DIMS] = { 3, 4, [ 2 ... DIMS - 1 ] = 1 };
long aff_dims[DIMS] = { 3, 4, [ 2 ... DIMS - 1 ] = 1 };
complex float* affine = create_cfl(affine_file, DIMS, aff_dims);

affine_init_id(affine);
Expand Down
6 changes: 3 additions & 3 deletions src/avg.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static const char help_str[] = "Calculates (weighted) average along dimensions s

int main_avg(int argc, char* argv[argc])
{
bart_flags_t flags = 0;
unsigned long flags = 0;
const char* in_file = NULL;
const char* out_file = NULL;

Expand All @@ -51,10 +51,10 @@ int main_avg(int argc, char* argv[argc])

int N = DIMS;

bart_dim_t idims[N];
long idims[N];
complex float* data = load_cfl(in_file, N, idims);

bart_dim_t odims[N];
long odims[N];
md_select_dims(N, ~flags, odims, idims);

complex float* out = create_cfl(out_file, N, odims);
Expand Down
62 changes: 29 additions & 33 deletions src/bart.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,12 @@ static void parse_bart_opts(int* argcp, char*** argvp, int order[DIMS], stream_t
{
int omp_threads = 1;

bart_flags_t flags = 0;
bart_flags_t pflags = 0;
unsigned long flags = 0;
unsigned long pflags = 0;

bart_dim_t param_start[DIMS] = { [0 ... DIMS - 1] = -1 };
bart_dim_t param_end[DIMS] = { [0 ... DIMS - 1] = -1 };
bart_dim_t param_order[DIMS] = { [0 ... DIMS - 1] = -1 };
long param_start[DIMS] = { [0 ... DIMS - 1] = -1 };
long param_end[DIMS] = { [0 ... DIMS - 1] = -1 };
long param_order[DIMS] = { [0 ... DIMS - 1] = -1 };

const char* ref_file = NULL;

Expand Down Expand Up @@ -230,12 +230,8 @@ static void parse_bart_opts(int* argcp, char*** argvp, int order[DIMS], stream_t

if (attach) {

#ifdef SIGSTOP
fprintf(stderr, "PID: %d", getpid());
raise(SIGSTOP);
#else
error("Attaching a debugger needs SIGSTOP, which this platform does not have.\n");
#endif
}

if (0 != bart_mpi_split_flags) {
Expand Down Expand Up @@ -293,7 +289,7 @@ static void parse_bart_opts(int* argcp, char*** argvp, int order[DIMS], stream_t

if (NULL != ref_file) {

bart_dim_t ref_dims[DIMS];
long ref_dims[DIMS];
const void* tmp = load_async_cfl(ref_file, DIMS, ref_dims);

stream_t s = stream_lookup(tmp);
Expand Down Expand Up @@ -367,8 +363,8 @@ static void parse_bart_opts(int* argcp, char*** argvp, int order[DIMS], stream_t
order[i] = param_order[ip++];
}

bart_stride_t offs_size[DIMS] = { [0 ... DIMS - 1] = 0 };
bart_dim_t loop_dims[DIMS] = { [0 ... DIMS - 1] = 1 };
long offs_size[DIMS] = { [0 ... DIMS - 1] = 0 };
long loop_dims[DIMS] = { [0 ... DIMS - 1] = 1 };

for (int i = 0, j = 0; i < DIMS; ++i) {

Expand Down Expand Up @@ -402,10 +398,10 @@ static void parse_bart_opts(int* argcp, char*** argvp, int order[DIMS], stream_t

static double time = 0;
static double time_sq = 0;
static bart_dim_t count = 0;
static long count = 0;


static int batch_wrapper(main_fun_t* dispatch_func, int argc, char *argv[argc], bart_dim_t pos)
static int batch_wrapper(main_fun_t* dispatch_func, int argc, char *argv[argc], long pos)
{
char* thread_argv[argc + 1];
char* thread_argv_save[argc];
Expand Down Expand Up @@ -442,10 +438,10 @@ static int batch_wrapper(main_fun_t* dispatch_func, int argc, char *argv[argc],
return ret;
}

static bool loop_step(bart_dim_t start, bart_dim_t total, bart_dim_t workers, bart_dim_t* idx, bart_dim_t *idx_p,
static bool loop_step(long start, long total, long workers, long* idx, long *idx_p,
int final_ret, const int order[DIMS], stream_t ref_stream)
{
debug_printf(DP_DEBUG3, "Enter BART loop_step: start=%" PRId64 " idx=%" PRId64 ", idx_p=%" PRId64 ", final_ret=%d.\n",
debug_printf(DP_DEBUG3, "Enter BART loop_step: start=%ld idx=%ld, idx_p=%ld, final_ret=%d.\n",
start, *idx, *idx_p, final_ret);

if (-1 == *idx) // initialization
Expand All @@ -462,12 +458,12 @@ static bool loop_step(bart_dim_t start, bart_dim_t total, bart_dim_t workers, ba
return false;
}

bart_flags_t flags = cfl_loop_get_flags();
unsigned long flags = cfl_loop_get_flags();

bart_dim_t dims[DIMS];
long dims[DIMS];
cfl_loop_get_dims(DIMS, dims);

bart_dim_t pos[DIMS] = { };
long pos[DIMS] = { };


if (NULL != ref_stream) {
Expand All @@ -477,7 +473,7 @@ static bool loop_step(bart_dim_t start, bart_dim_t total, bart_dim_t workers, ba

assert(flags == stream_get_flags(ref_stream));

bart_dim_t stream_dims[DIMS];
long stream_dims[DIMS];
stream_get_dimensions(ref_stream, DIMS, stream_dims);

assert(md_check_equal_dims(DIMS, dims, stream_dims, flags));
Expand All @@ -490,10 +486,10 @@ static bool loop_step(bart_dim_t start, bart_dim_t total, bart_dim_t workers, ba

*idx_p = md_ravel_index(DIMS, pos, flags, dims);

debug_printf(DP_DEBUG3, "BART loop_step stream idx received: idx=%" PRId64 "; Pos: \n [ ", *idx);
debug_printf(DP_DEBUG3, "BART loop_step stream idx received: idx=%ld; Pos: \n [ ", *idx);

for (int i = 0; i < DIMS; i++)
debug_printf(DP_DEBUG3, "%" PRId64 ", ", pos[i]);
debug_printf(DP_DEBUG3, "%ld, ", pos[i]);

debug_printf(DP_DEBUG3, "].\n");

Expand All @@ -508,8 +504,8 @@ static bool loop_step(bart_dim_t start, bart_dim_t total, bart_dim_t workers, ba
debug_printf(DP_DEBUG4, "].\n");

// calculate permuted index
bart_dim_t pdims[DIMS];
bart_stride_t pstr[DIMS];
long pdims[DIMS];
long pstr[DIMS];

md_permute_dims(DIMS, order, pstr, MD_STRIDES(DIMS, dims, 1));
md_permute_dims(DIMS, order, pdims, dims);
Expand All @@ -520,7 +516,7 @@ static bool loop_step(bart_dim_t start, bart_dim_t total, bart_dim_t workers, ba
//calculate correct permuted index
*idx_p = md_calc_offset(DIMS, pstr, pos);

debug_printf(DP_DEBUG3, "Leave BART loop_step: start=%" PRId64 " idx=%" PRId64 ", idx_p=%" PRId64 ", final_ret=%d.\n\n", start, *idx, *idx_p, final_ret);
debug_printf(DP_DEBUG3, "Leave BART loop_step: start=%ld idx=%ld, idx_p=%ld, final_ret=%d.\n\n", start, *idx, *idx_p, final_ret);


// FIXME: Loop Order breaks random number test.
Expand Down Expand Up @@ -586,8 +582,8 @@ int main_bart(int argc, char* argv[argc])

int final_ret = 0;

bart_dim_t total = cfl_loop_desc_total();
bart_dim_t workers = cfl_loop_num_workers();
long total = cfl_loop_desc_total();
long workers = cfl_loop_num_workers();

if (cfl_loop_omp()) {

Expand All @@ -601,9 +597,9 @@ int main_bart(int argc, char* argv[argc])

#pragma omp parallel num_threads(workers)
{
bart_dim_t start = cfl_loop_worker_id();
bart_dim_t idx = -1;
bart_dim_t idx_p = -1;
long start = cfl_loop_worker_id();
long idx = -1;
long idx_p = -1;

while (loop_step(start, total, workers, &idx, &idx_p, final_ret, order, ref_stream)) {

Expand All @@ -620,9 +616,9 @@ int main_bart(int argc, char* argv[argc])

} else {

bart_dim_t start = cfl_loop_worker_id();
bart_dim_t idx = -1;
bart_dim_t idx_p = -1;
long start = cfl_loop_worker_id();
long idx = -1;
long idx_p = -1;

mpi_signoff_proc(cfl_loop_desc_active() && (mpi_get_rank() >= total));

Expand Down
Loading