Skip to content

[FEA] Use SCons explicity dependency to avoid building errors #44

@Dirack

Description

@Dirack

🎉 Feature request

Is your feature request related to a problem? Please describe.

While doing a parallel building in scons, one thread can start to build some target that the dependency is not built yet because it's being built for another thread. For instance, in the creGatherStack process, the stacked section (stored in stackedSection file) depends of all CRE stacked traces (stored in creStackedTraces files) generated in the m0, t0 loop. If the building process is parallelized with scons, one thread will start the building of the stacked section without some CRE stacked traces and it will cause a building error.

# Very Fast Simulated Annealing loop to get 
# zero offset CRS parameters (RN, RNIP, and BETA) from the data cube

for i in range(nm0):
	for j in range(nt0):
        [...]
	# CRE stacking
	Flow(creStackedTrace,[creGatherTrace,creTimeCurveTrace],
		'''
		crestack timeCurves=${SOURCES[1]} verb=y aperture=10 |
		put label1=t0 unit1=s label2=m0 unit2=Km --out=stdout
		''')

# Build the cre stacked section
[...]
Flow('stackedSection',sortedFiles,
	'''
	rcat axis=2 ${SOURCES[1:%d]} --out=stdout
	''' % len(files))

Describe the solution you'd like

The solution would be to use explicitly dependency declaration to scons with Depends method.

Describe alternatives you've considered

The code above tells scons that interpolatedDataCube.rsf explicitly depends of dataCube.rsf. So, all the threads have to finish dataCube.rsf building to start interpolatedDataCube.rsf building.

Depends('interpolatedDataCube.rsf','dataCube.rsf')

Additional context

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions