From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dc1b7d7417552349 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-29 18:52:37 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!dispose.news.demon.net!demon!diablo.netcom.net.uk!netcom.net.uk!easynet-monga!easynet-melon!easynet.net!psiuk-p2!psiuk-p3!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: Parallel execution on SGI with GNAT Date: Mon, 29 Oct 2001 17:59:18 -0500 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: <9rkn07$nep$1@nh.pace.co.uk> References: <3BDDD7EC.EC896675@dfrc.nasa.gov> NNTP-Posting-Host: dhcp-200-133.miami.pace.co.uk X-Trace: nh.pace.co.uk 1004396359 24025 136.170.200.133 (29 Oct 2001 22:59:19 GMT) X-Complaints-To: newsmaster@news.cam.pace.co.uk NNTP-Posting-Date: 29 Oct 2001 22:59:19 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:15389 Date: 2001-10-29T22:59:19+00:00 List-Id: This is just a guess since I'm not familiar with your platform, but it may help you to figure out what is going on. Typically, an Ada compiler riding on top of a workstation OS will map Ada tasks to OS threads. The compiler will use whatever OS calls you have to create, schedule, rendesvous and terminate tasks. If your OS does not schedule threads on multiple CPUs, but schedules processes on multiple CPUs, then you have to adopt a different strategy by building your system as independent programs that can be run as processes & then use whatever you have for inter-process communication. (TCP/IP is a common way to go for this.) Its possible that your OS can be configured to run threads on multiple processors, so you might look into the OS documentation and see how this might be done. Perhaps you'll get an answer from someone more familiar with your particular configuration. It would be great to have tasks scheduled on multiple processors because then you've got all the facilities you need to make optimum use of the processors entirely from within the language. However, there is usually a non-trivial penalty for scheduling on multiple processors in the way of inter-process communication, which is why it may not be done. MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/ "Jay Fantini" wrote in message news:3BDDD7EC.EC896675@dfrc.nasa.gov... > ---------------------------------------------------------------------------- ---- > Ada experts, > > Maybe you can help me: I am trying to get the following program to execute > on a 6-CPU SGI ONYX-2 R12000 based system. The system is running IRIX 6.5 > and I am using GNAT Ada-95 version 3.11p for SGI. The program does compile > and run but it only uses 1 CPU and I would like for it to execute on 3 CPUs. > This program is a prototype for a much larger program. > > Do I need to set an environment variable or am I using the wrong Ada-95 > construct? Is there a PRAGMA I should use? Please post all answers to this NG. > > TIA, > > -Jay > > -- ****************************************************************** > > with text_io; > with integer_text_io; > with tems_floating_point_std; > with floating_point_math_lib; > with fp_display; > with higher_functions; > with wexzal; > > use tems_floating_point_std; > use floating_point_math_lib; > use higher_functions; > use wexzal; > > procedure hog is > > task type wzlsum(upper_limit: integer); > task body wzlsum is > x :floating_point; > s :floating_point; > begin > for i in 1..upper_limit loop > x:=floating_point(i); > s:=s+1.0/(x*wzl(x)); > end loop; > text_io.put("Sum for n="); > integer_text_io.put(upper_limit); > text_io.put(" is S="); > fp_display.prt(s); > text_io.new_line; > end wzlsum; > > cpu_hog_5 :wzlsum(5000000); -- Do big calculation in parallel > cpu_hog_4 :wzlsum(4000000); > cpu_hog_3 :wzlsum(3000000); > > begin > text_io.put_line("Program HOG is done!"); > end hog; >