Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Hjorthmedh committed Sep 23, 2024
1 parent 64a41ea commit 3188a19
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions snudda/simulate/save_network_recording.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,10 @@ class SnuddaSaveNetworkRecordings:

# TODO: Add saving of simulation_config file (and experiment_config_file for pair recording)

def __init__(self, output_file, network_data=None, sample_dt=None):
def __init__(self, output_file, network_data=None, sample_dt=None, node_id=0):

if not self.check_file_available(output_file):
# Only do this check on the first node
if node_id == 0 and not self.check_file_available(output_file):
sys.exit(-1)

self.output_file = output_file
Expand Down Expand Up @@ -284,7 +285,7 @@ def check_file_available(self, file_name):
f = h5py.File(file_name, "w")
f.close()
except BlockingIOError as e:
print(f"Unable to create file {file_name}.")
print(f"Unable to create file {file_name}. Is some other program using the file?")
return False

return True
Expand Down
2 changes: 1 addition & 1 deletion snudda/simulate/simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def __init__(self,
self.load_network_info(self.network_file)

self.record = SnuddaSaveNetworkRecordings(output_file=self.output_file, network_data=self.network_info,
sample_dt=self.sample_dt)
sample_dt=self.sample_dt, node_id=node_id)
self.record.add_unit(data_type="voltage", target_unit="V", conversion_factor=1e-3)
self.record.add_unit(data_type="synaptic_current", target_unit="A", conversion_factor=1e-9)
self.record.add_unit(data_type="spikes", target_unit="s", conversion_factor=1e-3)
Expand Down

0 comments on commit 3188a19

Please sign in to comment.