kushalkolar / MESmerize

Platform for Calcium Imaging analysis. DEPRECATED.
GNU General Public License v3.0
58 stars 14 forks source link

Issue with cnmf-e on HPC #74

Closed smbaca closed 2 years ago

smbaca commented 2 years ago

Below is the error that I receive when I try to run cnmf-e on the high performance computing system called Rivanna at UVA. The program runs fine with the exact same arguments on a pc laptop. Any ideas?

4 cores requested 128gb of RAM CentOS operating system

status: 0 output_info: multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/home/ksm4dk/anaconda3/envs/mesmerize/lib/python3.6/multiprocessing/pool.py", line 119, in worker result = (True, func(*args, *kwds)) File "/home/ksm4dk/anaconda3/envs/mesmerize/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar return list(map(args)) File "/home/ksm4dk/anaconda3/envs/mesmerize/lib/python3.6/site-packages/caiman/source_extraction/cnmf/map_reduce.py", line 137, in cnmf_patches cnm = cnm.fit(images) File "/home/ksm4dk/anaconda3/envs/mesmerize/lib/python3.6/site-packages/caiman/source_extraction/cnmf/cnmf.py", line 506, in fit self.initialize(Y) File "/home/ksm4dk/anaconda3/envs/mesmerize/lib/python3.6/site-packages/caiman/source_extraction/cnmf/cnmf.py", line 966, in initialize self.params.get_group('init')) File "/home/ksm4dk/anaconda3/envs/mesmerize/lib/python3.6/site-packages/caiman/source_extraction/cnmf/initialization.py", line 354, in initialize_components sn=sn, nb=nb, ssub=ssub, ssub_B=ssub_B, init_iter=init_iter, seed_method=seed_method) File "/home/ksm4dk/anaconda3/envs/mesmerize/lib/python3.6/site-packages/caiman/source_extraction/cnmf/initialization.py", line 1264, in greedyROI_corr dview=None, dims=(d1, d2), options['spatial_params']) File "/home/ksm4dk/anaconda3/envs/mesmerize/lib/python3.6/site-packages/caiman/source_extraction/cnmf/spatial.py", line 218, in update_spatial_components C_name, Y_name, folder = creatememmap(Y, np.vstack((C, f)), dview) File "/home/ksm4dk/anaconda3/envs/mesmerize/lib/python3.6/site-packages/caiman/source_extraction/cnmf/spatial.py", line 1125, in creatememmap folder = tempfile.mkdtemp(dir=tmpf) File "/home/ksm4dk/anaconda3/envs/mesmerize/lib/python3.6/tempfile.py", line 370, in mkdtemp _os.mkdir(file, 0o700) FileNotFoundError: [Errno 2] No such file or directory: '/var/www/ood/apps/sys/dashboard/tmprbl6zye1' """

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/ksm4dk/anaconda3/envs/mesmerize/lib/python3.6/site-packages/mesmerize/viewer/modules/batch_run_modules/CNMFE.py", line 173, in run cnm.fit(Y) File "/home/ksm4dk/anaconda3/envs/mesmerize/lib/python3.6/site-packages/caiman/source_extraction/cnmf/cnmf.py", line 606, in fit indices=indices) File "/home/ksm4dk/anaconda3/envs/mesmerize/lib/python3.6/site-packages/caiman/source_extraction/cnmf/map_reduce.py", line 249, in run_CNMF_patches file_res = dview.map_async(cnmf_patches, args_in).get(4294967) File "/home/ksm4dk/anaconda3/envs/mesmerize/lib/python3.6/multiprocessing/pool.py", line 644, in get raise self._value FileNotFoundError: [Errno 2] No such file or directory: '/var/www/ood/apps/sys/dashboard/tmprbl6zye1'

Y.shape: [1000, 612, 762] processing_time: 3.812335666020711

kushalkolar commented 2 years ago

from line 1122-1125 in caiman.source_extraction.cnmf.spatial.creatememmap() it looks like it's creating that dir based on the SLURM_SUBMIT_DIR env variable, and tempfile.mkdtemp() in the python std libs only uses os.mkdir() so it won't create the tempdir recursively. I would try setting the SLURM_SUBMIT_DIR env variable to a parent directory or directory that you pre-create and have full access to. I'm guessing you'll probably need to create a parent directory and then set SLURM_SUBMIT_DIR to point to a temp dir that will be created.

For example:

mkdir /path/to/parent_dir
export SLURM_SUBMIT_DIR=/path/to/parent_dir/temp_dir

Not sure if that'll work, if not I'd try something like:

mkdir /path/to/temp_dir
export SLURM_SUBMIT_DIR=/path/to/temp_dir
kushalkolar commented 2 years ago

@smbaca closing, you're welcome to re-open if you still have issues or post a new issue.