|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.javaseis.io.SortRead
org.javaseis.io.SortCreate
public class SortCreate
Create a named "sort order" for an existing JavaSeis dataset. A "sort order" is a map that contains a list of traces for a different Volume/Frame ordering of the data. The sort order is defined by two trace properties, one for the third axis, one for the fourth axis. At the present time, only a 2-level sort is supported, but the design does not preclude more sort levels.
The sort order is defined by 3 files: SortProperties.name - Java Properties file describing the sort order SortVolumeMap.name - binary list of (LogicalVolume,FramesinVolume) pairs SortFrameMap.name - binary list of (LogicalFrame,TracesInFrame) pairs SortTraceMap.name - binary list of 64 bit trace numbers for the sort
The SortVolumeMap has "NumberOfVolumes" entries in increasing LogicalVolume order. Each entry consists of (LogicalVolume,FramesinVolume) 32 bit integers.
The SortFrameMap has "FramesPerVolume" * "NumberOfVolumes" locations, but for a sparse sort order some locations may not be filled. The "FrameMap" for a given volume starts at byte location 8*FramesPerVolume*volumeIndex in the SortFrameMap file, and has FramesInVolume entries stored as (LogicalFrame,TracesInFrame) 32 bit integers in increasing LogicalFrame order.
The SortTraceMap has TracePerFrame * FramesPerVolume * NumberOfVolumes entries, and may also be sparse. The "TraceMap" for a given volumeIndex and frameIndex starts at byte location 8*TracesPerFrame*FramesPerVolume*volumeIndex + 8*TracesPerFrame*frameIndex. The entries consist of TracesInFrame 64 bit integers that are the trace index locations in the JavaSeis dataset for the (LogicalVolume, LogicalFrame) sorted data.
Parallel Implementation:
- Split the number of frames in the dataset across processors - read headers in parallel and select off axis 3 and 4 sort values - Locally sort into increasing order on each task - Exchange global counts from the local sorts - Divide the axis 4 sort across processors - Transpose to block and collect axis 4 lists - Re-sort locally on each task - Write sort maps out in parallelPotential issues:
- Currently only supports 2-level sort on 3rd and 4th axes - A very sparse dataset could lead to load imbalance on the parallel read - A sort order (though rare) could place all sorted traces on a single task
Nested Class Summary | |
---|---|
class |
SortCreate.SortCompare
|
Field Summary | |
---|---|
(package private) Decomposition |
dc
|
(package private) SortMap[] |
ilist
|
protected java.lang.String |
key3
|
protected java.lang.String |
key4
|
(package private) int |
localTraces
|
(package private) int |
localVolumes
|
(package private) SortMap[] |
olist
|
(package private) Pacifier |
pacify
|
(package private) IParallelContext |
pc
|
(package private) int |
volumesPerTask
|
Fields inherited from class org.javaseis.io.SortRead |
---|
currentFrame, currentVolume, frameBuffer, frameMap, frameMapio, framesInVolume, framesPerVolume, frameView, label3, label4, logicalFrame, logicalVolume, maxLogFrm, maxLogVol, minLogFrm, minLogVol, sio, sort3, sort4, sortName, sprops, traceBuffer, traceMap, traceMapio, tracesInFrame, tracesInSort, tracesPerFrame, traceView, volumeBuffer, volumeMap, volumeMapio, volumes, volumeView |
Constructor Summary | |
---|---|
SortCreate(Seisio sioFile,
java.lang.String name,
java.lang.String sort3i,
java.lang.String sort4i,
Pacifier paci,
IParallelContext pci)
Create a new sort order for an open JavaSeis dataset |
Method Summary | |
---|---|
void |
close()
|
(package private) void |
frameIndexToPosition(long iframe,
int nfpv,
int[] position)
Convert global frame index in a JavaSeis dataset to a volume/frame index location |
(package private) void |
globalCount()
Collect global counts for traces/frames/volumes in sort order |
static void |
main(java.lang.String[] args)
|
(package private) void |
sortAllocateMaps()
Allocate memory and buffers for sort order maps |
(package private) void |
sortCreateMaps(int ntrc_est)
Create map files for a sort order |
(package private) void |
sortLocal(SortMap[] list)
Loop through sort list and count traces, frames, and volumes |
(package private) void |
sortParallel()
Parallel sort across tasks in a ParallelContext |
(package private) void |
sortWrite()
Loop through sort list and write volume, frame, and trace maps |
(package private) long |
totalFrames(Seisio sio)
Calculate the total number of potential frames in an open JavaSeis dataset. |
(package private) void |
writeFrameMap(int nfrm,
int ivol)
Write frame map for the current volume |
(package private) void |
writeTraceMap(int ntrc,
int ivol,
int ifrm)
Write trace map for the current frame |
(package private) void |
writeVolumeMap(int nvol,
int ivol)
Write volume map for a subrange of volumes |
Methods inherited from class org.javaseis.io.SortRead |
---|
delete, delete, exists, exists, getFrameLabel, getFrameLogicalDelta, getFrameLogicalOrigin, getNumFramesPerVolume, getNumTracesPerFrame, getNumVolumes, getVolumeLabel, getVolumeLogicalDelta, getVolumeLogicalOrigin, list, list, open, readFrame, setFrame, setPosition, setVolume |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
Decomposition dc
SortMap[] ilist
protected java.lang.String key3
protected java.lang.String key4
int localTraces
int localVolumes
SortMap[] olist
Pacifier pacify
IParallelContext pc
int volumesPerTask
Constructor Detail |
---|
public SortCreate(Seisio sioFile, java.lang.String name, java.lang.String sort3i, java.lang.String sort4i, Pacifier paci, IParallelContext pci) throws SeisException
sioFile
- Seisio object for an open JavaSeis datasetname
- name of the sort order to be createdsort3
- trace property that will be used for axis 3 of the sortsort4
- trace property for axis 4 of the sort
SeisException
Method Detail |
---|
public void close()
close
in class SortRead
void frameIndexToPosition(long iframe, int nfpv, int[] position)
iframe
- input global frame in the datasetnfpv
- number of frames per volume in the datasetposition
- output position vectorvoid globalCount()
public static void main(java.lang.String[] args) throws SeisException
args
-
SeisException
void sortAllocateMaps() throws SeisException
SeisException
void sortCreateMaps(int ntrc_est) throws SeisException
ntrc_est
- estimated number of traces in sort
SeisException
void sortLocal(SortMap[] list)
void sortParallel()
void sortWrite() throws SeisException
SeisException
- on map errorslong totalFrames(Seisio sio)
sio
- Seisio object for the JavaSeis dataset
void writeFrameMap(int nfrm, int ivol) throws SeisException
nfrm
- number of frames in the volumeivol
- volume index in the output sort order
SeisException
void writeTraceMap(int ntrc, int ivol, int ifrm) throws SeisException
ntrc
- number of traces in the frameivol
- volume index in the ouput sort orderifrm
- frame index within the current volume
SeisException
- on I/O errorsvoid writeVolumeMap(int nvol, int ivol) throws SeisException
nvol
- number of volumes in subrangeivol
- start index in output sort order for this subrange
SeisException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |