mathnet / mathnet-numerics-native Goto Github PK
View Code? Open in Web Editor NEWNative Providers for Math.NET Numerics (obsolete, now included in mainline repo)
Native Providers for Math.NET Numerics (obsolete, now included in mainline repo)
I have a rest service in a self hosted nancyFX executable that does (amongst other things) multiplies a N x N matrix by a N x 10000 matrix. This generally works. However, when I throw a large amount of calls at the service I get exceptions and the service crashes. For these test calls its A 50X50 matrix against a 50x10000 matrix
I've verified that the exception occurs at this matrix multiplication. stack trace is below. I'll work on making an example over the weekend I can share. In the mean time, is there any other information that you can use?
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indi
cation that other memory is corrupt.
at MathNet.Numerics.Algorithms.LinearAlgebra.Mkl.SafeNativeMethods.d_matrix_multiply(Transpose transA, Transpose tran
sB, Int32 m, Int32 n, Int32 k, Double alpha, Double[] x, Double[] y, Double beta, Double[] c)
at MathNet.Numerics.LinearAlgebra.Double.DenseMatrix.DoMultiply(Matrix`1 other, Matrix`1 result) in c:\TeamCity\build
Agent\work\d4ecde2945c804d6\src\Numerics\LinearAlgebra\Double\DenseMatrix.cs:line 513
at MathNet.Numerics.LinearAlgebra.Generic.Matrix`1.Multiply(Matrix`1 other) in c:\TeamCity\buildAgent\work\d4ecde2945
c804d6\src\Numerics\LinearAlgebra\Generic\Matrix.Arithmetic.cs:line 587
at RMS.Miu.EP2ELT.Lib.CorrelationService.GenerateCorrelatedStdNormMatrix(Int32 dimensions, Double& spearman, Double&
pearson) in
+++++++++++++++++
REDACTED my code
+++++++++++++++++
at CallSite.Target(Closure , CallSite , Func`2 , Object )
at Nancy.Routing.Route.<>c__DisplayClass4.<Wrap>b__3(Object parameters, CancellationToken context)
at Nancy.Routing.DefaultRouteInvoker.Invoke(Route route, CancellationToken cancellationToken, DynamicDictionary param
eters, NancyContext context)
at Nancy.Routing.DefaultRequestDispatcher.<>c__DisplayClass2.<Dispatch>b__0(Task`1 completedTask)
at Nancy.Routing.DefaultRequestDispatcher.Dispatch(NancyContext context, CancellationToken cancellationToken)
at Nancy.NancyEngine.<>c__DisplayClass12.<InvokeRequestLifeCycle>b__f(Task`1 t)
at Nancy.NancyEngine.InvokeRequestLifeCycle(NancyContext context, CancellationToken cancellationToken, IPipelines pip
elines)
at Nancy.NancyEngine.HandleRequestInternal(Request request, Func`2 preRequest)
at Nancy.NancyEngine.HandleRequest(Request request, Func`2 preRequest)
at Nancy.Hosting.Self.NancyHost.Process(HttpListenerContext ctx)
at Nancy.Hosting.Self.NancyHost.GotCallback(IAsyncResult ar)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ListenerAsyncResult.WaitCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverla
pped* pOVERLAP)
Related to #4, I wonder whether we shouldn't allow the default provider to be chosen by environment variables, if there are any set? For testing all the native providers this would be useful as well, since it's easy to set environment variables in a shell script, build file (I think?) and especially so in TeamCity (so we could automatically run the full suite against all providers). It would also make it possible to get rid of the test hack that is still needed to configure the right provider before starting.
Any thoughts?
The source of the native provider is currently in mathnet-numerics. Wouldn't it make sense to move the provider source over here.
Then mathnet-numerics will only contain the provider interface and managed implementation. The native provider source would be in this repo.
I think this would make it easier for others to add/change native providers (e.g. codeplex issue Algorithms.LinearAlgebra.Acml disappeared).
What do you think?
System.Data.Sqlite.dll is a midex mode dll that includes the unmanaged C driver, and the .NET ADO.NET provider. Would you consider bundling the native providers as a single DLL in this manner?
I am using Mathnet.Numerics in a library, and the app that uses this package, also includes the mathnet.numerics. When I try to debug the app, I get a
Exception thrown: 'System.DllNotFoundException' in MathNet.Numerics.dll
Additional information: Unable to load DLL 'MathNet.Numerics.CUDA.dll': The specified module could not be found.
There is no CUDA dll in the package, and I assume this is a native provider, but I have not enabled anything. So, why is this coming up? How do I disable this?
Seems that the development of the native providers is part of "MathNet-Numerics" again. So is this repository now obsolete and should be deleted?
The MKL FAQ says you can redistribute software created with this DLL. It doesn't explicitly mention libraries that use the library. Did you ever ask intel about this, and can you update the README with the answer?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.