Deploying apps which use Magma

Open discussion for MAGMA

Deploying apps which use Magma

Postby Matt Phillips » Sat Feb 23, 2013 11:08 am

Sorry for what is probably a very simplistic question, but if my application uses Magma, will it work on a machine that doesn't have a nVidia card? Obviously, its full potential won't be reached. But will it fall back on pure CPU computation where the graphics card isn't there, so that the user will at least still be able to use the program?
Matt Phillips
 
Posts: 8
Joined: Sat Feb 23, 2013 11:01 am

Re: Deploying apps which use Magma

Postby Stan Tomov » Tue Feb 26, 2013 7:14 pm

The ultimate goal is that the user would specify what hardware to be used (while the default would be to use everything available). This is not possible right now but we keep adding functionality that would make it possible, e.g., we released clMAGMA for enabling MAGMA use on any accelerator through OpenCL, and MAGMA MIC for support of Intel Xeon Phi architectures. We also have routines for just multicore CPUs. At some point these would be all merged.
Stan Tomov
 
Posts: 253
Joined: Fri Aug 21, 2009 10:39 pm

Re: Deploying apps which use Magma

Postby Matt Phillips » Wed Feb 27, 2013 12:08 am

Hi Stan,

Thanks for replying. I've never written/deployed an app that is (or uses a library which is) sensitive to different hardware configurations the way MAGMA is. So is the idea that I would provide the user with the option of downloading either the CPU or GPU version binary, both of which could be generated from the same source except I'd have things like
Code: Select all
#ifdef HAS_NVIDIA
   magma_dgemv_gpu(...);
#else
   magma_dgemv_cpu(...);
#endif


in the appropriate places, compiling with or without -DHAS_NVIDIA as appropriate? (Sorry if I don't have the interface right but you get the idea.) Or putting the computational functionality in two separate dlls would be another similar solution I guess.
Matt Phillips
 
Posts: 8
Joined: Sat Feb 23, 2013 11:01 am

Re: Deploying apps which use Magma

Postby Stan Tomov » Thu Feb 28, 2013 2:26 pm

Hi Matt,
This is what we currently do. The user is given different sources, e.g., MAGMA, clMAGMA, or MAGMA MIC, and in addition in make.inc a user may specify which accelerator is available. Then only a particular version gets installed. This mechanisms is not convenient though, e.g., for tools like MATLAB, where the distribution is just a binary. For those cases we will build everything in single binary and have wrappers for every routine that at runtime will determine which hardware-specific routine to execute (based on MAGMA hardware context created at MAGMA initialization time or other user mechanisms of specifying on what hardware to run a specific routine). Using this mechanism one will be also able for example to explicitly set a device and run something on it, e.g., something like this
Code: Select all
magma_setdevice(5);
magma_dgetrf(...);

would run LU factorization on a device that is marked (during initialization) as 5. Something similar can be done through a stream/queue that is previously linked to a device (in which case the stream/queue will be an argument of dgetrf).
Stan Tomov
 
Posts: 253
Joined: Fri Aug 21, 2009 10:39 pm


Return to User discussion

Who is online

Users browsing this forum: No registered users and 1 guest