Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

This is clearly another case of too many mad scientists, and not enough hunchbacks.


devel / comp.lang.fortran / Re: FORTRAN OpenMP not working properly

SubjectAuthor
* FORTRAN OpenMP not working properlyArumugam ce19d044
+* Re: FORTRAN OpenMP not working properlyLynn McGuire
|`- Re: FORTRAN OpenMP not working properlyArjen Markus
+- Re: FORTRAN OpenMP not working properlyJon Bryan May
+- Re: FORTRAN OpenMP not working properlyFortranFan
+- Re: FORTRAN OpenMP not working properlypehache
`* Re: FORTRAN OpenMP not working properlyEv. Drikos
 `* Re: FORTRAN OpenMP not working properlypehache
  +* Re: FORTRAN OpenMP not working properlygah4
  |`* Re: FORTRAN OpenMP not working properlypehache
  | `- Re: FORTRAN OpenMP not working properlyEv. Drikos
  `- Re: FORTRAN OpenMP not working properlygah4

1
FORTRAN OpenMP not working properly

<d13798d9-f404-4c68-89c2-7e09d89f42cen@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3076&group=comp.lang.fortran#3076

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ad4:5c8c:0:b0:4b9:fe5:e7a8 with SMTP id o12-20020ad45c8c000000b004b90fe5e7a8mr52073793qvh.99.1667950831564;
Tue, 08 Nov 2022 15:40:31 -0800 (PST)
X-Received: by 2002:a05:620a:bc2:b0:6cf:468e:b8ce with SMTP id
s2-20020a05620a0bc200b006cf468eb8cemr40040049qki.699.1667950831282; Tue, 08
Nov 2022 15:40:31 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Tue, 8 Nov 2022 15:40:31 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=182.65.124.241; posting-account=bZWHrgkAAAAUl5bZ6I2c2Och2kSL8J4W
NNTP-Posting-Host: 182.65.124.241
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d13798d9-f404-4c68-89c2-7e09d89f42cen@googlegroups.com>
Subject: FORTRAN OpenMP not working properly
From: ce19d044@smail.iitm.ac.in (Arumugam ce19d044)
Injection-Date: Tue, 08 Nov 2022 23:40:31 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1690
 by: Arumugam ce19d044 - Tue, 8 Nov 2022 23:40 UTC

Hi all

I am trying to run a FORTRAN program with OpenMP in a cluster, but it is not using all the threads. Below is the code and the output. I am new to FORTRAN and OpenMP, please guide me on overcoming the issue

use OMP_LIB
implicit none
integer:: thread_num
integer:: num_threads, num_procs

num_threads = omp_get_max_threads()
call omp_set_num_threads(num_threads)
!$omp parallel
!$omp critical
!$thread_num = omp_get_thread_num()
print *, "Hello world thread number", thread_num
!$omp end critical
!$omp end parallel

end
Output:
Hello world thread number, 10

Thanks
Aru

Re: FORTRAN OpenMP not working properly

<tkevob$1jt5$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3078&group=comp.lang.fortran#3078

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: lynnmcguire5@gmail.com (Lynn McGuire)
Newsgroups: comp.lang.fortran
Subject: Re: FORTRAN OpenMP not working properly
Date: Tue, 8 Nov 2022 19:28:43 -0600
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <tkevob$1jt5$1@dont-email.me>
References: <d13798d9-f404-4c68-89c2-7e09d89f42cen@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 9 Nov 2022 01:28:43 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="a47e4b4a71b59f09dd3cb822ee06fe75";
logging-data="53157"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18GAoJVjwDY7QYvNe3LDCSm"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Cancel-Lock: sha1:561dOQKrqlP7YZkxOlHq0f+DEVI=
Content-Language: en-US
In-Reply-To: <d13798d9-f404-4c68-89c2-7e09d89f42cen@googlegroups.com>
 by: Lynn McGuire - Wed, 9 Nov 2022 01:28 UTC

On 11/8/2022 5:40 PM, Arumugam ce19d044 wrote:
> Hi all
>
> I am trying to run a FORTRAN program with OpenMP in a cluster, but it is not using all the threads. Below is the code and the output. I am new to FORTRAN and OpenMP, please guide me on overcoming the issue
>
> use OMP_LIB
> implicit none
> integer:: thread_num
> integer:: num_threads, num_procs
>
> num_threads = omp_get_max_threads()
> call omp_set_num_threads(num_threads)
>
> !$omp parallel
> !$omp critical
> !$thread_num = omp_get_thread_num()
> print *, "Hello world thread number", thread_num
> !$omp end critical
> !$omp end parallel
>
> end
> Output:
> Hello world thread number, 10
>
> Thanks
> Aru

What platform ? Which compiler ?

Lynn

Re: FORTRAN OpenMP not working properly

<da2fd6c0-5ad8-410f-bcfe-62e782ece963n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3086&group=comp.lang.fortran#3086

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:12cc:b0:6fa:2e4d:cfdd with SMTP id e12-20020a05620a12cc00b006fa2e4dcfddmr37042596qkl.375.1667990339612;
Wed, 09 Nov 2022 02:38:59 -0800 (PST)
X-Received: by 2002:ad4:5dee:0:b0:4b4:b8a:78db with SMTP id
jn14-20020ad45dee000000b004b40b8a78dbmr54049733qvb.12.1667990339461; Wed, 09
Nov 2022 02:38:59 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 9 Nov 2022 02:38:59 -0800 (PST)
In-Reply-To: <tkevob$1jt5$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=136.231.212.35; posting-account=A91wAAoAAADgBUxBX6QqsrSD26GLhVp8
NNTP-Posting-Host: 136.231.212.35
References: <d13798d9-f404-4c68-89c2-7e09d89f42cen@googlegroups.com> <tkevob$1jt5$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <da2fd6c0-5ad8-410f-bcfe-62e782ece963n@googlegroups.com>
Subject: Re: FORTRAN OpenMP not working properly
From: arjen.markus895@gmail.com (Arjen Markus)
Injection-Date: Wed, 09 Nov 2022 10:38:59 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1857
 by: Arjen Markus - Wed, 9 Nov 2022 10:38 UTC

> On 11/8/2022 5:40 PM, Arumugam ce19d044 wrote:
> > Output:
> > Hello world thread number, 10
> >

Odd, because from the message you did get it looks like at least 10 threads are running. The end parallel statement means a barrier is present there, so all threads should wait there and all messages would be printed.

You might try as an alternative to write to individual files, just to see if something is messing with the output to the screen. Add:

write(10+thread_num*) 'Thread number:', thread_num

to the loop. No need to open the files explicity. You should get files with names like fort.10, fort.11 etc. The 10 is there to avoid possibly reserved LU-numbers.

Regards,

Arjen

Re: FORTRAN OpenMP not working properly

<532171a8-4984-4a53-b1f3-7975a03a21afn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3087&group=comp.lang.fortran#3087

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:6214:21a6:b0:4bb:85b4:fd96 with SMTP id t6-20020a05621421a600b004bb85b4fd96mr53568260qvc.28.1667996199703;
Wed, 09 Nov 2022 04:16:39 -0800 (PST)
X-Received: by 2002:a05:6214:21ed:b0:4bb:e947:c59a with SMTP id
p13-20020a05621421ed00b004bbe947c59amr48922163qvj.46.1667996199506; Wed, 09
Nov 2022 04:16:39 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 9 Nov 2022 04:16:39 -0800 (PST)
In-Reply-To: <d13798d9-f404-4c68-89c2-7e09d89f42cen@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.91.133.236; posting-account=v4vWBgoAAACb23EvmH1GaOGVwf7kNx2s
NNTP-Posting-Host: 5.91.133.236
References: <d13798d9-f404-4c68-89c2-7e09d89f42cen@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <532171a8-4984-4a53-b1f3-7975a03a21afn@googlegroups.com>
Subject: Re: FORTRAN OpenMP not working properly
From: jonbryan.may@ingv.it (Jon Bryan May)
Injection-Date: Wed, 09 Nov 2022 12:16:39 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1853
 by: Jon Bryan May - Wed, 9 Nov 2022 12:16 UTC

If you were expecting each thread to print output then changing the line:
!$thread_num = omp_get_thread_num() -> thread_num = omp_get_thread_num()
gives me the following output (both ifort & gfortran):

Hello world thread number 2
Hello world thread number 0
Hello world thread number 6
Hello world thread number 1
Hello world thread number 4
Hello world thread number 5
Hello world thread number 8
Hello world thread number 10
Hello world thread number 3
Hello world thread number 9
Hello world thread number 7
Hello world thread number 11

Jon

Re: FORTRAN OpenMP not working properly

<37f0baca-daa6-41d2-ba7f-fff3184e0b25n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3089&group=comp.lang.fortran#3089

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:12cc:b0:6fa:2e4d:cfdd with SMTP id e12-20020a05620a12cc00b006fa2e4dcfddmr37686450qkl.375.1668003114286;
Wed, 09 Nov 2022 06:11:54 -0800 (PST)
X-Received: by 2002:a37:9705:0:b0:6fa:bd0e:9841 with SMTP id
z5-20020a379705000000b006fabd0e9841mr13526852qkd.268.1668003113997; Wed, 09
Nov 2022 06:11:53 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 9 Nov 2022 06:11:53 -0800 (PST)
In-Reply-To: <d13798d9-f404-4c68-89c2-7e09d89f42cen@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=136.226.53.0; posting-account=ZZXq9AoAAAAQEcA7zKAGm0UFQh4gMBv7
NNTP-Posting-Host: 136.226.53.0
References: <d13798d9-f404-4c68-89c2-7e09d89f42cen@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <37f0baca-daa6-41d2-ba7f-fff3184e0b25n@googlegroups.com>
Subject: Re: FORTRAN OpenMP not working properly
From: parekhvs@gmail.com (FortranFan)
Injection-Date: Wed, 09 Nov 2022 14:11:54 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 9
 by: FortranFan - Wed, 9 Nov 2022 14:11 UTC

On Tuesday, November 8, 2022 at 6:40:33 PM UTC-5, Arumugam ce19d044 wrote:

> Hi all
>
> I am trying to run a FORTRAN program with OpenMP in a cluster, but it is not using all the threads. Below is the code and the output. I am new to FORTRAN and OpenMP, please guide me on overcoming the issue ..

Hello @Arumugam ce19d044,

You may also want to inquire at the relatively recent Fortran Discourse site where you can attach Fortran source code with your posts, provide links, include code snippets with syntax highlighting, etc.
https://fortran-lang.discourse.group/

Re: FORTRAN OpenMP not working properly

<rqjsjHzIb22sbYAefC2tTf3r7YY@jntp>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3096&group=comp.lang.fortran#3096

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!news.nntp4.net!pasdenom.info!from-devjntp
Message-ID: <rqjsjHzIb22sbYAefC2tTf3r7YY@jntp>
JNTP-Route: news2.nemoweb.net
JNTP-DataType: Article
Subject: Re: FORTRAN OpenMP not working properly
References: <d13798d9-f404-4c68-89c2-7e09d89f42cen@googlegroups.com>
Newsgroups: comp.lang.fortran
JNTP-HashClient: hFOiW1VR_8yEqNfMsaKm_wTnj_0
JNTP-ThreadID: d13798d9-f404-4c68-89c2-7e09d89f42cen@googlegroups.com
JNTP-Uri: http://news2.nemoweb.net/?DataID=rqjsjHzIb22sbYAefC2tTf3r7YY@jntp
User-Agent: Nemo/0.999a
JNTP-OriginServer: news2.nemoweb.net
Date: Wed, 09 Nov 22 17:17:57 +0000
Organization: Nemoweb
JNTP-Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0
Injection-Info: news2.nemoweb.net; posting-host="fd5675444fb2abe5cff243786215e1a6f7fd1bea"; logging-data="2022-11-09T17:17:57Z/7405453"; posting-account="44@news2.nemoweb.net"; mail-complaints-to="newsmaster@news2.nemoweb.net"
JNTP-ProtocolVersion: 0.21.1
JNTP-Server: PhpNemoServer/0.94.5
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-JNTP-JsonNewsGateway: 0.96
From: pehache.7@gmail.com (pehache)
 by: pehache - Wed, 9 Nov 2022 17:17 UTC

Le 09/11/2022 à 00:40, Arumugam ce19d044 a écrit :
>
> use OMP_LIB
> implicit none
> integer:: thread_num
> integer:: num_threads, num_procs
>
> num_threads = omp_get_max_threads()

If called outside of a parallel region, omp_get_max_threads() always
returns 1. The right way is

!$omp parallel
!$omp single
num_threads = omp_get_max_threads()
!$omp end single
!$omp end parallel

> call omp_set_num_threads(num_threads)

So here you say that you want to use a single thread, since num_threads=1

> !$omp parallel
> !$omp critical
> !$thread_num = omp_get_thread_num()
> print *, "Hello world thread number", thread_num

The previous is commented, so "thread_num" has not be set, so it can print
virtually anything.

> !$omp end critical
> !$omp end parallel
>
> end
> Output:
> Hello world thread number, 10
>

Re: FORTRAN OpenMP not working properly

<tkl5n6$cpf$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3125&group=comp.lang.fortran#3125

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!aioe.org!w/bYNckEByngLNAb2bKGmg.user.46.165.242.91.POSTED!not-for-mail
From: drikosev@gmail.com (Ev. Drikos)
Newsgroups: comp.lang.fortran
Subject: Re: FORTRAN OpenMP not working properly
Date: Fri, 11 Nov 2022 11:47:19 +0200
Organization: Aioe.org NNTP Server
Message-ID: <tkl5n6$cpf$1@gioia.aioe.org>
References: <d13798d9-f404-4c68-89c2-7e09d89f42cen@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="13103"; posting-host="w/bYNckEByngLNAb2bKGmg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0)
Gecko/20100101 Thunderbird/78.5.1
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Ev. Drikos - Fri, 11 Nov 2022 09:47 UTC

On 09/11/2022 01:40, Arumugam ce19d044 wrote:
> Hi all
>
> I am trying to run a FORTRAN program with OpenMP in a cluster, but it is not using all the threads. Below is the code and the output. I am new to FORTRAN and OpenMP, please guide me on overcoming the issue
>
> use OMP_LIB
> implicit none
> integer:: thread_num
> integer:: num_threads, num_procs
>
> num_threads = omp_get_max_threads()
> call omp_set_num_threads(num_threads)
>
> !$omp parallel
> !$omp critical
> !$thread_num = omp_get_thread_num()
> print *, "Hello world thread number", thread_num
> !$omp end critical
> !$omp end parallel
>
> end
> Output:
> Hello world thread number, 10
>
> Thanks
> Aru
>

Hello,

IMHO, the problem is missing spaces in the 6th line before the end:
!$thread_num = omp_get_thread_num()

If we insert a space there, then it works:
!$ thread_num = omp_get_thread_num()

Re: FORTRAN OpenMP not working properly

<jt6qesFfdmoU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3126&group=comp.lang.fortran#3126

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: pehache.7@gmail.com (pehache)
Newsgroups: comp.lang.fortran
Subject: Re: FORTRAN OpenMP not working properly
Date: Fri, 11 Nov 2022 12:37:00 +0100
Lines: 44
Message-ID: <jt6qesFfdmoU1@mid.individual.net>
References: <d13798d9-f404-4c68-89c2-7e09d89f42cen@googlegroups.com>
<tkl5n6$cpf$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net XE4TcaTvsNF0fyBdVFIEiAR8tpYWxvWlFmqs1lZ1M7ePrTQ1B7
Cancel-Lock: sha1:OSeXUXY7AY6VBjnaHYiyeruK660=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:91.0)
Gecko/20100101 Thunderbird/91.11.0
Content-Language: fr
In-Reply-To: <tkl5n6$cpf$1@gioia.aioe.org>
 by: pehache - Fri, 11 Nov 2022 11:37 UTC

