Wednesday, December 12, 2012

of #phi sockets and web servers

More fun with Phi... this time to see if we can attach to sockets natively. I decided to use Nigel Griffiths' awesome tutorial as a starter. This as an aside is a very cool httpd tutorial if you ever wanted to know how web servers work but were afraid to ask.

Ok, first up let's build on the host...
[root@mic01 nweb]# icc -O3 -mmic nweb23.c -o nweb

Yup - ok, start up on the phi directly:
[root@mic01-mic0 nweb]# ./nweb 80 ./

Test from the build host connecting to the IP for the phi:
[root@mic01 nweb]# curl mic0
<BODY BGCOLOR="lightblue">
<H1>nweb Test page</H1>
<IMG SRC="nigel.jpg">
Not pretty but it should prove that nweb works :-)
Feedback is welcome to Nigel Griffiths

So it works, the TCP stack is complete.

p.s. I did run "ab" - you probably would not want this to be a production webserver. Hehehe. Warning - this post like the last post was more of fun exercise in "is it possible" and trying to get familiar with the system what works what is silly etc. etc.

Round these parts "general purpose" often does mean more than moster LAPACK stream results. We have a whole combination of things we need to run quickly and effectively, having a good IP stack is one of the parts. Although we are never going to be a top 500 shop (we leave that to the big boys), these last few posts were basically just for fun and discovery.

Do not panic team Intel, we do have real science on the go behind the scenes - I'm not really planning on running perlcgi ;-).

What has been pretty astounding is how "x86" the Phi really is, Tommy was 100% right!

I do hope Joe Curley isn't reading this, it may bust the Sphygmomanometer ;-)

(c) 2018 James Cuff