Brion icon indicating copy to clipboard operation
Brion copied to clipboard

Lazy loading CompartmentReport before subprocess hangs

Open antonelepfl opened this issue 5 years ago • 0 comments

Issue

I have an issue on BB5 where I need to use brion in combination with py-bluepy modules to read some reports and then execute other process with subprocess. The issue is that after using brain to get some information, then subprocess hangs. We were able to identify that if we load from brain import CompartmentReport at the beginning of the test_brion_report.py file (so it is not being lazy loading) the issue disappears. But BluePy uses this with lazy load and anyhow it should work the same so, can you investigate why am I getting this issue?

I past below the files examples and the script to run this test.

Save files

run.sh

#!/bin/bash
module load brion
module load py-bluepy
python ./test_brion_report.py

test_brion_report.py

# from brain import CompartmentReport

t_start = 0
t_end = 300
t_step = 0.1
report_path = '/gpfs/bbp.cscs.ch/home/antonel/unicore_jobs/47f40ebc-8910-4fb5-99ad-d5fcc28ff059/5Cells_report_0.bbp'

def use_brain():
   import pandas as pd
   import numpy as np
   import subprocess
   from brain import CompartmentReport

   # obtained from the original brion code
   def _wrap_index(index):
      """ Create pandas (Multi)Iindex from 'raw' index. """
      return pd.MultiIndex.from_tuples(index)

   report = CompartmentReport(report_path)
   view = report.create_view([51848])

   print('Calling subprocess ---------------------')
   subprocess.call(['ls'])
   print('Done')

use_brain()

Allocate resources on BB5

salloc -n 1 --time 2:00:00 --account proj42 -C uc3 --partition prod

Run script

sh run.sh

antonelepfl avatar Jan 09 '20 11:01 antonelepfl