Skip to content

Commit

Permalink
Made VDS work on excalibur
Browse files Browse the repository at this point in the history
  • Loading branch information
coretl committed Aug 1, 2017
1 parent 4883c3c commit af7f887
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Expand Up @@ -79,6 +79,9 @@

- excalibur.parts.VDSWrapperPart:
name: VDS
dataType: "int16"
dataType: int32
stripeHeight: 259
stripeWidth: 2069

- ADCore.parts.DatasetTablePart:
name: DSET
8 changes: 5 additions & 3 deletions malcolm/modules/excalibur/parts/vdswrapperpart.py
Expand Up @@ -131,7 +131,6 @@ def configure(self, context, completed_steps, steps_to_do, part_info,
node_tree.append(base + "/{}_set_indices".format(axis))

with h5.File(self.vds_path, self.CREATE, libver="latest") as self.vds:
self.vds.swmr_mode = True
for node in self.required_nodes:
self.vds.require_group(node)
for node in node_tree:
Expand Down Expand Up @@ -174,8 +173,8 @@ def configure(self, context, completed_steps, steps_to_do, part_info,
for file_ in files]

# Open the VDS
self.vds = h5.File(self.vds_path, self.APPEND, libver="latest",swmr=True)

self.vds = h5.File(
self.vds_path, self.APPEND, libver="latest", swmr=True)

# Return the dataset information
dataset_infos = list(self._create_dataset_infos(
Expand All @@ -202,6 +201,7 @@ def run(self, context, update_completed_steps):
self.log.info("Waiting for id in file %s", dataset)
while self.ID not in dataset:
context.sleep(0.1)
self.vds.swmr_mode = True
try:
self.log.info("Monitoring raw files until ID reaches %s",
self.done_when_reaches)
Expand Down Expand Up @@ -241,6 +241,7 @@ def update_id(self, min_dataset):
self.log.debug("ID shape:\n%s", min_id.shape)
self.vds[self.ID].resize(min_id.shape)
self.vds[self.ID][...] = min_id
self.vds[self.ID].flush()

def update_sum(self, min_dataset):
min_sum = self.raw_datasets[min_dataset][self.SUM].value
Expand All @@ -260,3 +261,4 @@ def update_sum(self, min_dataset):
self.log.debug("Sum shape:\n%s", sum_.shape)
self.vds[self.SUM].resize(sum_.shape)
self.vds[self.SUM][...] = sum_
self.vds[self.SUM].flush()

0 comments on commit af7f887

Please sign in to comment.