comp.lang.ada
 help / color / mirror / Atom feed
* Parallel execution on SGI with GNAT
@ 2001-10-29 22:27 Jay Fantini
  2001-10-29 22:59 ` Marin David Condic
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Jay Fantini @ 2001-10-29 22:27 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1 bytes --]

 

[-- Attachment #2: hog.txt --]
[-- Type: text/plain, Size: 1567 bytes --]

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;

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Parallel execution on SGI with GNAT
  2001-10-29 22:27 Parallel execution on SGI with GNAT Jay Fantini
@ 2001-10-29 22:59 ` Marin David Condic
  2001-10-30  5:08   ` brentcarnellis
  2001-10-30 11:30 ` Tarjei T. Jensen
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Marin David Condic @ 2001-10-29 22:59 UTC (permalink / raw)


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" <jay.fantini@dfrc.nasa.gov> 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;
>





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Parallel execution on SGI with GNAT
  2001-10-29 22:59 ` Marin David Condic
@ 2001-10-30  5:08   ` brentcarnellis
  2001-10-31  8:56     ` Peter Hermann
  0 siblings, 1 reply; 7+ messages in thread
From: brentcarnellis @ 2001-10-30  5:08 UTC (permalink / raw)


On Mon, 29 Oct 2001 17:59:18 -0500, "Marin David Condic"
<dont.bother.mcondic.auntie.spam@[acm.org> wrote:

>This is just a guess since I'm not familiar with your platform, but it may


Since you forgot to make that important guess, I'll donate a freebie:

   setenv MY_MUSTANG_FELL_IN_A_SINK_HOLE true

and as a precautionary measure

   setenv TERMITES_ARE_EATING_THE_SOFTWARE false


>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" <jay.fantini@dfrc.nasa.gov> 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;
>>
>
>

On SGI/GNAT, try this 
   setenv PTHREAD_SPROC_COUNT AUTO

good luck


"Enquiring minds ... should read a book"
	-- Dillinger Four	





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Parallel execution on SGI with GNAT
  2001-10-29 22:27 Parallel execution on SGI with GNAT Jay Fantini
  2001-10-29 22:59 ` Marin David Condic
@ 2001-10-30 11:30 ` Tarjei T. Jensen
  2001-10-30 12:31 ` David C. Hoos
  2001-10-30 14:11 ` Dale Pennington
  3 siblings, 0 replies; 7+ messages in thread
From: Tarjei T. Jensen @ 2001-10-30 11:30 UTC (permalink / raw)


There are som environment variables you need to set. I don't remember which
ones, but that should be obvious from the documentation that should be
available somewhere. Or search this newsgroup for old posts.

greetings,






^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Parallel execution on SGI with GNAT
  2001-10-29 22:27 Parallel execution on SGI with GNAT Jay Fantini
  2001-10-29 22:59 ` Marin David Condic
  2001-10-30 11:30 ` Tarjei T. Jensen
@ 2001-10-30 12:31 ` David C. Hoos
  2001-10-30 14:11 ` Dale Pennington
  3 siblings, 0 replies; 7+ messages in thread
From: David C. Hoos @ 2001-10-30 12:31 UTC (permalink / raw)
  To: comp.lang.ada; +Cc: jay.fantini, tarjei.jensen

The way this is done on SGI gnat-3.11p is described in the
package spec for System.Task_Info (file s-tasinf.ads).

The SGI information on sproc will also be helpful in providing
the background assumed by the writer of the comments in
the aforementioned source file.

It's been almost three years since I worked on SGI systems,
so the details are hazy in my mind, but I do remember that the
GNAT interface to the SGI sprocs was very nice and worked
well.

David C. Hoos

(256) 704-9623

----- Original Message -----
From: "Jay Fantini" <jay.fantini@dfrc.nasa.gov>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada.eu.org>
Sent: Monday, October 29, 2001 4:27 PM
Subject: Parallel execution on SGI with GNAT


>


----------------------------------------------------------------------------
----


> 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;
>




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Parallel execution on SGI with GNAT
  2001-10-29 22:27 Parallel execution on SGI with GNAT Jay Fantini
                   ` (2 preceding siblings ...)
  2001-10-30 12:31 ` David C. Hoos
@ 2001-10-30 14:11 ` Dale Pennington
  3 siblings, 0 replies; 7+ messages in thread
From: Dale Pennington @ 2001-10-30 14:11 UTC (permalink / raw)


You probably want to add a call the pthread_setconcurrancy into your
program. GNAT runs on top of pthreads in IRIX 6.5, and SGIs pthreads
implementation does not do a good job of setting the number of kernel
vehicles for user level programs.


"Jay Fantini" <jay.fantini@dfrc.nasa.gov> 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;
>





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Parallel execution on SGI with GNAT
  2001-10-30  5:08   ` brentcarnellis
@ 2001-10-31  8:56     ` Peter Hermann
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Hermann @ 2001-10-31  8:56 UTC (permalink / raw)


brentcarnellis@hotmail.com wrote:
> On Mon, 29 Oct 2001 17:59:18 -0500, "Marin David Condic"
> <dont.bother.mcondic.auntie.spam@[acm.org> wrote:
>>This is just a guess since I'm not familiar with your platform, but it may
> Since you forgot to make that important guess, I'll donate a freebie:
>    setenv MY_MUSTANG_FELL_IN_A_SINK_HOLE true
> and as a precautionary measure
>    setenv TERMITES_ARE_EATING_THE_SOFTWARE false

> On SGI/GNAT, try this 
>    setenv PTHREAD_SPROC_COUNT AUTO

> good luck

setenv PTHREAD_SPROC_COUNT "AUTO"

setenv balony off   ;-)

-- 
Peter Hermann Tel+49-711-685-3611 Fax3758 ica2ph@csv.ica.uni-stuttgart.de
Pfaffenwaldring 27 Raum 114, D-70569 Stuttgart Uni Computeranwendungen
http://www.csv.ica.uni-stuttgart.de/homes/ph/
Team Ada: "C'mon people let the world begin" (Paul McCartney)



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-10-31  8:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-29 22:27 Parallel execution on SGI with GNAT Jay Fantini
2001-10-29 22:59 ` Marin David Condic
2001-10-30  5:08   ` brentcarnellis
2001-10-31  8:56     ` Peter Hermann
2001-10-30 11:30 ` Tarjei T. Jensen
2001-10-30 12:31 ` David C. Hoos
2001-10-30 14:11 ` Dale Pennington

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox