File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -520,10 +520,25 @@ def _num_threads_update(self):
520
520
self .inputs .environ ['OMP_NUM_THREADS' ] = str (
521
521
self .inputs .num_threads )
522
522
523
+ @staticmethod
524
+ def _eddycmd (use_cuda ):
525
+ if 'FSL_BIN' not in os .environ :
526
+ raise RuntimeError ("eddy command requires environment variable "
527
+ "FSL_BIN to be set" )
528
+ FSL_BIN = os .environ ['FSL_BIN' ]
529
+ if use_cuda and os .path .exists (os .path .join (FSL_BIN , 'eddy_cuda' )):
530
+ return 'eddy_cuda'
531
+ elif os .path .exists (os .path .join (FSL_BIN , 'eddy_openmp' )):
532
+ return 'eddy_openmp'
533
+ elif os .path .exists (os .path .join (FSL_BIN , 'eddy' )):
534
+ return 'eddy'
535
+ raise RuntimeError ("eddy command not found in FSL_BIN: "
536
+ "'{}'" .format (FSL_BIN ))
537
+
523
538
@property
524
539
def _cmd (self ):
525
- cuda = self .inputs .use_cuda
526
- return 'eddy_cuda' if isdefined ( cuda ) and cuda else 'eddy_openmp'
540
+ return self ._eddycmd ( isdefined ( self . inputs .use_cuda ) and
541
+ self . inputs . use_cuda )
527
542
528
543
def _format_arg (self , name , spec , value ):
529
544
if name == 'in_topup_fieldcoef' :
You can’t perform that action at this time.
0 commit comments