memory mapping failed

Dear MRtrix users/experts,

I am running into problems with all of the MRtrix commands, but only under certain conditions.

My pipelines includes a number of MRtrix operations, and they all are working fine when executed locally from a terminal window. However, because some of the operations are very time-consuming (e.g. topup and eddy related), we need to be able to run these in the background.

So, we are attempting to qsub the job, ensuring that we are qsubbing onto a node with plenty of memory (> 100G, although at the moment we are failing with mrconvert which shouldn’t be that memory intensive).

Here is the command used, and the output we’re getting:
Input:
qsub -hard -V -cwd -shell n -b y -r y -q all.q@@penguin -l h_vmem=150G -now n ./tempScript.sh
where termpScript.sh contains the following:
#!/bin/bash
module load MRtrix3
/public/apps/MRtrix3/mrtrix3/bin/mrconvert -force /home//PROJECTS/MSPROJ/PROCESSING/subj-016/VISIT_1/DICOM//103_DTI_P_3bVals.dcm /home//PROJECTS/MSPROJ/PROCESSING/subj-016/VISIT_1/MRtrix/103_DTI_P_3bVals.mif 2> ~/tempDirectory/runDTIerror.txt

Error output:
mrconvert: [WARNING] existing output files will be overwritten
mrconvert: reading DICOM series “103_DTI_P_3bVals”… [=]
mrconvert: [ERROR] memory-mapping failed for file “/home//PROJECTS/MSPROJ/PROCESSING/subj-016/VISIT_1/DICOM/103_DTI_P_3bVals.dcm”: Cannot allocate memory

Thanks for any advice you can provide in solving this issue.

Best,

Mark Wagshul

Hi Mark,

In the error message:

mrconvert: [ERROR] memory-mapping failed for file “/home//PROJECTS/MSPROJ/PROCESSING/subj-016/VISIT_1/DICOM/103_DTI_P_3bVals.dcm”: Cannot allocate memory

, specifically the “Cannot allocate memory” part is actually not generated by MRtrix3, but is a system-generated message that MRtrix3 simply propagates up to the terminal (code). Such messages can however sometimes be red herrings…

The first thing to do would be to run the command while providing the -debug command-line option; this will at least give some indication as to what information MRtrix3 is using to justify the use of memory-mapping.

You also need to let us know what sort of file system the data reside on: it’s possible that memory-mapping is not possible in your particular configuration, but MRtrix3 has not yet been instructed on such (see current list of filesystems for which to not use memory-mapping in code here).

Cheers
Rob