From 2456347fd81e7c713a254a7d7ee6abd5a59dd137 Mon Sep 17 00:00:00 2001 From: Steve Leak Date: Thu, 21 May 2020 15:48:45 -0700 Subject: [PATCH 1/8] add support for UPC language and launchers --- reframe/core/buildsystems.py | 6 +++--- reframe/core/launchers/mpi.py | 30 ++++++++++++++++++++++++++++++ unittests/test_launchers.py | 30 ++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 3 deletions(-) diff --git a/reframe/core/buildsystems.py b/reframe/core/buildsystems.py index 96c249fed1..7e7e1f8057 100644 --- a/reframe/core/buildsystems.py +++ b/reframe/core/buildsystems.py @@ -351,8 +351,8 @@ class SingleSource(BuildSystem): #: automatically based on the extension of the source file. #: The automatically detected extensions are the following: #: - #: - C: `.c`. - #: - C++: `.cc`, `.cp`, `.cxx`, `.cpp`, `.CPP`, `.c++` and `.C`. + #: - C: `.c`, `upc`. + #: - C++: `.cc`, `.cp`, `.cxx`, `.cpp`, `.CPP`, `.c++`, and `.C`. #: - Fortran: `.f`, `.for`, `.ftn`, `.F`, `.FOR`, `.fpp`, `.FPP`, `.FTN`, #: `.f90`, `.f95`, `.f03`, `.f08`, `.F90`, `.F95`, `.F03` and `.F08`. #: - CUDA: `.cu`. @@ -433,7 +433,7 @@ def emit_build_commands(self, environ): def _guess_language(self, filename): _, ext = os.path.splitext(filename) - if ext in ['.c']: + if ext in ['.c', '.upc']: return 'C' if ext in ['.cc', '.cp', '.cxx', '.cpp', '.CPP', '.c++', '.C']: diff --git a/reframe/core/launchers/mpi.py b/reframe/core/launchers/mpi.py index dca6e95129..f41aac94e7 100644 --- a/reframe/core/launchers/mpi.py +++ b/reframe/core/launchers/mpi.py @@ -22,6 +22,36 @@ def command(self, job): return ['ibrun'] +@register_launcher('upcrun') +class UpcrunLauncher(JobLauncher): + '''Launcher for UPC applications.''' + + # sleak: I suspect this needs something more.. + def command(self, job): + cmd = ['upcrun'] + if job.num_tasks: + if job.num_tasks_per_node: + num_nodes = job.num_tasks // job.num_tasks_per_node + cmd += ['-N', str(num_nodes)] + cmd += ['-n', str(job.num_tasks)] + return cmd + + +@register_launcher('upcxx-run') +class UpcxxrunLauncher(JobLauncher): + '''Launcher for UPC++ applications.''' + + # sleak: I suspect this needs something more.. + def command(self, job): + cmd = ['upcxx-run'] + if job.num_tasks: + if job.num_tasks_per_node: + num_nodes = job.num_tasks // job.num_tasks_per_node + cmd += ['-N', str(num_nodes)] + cmd += ['-n', str(job.num_tasks)] + return cmd + + @register_launcher('alps') class AlpsLauncher(JobLauncher): def command(self, job): diff --git a/unittests/test_launchers.py b/unittests/test_launchers.py index 0988ddf2d4..90554fffe9 100644 --- a/unittests/test_launchers.py +++ b/unittests/test_launchers.py @@ -149,6 +149,36 @@ def expected_minimal_command(self): '--foo') +class TestUpcrunLauncher(_TestLauncher, unittest.TestCase): + + @property + def launcher(self): + return getlauncher('upcrun')() + + @property + def expected_command(self): + return 'upcrun -N 2 -n 4 --foo' + + @property + def expected_minimal_command(self): + return 'upcrun -n 1 --foo' + + +class TestUpcxxrunLauncher(_TestLauncher, unittest.TestCase): + + @property + def launcher(self): + return getlauncher('upcxx-run')() + + @property + def expected_command(self): + return 'upcxx-run -N 2 -n 4 --foo' + + @property + def expected_minimal_command(self): + return 'upcxx-run -n 1 --foo' + + class TestAlpsLauncher(_TestLauncher, unittest.TestCase): @property def launcher(self): From ffcd645448fae87d19b3f72b0e15587dec841850 Mon Sep 17 00:00:00 2001 From: Steve Leak Date: Thu, 21 May 2020 15:52:44 -0700 Subject: [PATCH 2/8] remove errant comments --- reframe/core/launchers/mpi.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/reframe/core/launchers/mpi.py b/reframe/core/launchers/mpi.py index f41aac94e7..96cc81ca88 100644 --- a/reframe/core/launchers/mpi.py +++ b/reframe/core/launchers/mpi.py @@ -26,7 +26,6 @@ def command(self, job): class UpcrunLauncher(JobLauncher): '''Launcher for UPC applications.''' - # sleak: I suspect this needs something more.. def command(self, job): cmd = ['upcrun'] if job.num_tasks: @@ -41,7 +40,6 @@ def command(self, job): class UpcxxrunLauncher(JobLauncher): '''Launcher for UPC++ applications.''' - # sleak: I suspect this needs something more.. def command(self, job): cmd = ['upcxx-run'] if job.num_tasks: From 0d2b8ca20040b2217f782a468fad23b0d7add9ce Mon Sep 17 00:00:00 2001 From: Steve Leak Date: Wed, 27 May 2020 17:11:45 -0700 Subject: [PATCH 3/8] make upc additions comply with format conventions --- reframe/core/buildsystems.py | 2 +- reframe/core/launchers/mpi.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/reframe/core/buildsystems.py b/reframe/core/buildsystems.py index 7e7e1f8057..efdad7107e 100644 --- a/reframe/core/buildsystems.py +++ b/reframe/core/buildsystems.py @@ -351,7 +351,7 @@ class SingleSource(BuildSystem): #: automatically based on the extension of the source file. #: The automatically detected extensions are the following: #: - #: - C: `.c`, `upc`. + #: - C: `.c` and `.upc`. #: - C++: `.cc`, `.cp`, `.cxx`, `.cpp`, `.CPP`, `.c++`, and `.C`. #: - Fortran: `.f`, `.for`, `.ftn`, `.F`, `.FOR`, `.fpp`, `.FPP`, `.FTN`, #: `.f90`, `.f95`, `.f03`, `.f08`, `.F90`, `.F95`, `.F03` and `.F08`. diff --git a/reframe/core/launchers/mpi.py b/reframe/core/launchers/mpi.py index 96cc81ca88..73644f54cb 100644 --- a/reframe/core/launchers/mpi.py +++ b/reframe/core/launchers/mpi.py @@ -32,6 +32,7 @@ def command(self, job): if job.num_tasks_per_node: num_nodes = job.num_tasks // job.num_tasks_per_node cmd += ['-N', str(num_nodes)] + cmd += ['-n', str(job.num_tasks)] return cmd @@ -46,6 +47,7 @@ def command(self, job): if job.num_tasks_per_node: num_nodes = job.num_tasks // job.num_tasks_per_node cmd += ['-N', str(num_nodes)] + cmd += ['-n', str(job.num_tasks)] return cmd From e28297b27982c0ce33fbf3171ff0dd7d981e44f1 Mon Sep 17 00:00:00 2001 From: Steve Leak Date: Wed, 27 May 2020 17:30:37 -0700 Subject: [PATCH 4/8] Document upcrun and upcxx-run parallel launchers --- docs/config_reference.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/config_reference.rst b/docs/config_reference.rst index c28faa346d..e9029f97a1 100644 --- a/docs/config_reference.rst +++ b/docs/config_reference.rst @@ -235,6 +235,8 @@ System Partition Configuration This launcher uses the partition’s |access|_ property in order to determine the remote host and any additional options to be passed to the SSH client. The ssh command will be launched in "batch mode," meaning that password-less access to the remote host must be configured. Here is an example configuration for the ssh launcher: + - ``upcrun``: Parallel programs will be launched using the `UPC ` ``upcrun`` command. + - ``upcxx-run``: Parallel programs will be launched using the `UPC++ ` ``upcxx-run`` command. .. code:: python From ab3b23ebd51db01d46f66a3718138cc34c42e539 Mon Sep 17 00:00:00 2001 From: Steve Leak Date: Wed, 27 May 2020 17:36:17 -0700 Subject: [PATCH 5/8] make upc additions comply with format conventions --- reframe/core/launchers/mpi.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reframe/core/launchers/mpi.py b/reframe/core/launchers/mpi.py index 73644f54cb..9cfb4dc07d 100644 --- a/reframe/core/launchers/mpi.py +++ b/reframe/core/launchers/mpi.py @@ -34,6 +34,7 @@ def command(self, job): cmd += ['-N', str(num_nodes)] cmd += ['-n', str(job.num_tasks)] + return cmd @@ -49,6 +50,7 @@ def command(self, job): cmd += ['-N', str(num_nodes)] cmd += ['-n', str(job.num_tasks)] + return cmd From d98a1bee288c3420e5c784c7b369fd4034cc9005 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Thu, 28 May 2020 21:27:14 +0200 Subject: [PATCH 6/8] Remove unnecessary if --- reframe/core/launchers/mpi.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/reframe/core/launchers/mpi.py b/reframe/core/launchers/mpi.py index 9cfb4dc07d..082e87ce98 100644 --- a/reframe/core/launchers/mpi.py +++ b/reframe/core/launchers/mpi.py @@ -28,13 +28,11 @@ class UpcrunLauncher(JobLauncher): def command(self, job): cmd = ['upcrun'] - if job.num_tasks: - if job.num_tasks_per_node: - num_nodes = job.num_tasks // job.num_tasks_per_node - cmd += ['-N', str(num_nodes)] - - cmd += ['-n', str(job.num_tasks)] + if job.num_tasks_per_node: + num_nodes = job.num_tasks // job.num_tasks_per_node + cmd += ['-N', str(num_nodes)] + cmd += ['-n', str(job.num_tasks)] return cmd @@ -44,13 +42,11 @@ class UpcxxrunLauncher(JobLauncher): def command(self, job): cmd = ['upcxx-run'] - if job.num_tasks: - if job.num_tasks_per_node: - num_nodes = job.num_tasks // job.num_tasks_per_node - cmd += ['-N', str(num_nodes)] - - cmd += ['-n', str(job.num_tasks)] + if job.num_tasks_per_node: + num_nodes = job.num_tasks // job.num_tasks_per_node + cmd += ['-N', str(num_nodes)] + cmd += ['-n', str(job.num_tasks)] return cmd From f25a4c1813572f000036cc926297ab7b2a3b056b Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Thu, 28 May 2020 21:32:38 +0200 Subject: [PATCH 7/8] Remove serial comma --- reframe/core/buildsystems.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reframe/core/buildsystems.py b/reframe/core/buildsystems.py index efdad7107e..f5a802b7a3 100644 --- a/reframe/core/buildsystems.py +++ b/reframe/core/buildsystems.py @@ -352,7 +352,7 @@ class SingleSource(BuildSystem): #: The automatically detected extensions are the following: #: #: - C: `.c` and `.upc`. - #: - C++: `.cc`, `.cp`, `.cxx`, `.cpp`, `.CPP`, `.c++`, and `.C`. + #: - C++: `.cc`, `.cp`, `.cxx`, `.cpp`, `.CPP`, `.c++` and `.C`. #: - Fortran: `.f`, `.for`, `.ftn`, `.F`, `.FOR`, `.fpp`, `.FPP`, `.FTN`, #: `.f90`, `.f95`, `.f03`, `.f08`, `.F90`, `.F95`, `.F03` and `.F08`. #: - CUDA: `.cu`. From b12613f6ae5b6a01eecaf4748f20456b4b3f960b Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Thu, 28 May 2020 21:46:58 +0200 Subject: [PATCH 8/8] Fix documentation --- docs/config_reference.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/config_reference.rst b/docs/config_reference.rst index e9029f97a1..09ec71b74d 100644 --- a/docs/config_reference.rst +++ b/docs/config_reference.rst @@ -235,8 +235,6 @@ System Partition Configuration This launcher uses the partition’s |access|_ property in order to determine the remote host and any additional options to be passed to the SSH client. The ssh command will be launched in "batch mode," meaning that password-less access to the remote host must be configured. Here is an example configuration for the ssh launcher: - - ``upcrun``: Parallel programs will be launched using the `UPC ` ``upcrun`` command. - - ``upcxx-run``: Parallel programs will be launched using the `UPC++ ` ``upcxx-run`` command. .. code:: python @@ -248,6 +246,9 @@ System Partition Configuration 'environs': ['builtin'], } + - ``upcrun``: Parallel programs will be launched using the `UPC `__ ``upcrun`` command. + - ``upcxx-run``: Parallel programs will be launched using the `UPC++ `__ ``upcxx-run`` command. + .. js:attribute:: .systems[].partitions[].access :required: No