public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Thomas König" <tk@tkoenig.net>
To: "fortran@gcc.gnu.org" <fortran@gcc.gnu.org>
Cc: gcc mailing list <gcc@gcc.gnu.org>
Subject: Testsuite integration for devel/coarray_native
Date: Sat, 5 Dec 2020 16:13:51 +0100	[thread overview]
Message-ID: <a5cb5aad-2a08-f2c9-486c-2e25a1b38df0@tkoenig.net> (raw)

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

Hi,

I'm currently trying to put together a testsuite for the shared coarray
branch.  What I have so far is a directory 
gcc/testsuite/gfortran.dg/caf-shared
which contains the attached dejagnu file plus the test cases

This works with the command

make check-fortran RUNTESTFLAGS="cas.exp=num_images_1.f90"

but I am not sure if this is the right way to go about this
(would this work in the absence of an installed caf_shared library,
would this cause lots of failures on systems without pthreads, ...?)

On some systems, we need librt for shm_open. Since most shared
coarray tests run at the number of CPUs by default, the tests
should probably not be run in parallel.

Might it be better to put the test cases under the libgomp
directory?  If so, what should it look like, and how would it
then be invoked if only testing for shared coarrays was needed?

Any help would be appreciated.

Best regards

	Thomas


[-- Attachment #2: cas.exp --]
[-- Type: text/plain, Size: 1968 bytes --]

# Copyright (C) 2020 Free Software Foundation, Inc.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GCC; see the file COPYING3.  If not see
# <http://www.gnu.org/licenses/>.
#
# Contributed by Thomas König <tkoenig@gcc.gnu.org>

# Test shared coarray support.

load_lib gfortran-dg.exp

set blddir [lookfor_file [get_multilibs] libcaf_shared]
puts $blddir

dg-init

global gfortran_test_path
global gfortran_aux_module_flags
set gfortran_test_path $srcdir/$subdir

# Return true if the rt library is supported on the target.
proc check_effective_target_librt_available { } {
    return [check_no_compiler_messages librt_available executable {
	int main (void) { return 0; }
    } "-lrt"]
}

set maybe_rt_lib ""
if [check_effective_target_librt_available] {
    set maybe_rt_lib "-lrt"
}

# Main loop.
foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.\[fF\]{,90,95,03,08} ]] {
    # If we're only testing specific files and this isn't one of them, skip it.
    if ![runtest_file_p $runtests $test] then {
	continue
    }
    set option_list [list { -O2 } ]

    set nshort [file tail [file dirname $test]]/[file tail $test]
    list-module-names $test

    foreach flags $option_list {
	verbose "Testing $nshort (libcaf_single), $flags" 1
        set gfortran_aux_module_flags "-pthread -fcoarray=shared $flags -lcaf_single"
	dg-test $test "-pthread -fcoarray=shared $flags -lcaf_shared $maybe_rt_lib" ""
	cleanup-modules ""
    }
}

[-- Attachment #3: num_images_1.f90 --]
[-- Type: text/x-fortran, Size: 147 bytes --]

! { dg-do run }
! { dg-set-target-env-var GFORTRAN_NUM_IMAGES "2" }
program main
  implicit none
  if (num_images() /= 2) stop 1
end program main


             reply	other threads:[~2020-12-05 15:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-05 15:13 Thomas König [this message]
2020-12-06 17:37 dhumieres.dominique
2020-12-06 21:52 ` Thomas König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a5cb5aad-2a08-f2c9-486c-2e25a1b38df0@tkoenig.net \
    --to=tk@tkoenig.net \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).