embl-cba / elastixWrapper

13 stars 2 forks source link

Unused variable :) #2

Closed vzinche closed 5 years ago

vzinche commented 5 years ago

in MMPB.md:

Generate a text file (job script) with below content (modifying the export statements as described below ).

srun --mem 16000 -n 1 -N 1 -c 8 -t 30:00 -o $OUT -e $ERR /g/almf/software/Fiji.app/ImageJ-linux64 --ij2 --headless --run "Transformix" "elastixDirectory='/g/almf/software/elastix_v4.8', workingDirectory='$TMPDIR', inputImageFile='$INPUT_IMAGE',transformationFile='/g/cba/exchange/platy-trafos/linear/TransformParameters.BSpline10-3Channels.0.txt ',outputFile='$OUTPUT_IMAGE',outputModality='Save as BigDataViewer .xml/.h5',numThreads='1'"

The path highlighted in Bold should be $TRAFO, no?

vzinche commented 5 years ago

Additionally, it looks like you still have to set the $TMPDIR manually, otherwise it tries to create it in /

tischi commented 5 years ago
  1. done
  2. I think you are right; I will change this in the documentation
tischi commented 5 years ago

@vzinche Could you please check whether it works for you now?

vzinche commented 5 years ago

Seems to work! Slightly off topic: why do you use only one thread here?

tischi commented 5 years ago

-c 8 means that I am requesting 8 cores. -n 1 means ? Constantin and I had a very long discussion with our IT department as to the difference between -n and -c is and, frankly, I am not sure I ever understood it. :-) If you see Constantin, could you ask him whether he remembers?

constantinpape commented 5 years ago

TL;DR The current config requests one task on one node with 8 cpus / threads.

In more detail: -N 1 means that one node is requested. -n 1 means that you run 1 task. -c 8 means that this task will run with 8 cpus. If -n were 2, it would run 2 tasks, which in this context would execute the command twice. See the srun man page:

-N, --nodes=<minnodes[-maxnodes]>
    Request that a minimum of minnodes nodes be allocated to this job. A maximum node count may also be specified with maxnodes. If only one number is specified, this is used as both the minimum and maximum node count.
-n, --ntasks=<number>
    Specify the number of tasks to run. Request that srun allocate resources for ntasks tasks. The default is one task per node, but note that the --cpus-per-task option will change this default. This option applies to job and step allocations. 
-c, --cpus-per-task=<ncpus>
    Request that ncpus be allocated per process. This may be useful if the job is multithreaded and requires more than one CPU per task for optimal performance. The default is one CPU per process. If -c is specified without -n, as many tasks will be allocated per node as possible while satisfying the -c restriction. 
tischi commented 5 years ago

ok. I guess that means that usually -n 1 seems to be the proper choice. and specify the number of cores (to be used by a potentially multi-threaded "task") by the -c parameter. right?

constantinpape commented 5 years ago

ok. I guess that means that usually -n 1 seems to be the proper choice. and specify the number of cores (to be used by a potentially multi-threaded "task") by the -c parameter. right?

Yes, for our settings that is usually the right choice.

vzinche commented 5 years ago

Okay, I am sorry for the confusion here, I finally got what I meant with my question "why do you use only one thread here?". I meant not the number of cores that you request, but the actual numThreads='1' that you pass as a parameter to imageJ call. Why not increasing this one?

constantinpape commented 5 years ago

Yes, I was wondering about this too.