Search code examples
oceanpetrel

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


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 regular attribute inputs is not an option.)


Solution

  • 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];
            }
        }