Le 11/11/2022 à 10:47, Ev. Drikos a écrit :
> On 09/11/2022 01:40, Arumugam ce19d044 wrote:
>> Hi all
>>
>> I am trying to run a FORTRAN program with OpenMP in a cluster, but it
>> is not using all the threads. Below is the code and the output. I am
>> new to FORTRAN and OpenMP, please guide me on overcoming the issue
>>
>>     use OMP_LIB
>>     implicit none
>>     integer:: thread_num
>>          integer:: num_threads, num_procs
>>        num_threads = omp_get_max_threads()
>>        call omp_set_num_threads(num_threads)
>>
>>     !$omp parallel
>>            !$omp critical
>>                !$thread_num = omp_get_thread_num()
>>             print *, "Hello world thread number", thread_num
>>            !$omp end critical
>>     !$omp end parallel
>>
>>            end
>> Output:
>> Hello world thread number, 10
>>
>> Thanks
>> Aru
>>
>
> Hello,
>
> IMHO, the problem is missing spaces in the 6th line before the end:
> !$thread_num = omp_get_thread_num()
>
> If we insert a space there, then it works:
> !$ thread_num = omp_get_thread_num()

What??? Are you kidding? Have you tested, or is it just IYHO ?

--
"...sois ouvert aux idées des autres pour peu qu'elles aillent dans le
même sens que les tiennes.", ST sur fr.bio.medecine
ST passe le mur du çon : <j3nn2hFmqj7U1@mid.individual.net>

Re: FORTRAN OpenMP not working properly

<4f821a43-41fa-4361-83d2-3878811aa481n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3131&group=comp.lang.fortran#3131

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a0c:e882:0:b0:4b4:a0b0:2dd8 with SMTP id b2-20020a0ce882000000b004b4a0b02dd8mr3302765qvo.19.1668195429046;
Fri, 11 Nov 2022 11:37:09 -0800 (PST)
X-Received: by 2002:a37:b2c3:0:b0:6fb:4d23:bec0 with SMTP id
b186-20020a37b2c3000000b006fb4d23bec0mr1749269qkf.699.1668195428843; Fri, 11
Nov 2022 11:37:08 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Fri, 11 Nov 2022 11:37:08 -0800 (PST)
In-Reply-To: <jt6qesFfdmoU1@mid.individual.net>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:384e:138c:2e75:b58e;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:384e:138c:2e75:b58e
References: <d13798d9-f404-4c68-89c2-7e09d89f42cen@googlegroups.com>
<tkl5n6$cpf$1@gioia.aioe.org> <jt6qesFfdmoU1@mid.individual.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4f821a43-41fa-4361-83d2-3878811aa481n@googlegroups.com>
Subject: Re: FORTRAN OpenMP not working properly
From: gah4@u.washington.edu (gah4)
Injection-Date: Fri, 11 Nov 2022 19:37:09 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1877
 by: gah4 - Fri, 11 Nov 2022 19:37 UTC

On Friday, November 11, 2022 at 3:37:06 AM UTC-8, pehache wrote:
> Le 11/11/2022 à 10:47, Ev. Drikos a écrit :

(snip)

> > IMHO, the problem is missing spaces in the 6th line before the end:
> > !$thread_num = omp_get_thread_num()
> > If we insert a space there, then it works:
> > !$ thread_num = omp_get_thread_num()

> What??? Are you kidding? Have you tested, or is it just IYHO ?

Directives like !$OMP must NOT have a space.

Conditional compilation, like above, MUST have a space.

https://www.openmp.org/spec-html/5.0/openmpsu24.html#x40-470002.2.2

Re: FORTRAN OpenMP not working properly

<3d894af5-a2ee-4d8c-b54f-52d2f3449e47n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3132&group=comp.lang.fortran#3132

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ac8:7c91:0:b0:39c:bdd5:30b7 with SMTP id y17-20020ac87c91000000b0039cbdd530b7mr2770913qtv.213.1668195597441;
Fri, 11 Nov 2022 11:39:57 -0800 (PST)
X-Received: by 2002:a37:a8cd:0:b0:6fa:9d10:1784 with SMTP id
r196-20020a37a8cd000000b006fa9d101784mr2433174qke.627.1668195597243; Fri, 11
Nov 2022 11:39:57 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Fri, 11 Nov 2022 11:39:57 -0800 (PST)
In-Reply-To: <jt6qesFfdmoU1@mid.individual.net>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:384e:138c:2e75:b58e;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:384e:138c:2e75:b58e
References: <d13798d9-f404-4c68-89c2-7e09d89f42cen@googlegroups.com>
<tkl5n6$cpf$1@gioia.aioe.org> <jt6qesFfdmoU1@mid.individual.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3d894af5-a2ee-4d8c-b54f-52d2f3449e47n@googlegroups.com>
Subject: Re: FORTRAN OpenMP not working properly
From: gah4@u.washington.edu (gah4)
Injection-Date: Fri, 11 Nov 2022 19:39:57 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1559
 by: gah4 - Fri, 11 Nov 2022 19:39 UTC

On Friday, November 11, 2022 at 3:37:06 AM UTC-8, pehache wrote:

(snip)

> What??? Are you kidding? Have you tested, or is it just IYHO ?

Different rules for fixed-form.

Since the news host removes leading blanks, is is hard to tell, but you might be interested:

https://www.openmp.org/spec-html/5.0/openmpsu23.html

Re: FORTRAN OpenMP not working properly

<jt7qbrFk71vU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3135&group=comp.lang.fortran#3135

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: pehache.7@gmail.com (pehache)
Newsgroups: comp.lang.fortran
Subject: Re: FORTRAN OpenMP not working properly
Date: Fri, 11 Nov 2022 21:41:31 +0100
Lines: 27
Message-ID: <jt7qbrFk71vU1@mid.individual.net>
References: <d13798d9-f404-4c68-89c2-7e09d89f42cen@googlegroups.com>
<tkl5n6$cpf$1@gioia.aioe.org> <jt6qesFfdmoU1@mid.individual.net>
<4f821a43-41fa-4361-83d2-3878811aa481n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net PSryrcpQl9T1i2GJEu1QPQYix1feaaqAknWdcLNdDv5pJWCKPV
Cancel-Lock: sha1:zyPTTwdeTShTcYaDNjiLk/jbKZU=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:91.0)
Gecko/20100101 Thunderbird/91.11.0
Content-Language: fr
In-Reply-To: <4f821a43-41fa-4361-83d2-3878811aa481n@googlegroups.com>
 by: pehache - Fri, 11 Nov 2022 20:41 UTC

Le 11/11/2022 à 20:37, gah4 a écrit :
> On Friday, November 11, 2022 at 3:37:06 AM UTC-8, pehache wrote:
>> Le 11/11/2022 à 10:47, Ev. Drikos a écrit :
>
> (snip)
>
>>> IMHO, the problem is missing spaces in the 6th line before the end:
>>> !$thread_num = omp_get_thread_num()
>
>>> If we insert a space there, then it works:
>>> !$ thread_num = omp_get_thread_num()
>
>> What??? Are you kidding? Have you tested, or is it just IYHO ?
>
> Directives like !$OMP must NOT have a space.
>
> Conditional compilation, like above, MUST have a space.
>
> https://www.openmp.org/spec-html/5.0/openmpsu24.html#x40-470002.2.2
>

My bad, I answered too quickly without reading the post correctly :(

--
"...sois ouvert aux idées des autres pour peu qu'elles aillent dans le
même sens que les tiennes.", ST sur fr.bio.medecine
ST passe le mur du çon : <j3nn2hFmqj7U1@mid.individual.net>

Re: FORTRAN OpenMP not working properly

<tkn57e$qo2$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3141&group=comp.lang.fortran#3141

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!aioe.org!w/bYNckEByngLNAb2bKGmg.user.46.165.242.91.POSTED!not-for-mail
From: drikosev@gmail.com (Ev. Drikos)
Newsgroups: comp.lang.fortran
Subject: Re: FORTRAN OpenMP not working properly
Date: Sat, 12 Nov 2022 05:51:10 +0200
Organization: Aioe.org NNTP Server
Message-ID: <tkn57e$qo2$1@gioia.aioe.org>
References: <d13798d9-f404-4c68-89c2-7e09d89f42cen@googlegroups.com>
<tkl5n6$cpf$1@gioia.aioe.org> <jt6qesFfdmoU1@mid.individual.net>
<4f821a43-41fa-4361-83d2-3878811aa481n@googlegroups.com>
<jt7qbrFk71vU1@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="27394"; posting-host="w/bYNckEByngLNAb2bKGmg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0)
Gecko/20100101 Thunderbird/78.5.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
X-Mozilla-News-Host: news://news.aioe.org
 by: Ev. Drikos - Sat, 12 Nov 2022 03:51 UTC

On 11/11/2022 22:41, pehache wrote:
> Le 11/11/2022 à 20:37, gah4 a écrit :
>> On Friday, November 11, 2022 at 3:37:06 AM UTC-8, pehache wrote:
>>> Le 11/11/2022 à 10:47, Ev. Drikos a écrit :
...
>>>> If we insert a space there, then it works:
>>>> !$ thread_num = omp_get_thread_num()
>> ...
>>
>> Conditional compilation, like above, MUST have a space.
>>
>> https://www.openmp.org/spec-html/5.0/openmpsu24.html#x40-470002.2.2
>>
>
> My bad, I answered too quickly without reading the post correctly :(
>

Never mind. Just for the record, I used my syntax checker that treats
spacing rules with high accuracy and the assignment isn't listed as we
can see at the end of the message.

The tool supports syntax for Fortran 2018 and OpenMP 5.0 but is untested
in newer operating systems: https://github.com/drikosev/Fortran

----------------------------------------------------------------------
$ fcheck -fopenmp openmp.f90 -debug
Line=00001,65659 USE buffer=[USE]
Line=00001,66137 name-r buffer=[OMP_LIB]
Line=00001,65800 ; buffer=[\r]
Line=00002,65670 IMPLICIT buffer=[IMPLICIT]
Line=00002,65669 NONE buffer=[NONE]
Line=00002,65800 ; buffer=[\r]
Line=00003,65590 INTEGER buffer=[INTEGER]
Line=00003,65582 :: buffer=[::]
Line=00003,66137 name-r buffer=[THREAD_NUM]
Line=00003,65800 ; buffer=[\r]
Line=00004,65590 INTEGER buffer=[INTEGER]
Line=00004,65582 :: buffer=[::]
Line=00004,66106 name-l buffer=[NUM_THREADS]
Line=00004,00044 , buffer=[,]
Line=00004,66137 name-r buffer=[NUM_PROCS]
Line=00004,65800 ; buffer=[\r]
Line=00006,66106 name-l buffer=[NUM_THREADS]
Line=00006,00061 = buffer=[=]
Line=00006,66106 name-l buffer=[OMP_GET_MAX_THREADS]
Line=00006,00040 ( buffer=[(]
Line=00006,00041 ) buffer=[)]
Line=00006,65800 ; buffer=[\r]
Line=00007,65638 CALL buffer=[CALL]
Line=00007,66106 name-l buffer=[OMP_SET_NUM_THREADS]
Line=00007,00040 ( buffer=[(]
Line=00007,66106 name-l buffer=[NUM_THREADS]
Line=00007,00041 ) buffer=[)]
Line=00007,65800 ; buffer=[\r]
Line=00009,66916 OMP buffer=[!$omp]
Line=00009,66915 PARALLEL buffer=[PARALLEL]
Line=00009,65800 ; buffer=[\r]
Line=00010,66916 OMP buffer=[!$omp]
Line=00010,65789 CRITICAL buffer=[CRITICAL]
Line=00010,65800 ; buffer=[\r]
Line=00012,65849 PRINT buffer=[PRINT]
Line=00012,00042 * buffer=[*]
Line=00012,00044 , buffer=[,]
Line=00012,65882 char-literal-constant buffer=["Hello world
thread number"]
Line=00012,00044 , buffer=[,]
Line=00012,66137 name-r buffer=[THREAD_NUM]
Line=00012,65800 ; buffer=[\r]
Line=00013,66916 OMP buffer=[!$omp]
Line=00013,65570 END buffer=[END]
Line=00013,65789 CRITICAL buffer=[CRITICAL]
Line=00013,65800 ; buffer=[\r]
Line=00014,66916 OMP buffer=[!$omp]
Line=00014,65570 END buffer=[END]
Line=00014,66915 PARALLEL buffer=[PARALLEL]
Line=00014,65800 ; buffer=[\r]
Line=00016,65570 END buffer=[END]
Line=00016,65800 ; buffer=[\r]
Line=00017,-0001 EOF buffer=[]

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor