[swift-users] Swift on a cluster?

Lukas Stabe ahti333 at gmail.com
Tue Mar 22 22:20:48 CDT 2016

Hi Vicky,

see my responses inline.

– Lukas

> On 18 Mar 2016, at 12:12, Graymalk Meow via swift-users <swift-users at swift.org <mailto:swift-users at swift.org>> wrote:

> Hi,
> Two things. 
> 1. Has anyone run swift programs on a cluster?  Is it possible?  You can take that as meaning I am interested in giving it a try. Googling this turns up something super confusing: swift-lang.org <http://swift-lang.org/>
> Is this the same language?  If it isn't then there is a real naming problem here. 
swift-lang.org <http://swift-lang.org/> is, in fact, the homepage of two different languages designed to write MPI applications, the newer one being “Swift/T”.

> My interest stems from a love of the Apple world and wanting to somehow include it in some work I'm doing comparing the performance of multiple languages in parallel systems. But my goal is not to make this particular Swift parallel if it isn't already, so if I can't relatively easily make some parallel programs with it then I'll have to pass.
Swift is “parallel” similar to how C and C++ without special tools are. You can use pthreads or dispatch (the Linux port of which will have a strable release with Swift 3).

> And by relatively easily, I mean...  If I can use it with OpenMPI,
I am not aware of MPI (not just OpenMPI necessarily) bindings for Swift, but those should be pretty straight-forward to do. Have a look at the swift-package-manager documentation for simply wrapping the C API and at the Rust MPI crates for some ideas on how the API could be made more swifty.

>  OpenMP,
Since OpenMP is a set of compiler directives that are deeply integrated with C, C++ and Fortran, it would be a nontrivial amount of work to port it to Swift. You can, however, replicate some of its functionality using dispatch and other Swift libraries.

> or OpenCL (using CUDA or, if I just run it on my Mac, then OpenGL, but the clusters have CUDA)
Like MPI, OpenCL provides a C API that void be adapted for Swift. I don’t know steht anyone has down this yet. I don’t have enough experience with CUDA to comment on that, but I suspect it might be similar.

> AND if I can at least compile for different platforms (CentOS Linux and Raspbian Linux)
I remember reading about both CentOS and Raspberry Pi in PRs on GitHub or on the mailing lists. You can probably find info about that by searching those.

>  then we're in business. Googling is unhelpful because of the two languages one name problem. The CentOS systems are large heterogeneous clusters that don't presently have Swift (either one) on them at all so I might be dead in the water anyway but I might be able to get them to install it if I can argue that it'll work.
It could be possible to compile the code on other systems and statically link or copy over the important libraries, so you wouldn’t need to run the Swift compiler on the cluster at all.

> The Raspberries are just my toy cluster that I have full control over. My Mac beats the crap out of them in performance lol, as it should.
> 2.  For fun: http://mobile.eweek.com/developer/javascript-most-popular-language-stack-overflow-report.html <http://mobile.eweek.com/developer/javascript-most-popular-language-stack-overflow-report.html>
> "Meanwhile, the use of the Swift <https://swift.org/> programming language is exploding, the survey showed. Swift grew faster than any other technology last year, the survey showed."
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org <mailto:swift-users at swift.org>
> https://lists.swift.org/mailman/listinfo/swift-users <https://lists.swift.org/mailman/listinfo/swift-users>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160322/eebe3872/attachment.html>

More information about the swift-users mailing list