Marc:
My new 8-core opteron server with 16GB of ram just went online today, and I want to plaaaaaaay! When can we have a single-image, multi- processor runtime? Please, pretty-please, pretty-please, huh????
Are we there yet?
Brad
PS: Are we there yet?
Afficher les réponses par date
On 6-Jan-06, at 9:33 PM, Bradley Lucier wrote:
Marc:
My new 8-core opteron server with 16GB of ram just went online today, and I want to plaaaaaaay! When can we have a single-image, multi-processor runtime? Please, pretty-please, pretty-please, huh????
Are we there yet?
Brad
PS: Are we there yet?
Gambit 2.0 had support for multiprocessors way back in 1991. So I suggest you try compiling that. All you have to do is rewrite the code generator (it generated M68K code). Or you could just run it with a M68K emulator (it will probably still be an order of magnitude faster than the 128 processor BBN butterfly I was using).
Sorry I couldn't resist.
More seriously, a big problem I see with a multiprocessor runtime (aside from implementing it) is that there are two radically different ways to go about it (map Scheme threads to OS threads, or extend the current lightweight threads so that the Gambit thread scheduler can take advantage of multiple processors). Several people think option 1 is the best because you get simple interoperability with C. But I think the second option is more interesting because it is more lightweight and it allows a very high number of threads (in other words I think the C thread model sucks). So I'm bound to displease a bunch of people whatever I do!
Marc
On Jan 6, 2006, at 9:26 PM, Marc Feeley wrote:
So I'm bound to displease a bunch of people whatever I do!
Hell, for someone who implemented display the way you did, that shouldn't be a problem. Do it the way you think is right!
By the way, here is the result of "time make -j" after a "make clean" on the box:
113.319u 5.920s 0:38.83 307.0% 0+0k 0+0io 86pf+0w
That's with --enable-single-host. Recompiling everything from Scheme sources.
Should be a nice machine for development.
Brad
On 6-Jan-06, at 10:32 PM, Bradley Lucier wrote:
By the way, here is the result of "time make -j" after a "make clean" on the box:
113.319u 5.920s 0:38.83 307.0% 0+0k 0+0io 86pf+0w
That's with --enable-single-host. Recompiling everything from Scheme sources.
Should be a nice machine for development.
You mean a total of 38 seconds of wall time to compile Gambit from the Scheme source!!! That's amazing! I want one too! Actually just send me the machine and I'll add multiprocessor support to Gambit... that's a fair deal.
Marc
On Jan 6, 2006, at 9:42 PM, Marc Feeley wrote:
On 6-Jan-06, at 10:32 PM, Bradley Lucier wrote:
By the way, here is the result of "time make -j" after a "make clean" on the box:
113.319u 5.920s 0:38.83 307.0% 0+0k 0+0io 86pf+0w
That's with --enable-single-host. Recompiling everything from Scheme sources.
Should be a nice machine for development.
You mean a total of 38 seconds of wall time to compile Gambit from the Scheme source!!!
Yup.
That's amazing! I want one too! Actually just send me the machine and I'll add multiprocessor support to Gambit... that's a fair deal.
You already have a login. (And now we've made *everyone* else jealous ...)
Brad
More seriously, a big problem I see with a multiprocessor runtime (aside from implementing it) is that there are two radically different ways to go about it (map Scheme threads to OS threads, or extend the current lightweight threads so that the Gambit thread scheduler can take advantage of multiple processors). Several people think option 1 is the best because you get simple interoperability with C. But I think the second option is more interesting because it is more lightweight and it allows a very high number of threads (in other words I think the C thread model sucks). So I'm bound to displease a bunch of people whatever I do!
I'm not an expert programmer, but I would like to "cast my vote" in favour of the second option. Scheme is Scheme, interoperability with C should remain a lower priority. And not everyone needs the C interface...
P.S is that Opteron for real?
I'm starting to look into support for multiprocessing (and multi-os- threads). A basic information I need is the number of processors available. This can sometimes be obtained with sysconf, sometimes with sysctl, and perhaps other ways. I have written the test code below to verify which library call is needed. Can people on this list with access to "unusual" operating-systems try it out and report the result (i.e. not Mac OS X, Windows, Linux, and SunOS which I have already checked). You may have to define DONT_HAVE_SYSCTL_H on the command line (this will be taken care of by Gambit's configure script).
Marc
/* File: "ncpu.c" */
#include <stdio.h>
#ifdef _WIN32 #define ___OS_WIN32 #else #define ___OS_POSIX #endif
/ *----------------------------------------------------------------------- ----*/
#ifdef ___OS_POSIX
#include <unistd.h>
#ifdef _SC_NPROCESSORS_ONLN #define OP_SC_NPROCESSORS _SC_NPROCESSORS_ONLN #else #ifdef _SC_NPROCESSORS_CONF #define OP_SC_NPROCESSORS _SC_NPROCESSORS_CONF #endif #endif
void get_ncpu_with_sysconf () { #ifdef OP_SC_NPROCESSORS
int ncpu;
if ((ncpu = sysconf (OP_SC_NPROCESSORS)) < 0) perror ("sysconf error"); else printf ("sysconf reported ncpu = %d\n", ncpu);
#else
printf ("sysconf unusable for getting ncpu\n");
#endif }
#ifndef DONT_HAVE_SYSCTL_H
#include <sys/types.h> #include <sys/sysctl.h>
#ifdef HW_NCPU #define OP_HW_NCPU HW_NCPU #endif
void get_ncpu_with_sysctl () { #ifdef OP_HW_NCPU
int ncpu; int mib[2]; size_t len;
mib[0] = CTL_HW; mib[1] = HW_NCPU; len = sizeof (ncpu);
if (sysctl (mib, 2, &ncpu, &len, NULL, 0) < 0) perror ("sysctl error"); else printf ("sysctl reported ncpu = %d\n", ncpu);
#else
printf ("sysctl unusable for getting ncpu\n");
#endif }
#endif
#endif
/ *----------------------------------------------------------------------- ----*/
#ifdef ___OS_WIN32
#include <windows.h>
void get_ncpu_with_SysInfo () { int ncpu; SYSTEM_INFO si; GetSystemInfo (&si); ncpu = si.dwNumberOfProcessors;
printf ("SysInfo reported ncpu = %d\n", ncpu); }
#endif
/ *----------------------------------------------------------------------- ----*/
int main () { #ifdef ___OS_POSIX get_ncpu_with_sysconf (); #ifndef DONT_HAVE_SYSCTL_H get_ncpu_with_sysctl (); #endif #endif
#ifdef ___OS_WIN32 get_ncpu_with_SysInfo (); #endif
return 0; }
/ *----------------------------------------------------------------------- ----*/