Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fdt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
fdt
Commits
f50a4408
Commit
f50a4408
authored
11 years ago
by
Moises Fernandez
Browse files
Options
Downloads
Patches
Plain Diff
If not is set SGE_ROOT don't use any queue. Improve monitor if not SGE
parent
66b7e065
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CUDA/bedpostx_gpu
+26
-13
26 additions, 13 deletions
CUDA/bedpostx_gpu
with
26 additions
and
13 deletions
CUDA/bedpostx_gpu
+
26
−
13
View file @
f50a4408
...
...
@@ -64,7 +64,7 @@ subjdir=`echo $subjdir | sed 's/\/$/$/g'`
echo
subjectdir is
$subjdir
#parse option arguments
queue
=
cuda.q
queue
=
"-q
cuda.q
"
njobs
=
1
nfibres
=
2
fudge
=
1
...
...
@@ -73,12 +73,15 @@ njumps=1250
sampleevery
=
25
model
=
1
gflag
=
0
if
[
"x
$SGE_ROOT
"
=
"x"
]
;
then
queue
=
''
fi
shift
while
[
!
-z
"
$1
"
]
do
case
"
$1
"
in
-Q
)
queue
=
$2
;
shift
;;
-Q
)
queue
=
-q
$2
;
shift
;;
-NJOBS
)
njobs
=
$2
;
shift
;;
-n
)
nfibres
=
$2
;
shift
;;
-w
)
fudge
=
$2
;
shift
;;
...
...
@@ -147,6 +150,8 @@ if [ `${FSLDIR}/bin/imtest ${subjdir}/nodif` = 1 ] ; then
${
FSLDIR
}
/bin/fslmaths
${
subjdir
}
/nodif -mas
${
subjdir
}
/nodif_brain_mask
${
subjdir
}
.bedpostX/nodif_brain
fi
nvox=
`
${
FSLDIR
}
/bin/fslstats
$subjdir
.bedpostX/nodif_brain_mask
-V
|
cut
-d
' '
-f1
`
echo Queuing parallel processing stage
[ -f
${
subjdir
}
.bedpostX/commands.txt ] && rm
${
subjdir
}
.bedpostX/commands.txt
if [
"x
$SGE_ROOT
"
=
"x"
]; then
...
...
@@ -158,24 +163,33 @@ if [ "x$SGE_ROOT" = "x" ]; then
#!/bin/sh
finished=0
logdir=
${
subjdir
}
.bedpostX/logs
#voxels processed in each subpart are 12800 or more if the last one is less than 6400 (1 part less)
nsubparts=\
$((
$nvox
/
12800
))
if [ \
$nsubparts
%12800 != 0 ];then
nsubparts=\
$((
\$
nsubparts
+
1
))
fi
last_part=\
$((
$nvox
-(((
\$
nsubparts-1
))
*12800)))
if [ \
$last_part
-lt 6400 ];then
nsubparts=\
$((
\$
nsubparts
-
1
))
fi
check() {
if [ \
$finished
-eq 1 ];then
echo
"
\$
nfin parts processed of "
$n
job
s
echo
"
\$
nfin parts processed of "
$n
subpart
s
else
nfin=0
part=0
while [
"
\$
part"
-le
$n
job
s
];do
sub
part=0
while [
"
\$
sub
part"
-le
\
$n
subpart
s
];do
partzp=\
`
\$
FSLDIR/bin/zeropad
\$
part 4
\`
if
[
-f
${
subjdir
}
.bedpostX/diff_parts/data_part_
\$
partzp
/mean_S0samples
J
]
;
then
if
[
-f
${
subjdir
}
.bedpostX/diff_parts/data_part_
0000
/mean_S0samples
_
\$
subpart
]
;
then
nfin
=
\$
((
\$
nfin + 1
))
fi
part
=
\$
((
\$
part + 1
))
sub
part
=
\$
((
\$
sub
part + 1
))
done
if
[
\$
nfin
-eq
$n
job
s
]
;
then
if
[
\$
nfin
-eq
\
$
n
subpart
s
]
;
then
finished
=
1
fi
echo
"
\$
nfin parts processed of "
$n
job
s
echo
"
\$
nfin parts processed of "
\
$
n
subpart
s
fi
}
exit_test
()
{
...
...
@@ -193,7 +207,7 @@ check
n
=
0
while
[
\$
finished
-eq
0
]
;
do
sleep
10
if
[
\$
n
-eq
6
0
]
;
then
if
[
\$
n
-eq
6
]
;
then
check
n
=
0
else
...
...
@@ -221,11 +235,10 @@ do
part
=
$((
$part
+
1
))
done
bedpostid
=
`
${
FSLDIR
}
/bin/fsl_sub
-q
$queue
-l
${
subjdir
}
.bedpostX/logs -M
$mailto
-N bedpostx_gpu -t
${
subjdir
}
.bedpostX/commands.txt
`
bedpostid
=
`
${
FSLDIR
}
/bin/fsl_sub
$queue
-l
${
subjdir
}
.bedpostX/logs -M
$mailto
-N bedpostx_gpu -t
${
subjdir
}
.bedpostX/commands.txt
`
echo
Queuing post processing stage
nvox
=
`
${
FSLDIR
}
/bin/fslstats
$subjdir
.bedpostX/nodif_brain_mask -V | cut -d
' '
-f1
`
mergeid
=
`
${
FSLDIR
}
/bin/fsl_sub -q
$queue
-j
$bedpostid
-m as -N bpx_postproc -l
${
subjdir
}
.bedpostX/logs
${
FSLDEVDIR
}
/bin/bedpostx_postproc_gpu.sh --data=
${
subjdir
}
/data --mask=
$subjdir
.bedpostX/nodif_brain_mask -b
${
subjdir
}
.bedpostX/bvals -r
${
subjdir
}
.bedpostX/bvecs --forcedir --logdir=
$subjdir
.bedpostX/diff_parts
$gopts
$nvox
$njobs
${
subjdir
}
`
mergeid
=
`
${
FSLDIR
}
/bin/fsl_sub
$queue
-j
$bedpostid
-m as -N bpx_postproc -l
${
subjdir
}
.bedpostX/logs
${
FSLDEVDIR
}
/bin/bedpostx_postproc_gpu.sh --data=
${
subjdir
}
/data --mask=
$subjdir
.bedpostX/nodif_brain_mask -b
${
subjdir
}
.bedpostX/bvals -r
${
subjdir
}
.bedpostX/bvecs --forcedir --logdir=
$subjdir
.bedpostX/diff_parts
$gopts
$nvox
$njobs
${
subjdir
}
`
[
"x
$SGE_ROOT
"
=
"x"
]
&&
kill
-USR1
$monitorpid
if
[
"x
$SGE_ROOT
"
!=
"x"
]
;
then
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment