开发者

Prohibited from accessing other seismic data in attribute generator (2011)

开发者 https://www.devze.com 2023-03-25 13:20 出处:网络
We have several seismic attribute generators which require data from seismic volumes which are not among the input volumes.

We have several seismic attribute generators which require data from seismic volumes which are not among the input volumes.

In Petrel 2010 this worked fine as long as the generator ran in the UI thread.

Petrel 2011 goes to great lengths to prohibit this: First of all, generators no longer run on the main thread at all. Secondly, an IAsyncSubCube fetched in the UI thread throws an InvalidOperationException if accessed from an attribute worker thread. Here's the exception message:

[ArrayBufferAccessorLink] Error accessing array data: [RequestBroker] The current thread, an internal worker thread, does not have permission to initiate new data access. (This situation may be originating from an external computation e.g. an async. seismic attribute computation.) Exception type: class Slb::Salmon::Adt::Exceptions::InsufficientPermissionsException

Is there any way I can make such an access work? (Providing these volumes as reg开发者_JAVA百科ular attribute inputs is not an option.)


Please use the following approach, but be sure that CanGenerateAsync always returns false:

    // GetAsyncSubCube in the calculation thread and use it in calculation thread
    public override void Calculate(Slb.Ocean.Petrel.DomainObject.Seismic.ISubCube[] input, Slb.Ocean.Petrel.DomainObject.Seismic.ISubCube output)
    {
        IAsyncSubCube cube = Parameters.Cube.GetAsyncSubCube(input[0].MinIJK, input[0].MaxIJK);

        foreach (Index3 index in output )
        {
            output[index] = cube[index];
        }
    }


I think more information is needed to answer your question.

Is your attribute trace-based or brick-based?

What does your attribute return in CanGenerateAsync?

What kind of APIs do you use to access seismic volumes? (a code sample would be great)

And finally, why would you need to access cubes which are not input for your attribute, from the attribute generator code? Could you tell more about your use-case?


This might work:

Delegate dataGetCallback = new Func<Index3, Index3, float[,,]>(GetData);

void IGenerator.Calculate(ISubCube[] inputs, ISubCube[] outputs, Index3 min, Index3 max) {
    float[,,] data = (float[,,])CoreSystem.SynchronizedInvoke.Invoke(getDataCallback, new[] { min, max });

    MyAlgorithm(outputs, data, min, max);
}

float[,,] GetData(Index3 min, Index3 max) {
    return inputDataNotPassedAsArgument.GetSubCube(min, max).ToArray();
}

Consider to do CoreSystem.SynchronizedInvoke.BeginInvoke instead of Invoke which runs synchronously. BeginInvoke will let you do some work on "your" thread while you wait for data to be available.

Warning: I have not tried this.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号