Skip to content
Snippets Groups Projects
Commit e4da6888 authored by Atkins, Charles Vernon's avatar Atkins, Charles Vernon
Browse files

CMake: Include the new experimental FindMPI module

parent 032b763d
No related branches found
No related tags found
1 merge request!267Add upstream FindMPI
#------------------------------------------------------------------------------#
# Distributed under the OSI-approved Apache License, Version 2.0. See
# accompanying file Copyright.txt for details.
#------------------------------------------------------------------------------#
# This module is already included in new versions of CMake
if(CMAKE_VERSION VERSION_LESS 3.10)
include(${CMAKE_CURRENT_LIST_DIR}/upstream/FindMPI.cmake)
else()
include(${CMAKE_ROOT}/Modules/FindMPI.cmake)
endif()
This diff is collapsed.
program mpi_ver
@MPI_Fortran_INCLUDE_LINE@
print *, 'INFO:SUBARRAYS[', MPI_SUBARRAYS_SUPPORTED, ']-ASYNCPROT[', MPI_ASYNC_PROTECTS_NONBLOCKING, ']'
end program mpi_ver
#include <mpi.h>
#ifdef __cplusplus
#include <cstdio>
#else
#include <stdio.h>
#endif
int main(int argc, char* argv[])
{
char mpilibver_str[MPI_MAX_LIBRARY_VERSION_STRING];
int mpilibver_len;
MPI_Get_library_version(mpilibver_str, &mpilibver_len);
#ifdef __cplusplus
std::puts(mpilibver_str);
#else
puts(mpilibver_str);
#endif
}
program mpi_ver
@MPI_Fortran_INCLUDE_LINE@
character(len=MPI_MAX_LIBRARY_VERSION_STRING) :: mpilibver_str
integer(kind=MPI_INTEGER_KIND) :: ierror, reslen
call MPI_GET_LIBRARY_VERSION(mpilibver_str, reslen, ierror)
print *, mpilibver_str
end program mpi_ver
program mpi_ver
@MPI_Fortran_INCLUDE_LINE@
integer(kind=kind(MPI_VERSION)), parameter :: zero = ichar('0')
character, dimension(17), parameter :: mpiver_str =&
(/ 'I', 'N', 'F', 'O', ':', 'M', 'P', 'I', '-', 'V', 'E', 'R', '[', &
char(zero + MPI_VERSION), &
'.', &
char(zero + MPI_SUBVERSION), ']' /)
print *, mpiver_str
end program mpi_ver
#include <mpi.h>
#ifdef __cplusplus
#include <cstdio>
#else
#include <stdio.h>
#endif
#if defined(MPI_VERSION) && defined(MPI_SUBVERSION)
const char mpiver_str[] = { 'I', 'N',
'F', 'O',
':', 'M',
'P', 'I',
'-', 'V',
'E', 'R',
'[', ('0' + MPI_VERSION),
'.', ('0' + MPI_SUBVERSION),
']', '\0' };
#endif
int main(int argc, char* argv[])
{
#if defined(MPI_VERSION) && defined(MPI_SUBVERSION)
#ifdef __cplusplus
std::puts(mpiver_str);
#else
puts(mpiver_str);
#endif
#endif
#ifdef TEST_MPI_MPICXX
MPI::MPI_Init(&argc, &argv);
MPI::MPI_Finalize();
#else
MPI_Init(&argc, &argv);
MPI_Finalize();
#endif
}
#include <mpi.h>
#include <cstdio>
#if defined(MPI_VERSION) && defined(MPI_SUBVERSION)
const char mpiver_str[] = { 'I', 'N',
'F', 'O',
':', 'M',
'P', 'I',
'-', 'V',
'E', 'R',
'[', ('0' + MPI_VERSION),
'.', ('0' + MPI_SUBVERSION),
']', '\0' };
#endif
int main(int argc, char* argv[])
{
#if defined(MPI_VERSION) && defined(MPI_SUBVERSION)
std::puts(mpiver_str);
#endif
MPI::MPI_Init(&argc, &argv);
MPI::MPI_Finalize();
}
program hello
@MPI_Fortran_INCLUDE_LINE@
integer@MPI_Fortran_INTEGER_LINE@ ierror
call MPI_INIT(ierror)
call MPI_FINALIZE(ierror)
end program
#include <mpi.h>
#include <cstdio>
#if defined(MPI_VERSION) && defined(MPI_SUBVERSION)
const char mpiver_str[] = { 'I', 'N',
'F', 'O',
':', 'M',
'P', 'I',
'-', 'V',
'E', 'R',
'[', ('0' + MPI_VERSION),
'.', ('0' + MPI_SUBVERSION),
']', '\0' };
#endif
int main(int argc, char* argv[])
{
#if defined(MPI_VERSION) && defined(MPI_SUBVERSION)
std::puts(mpiver_str);
#endif
MPI_Init(&argc, &argv);
MPI_Finalize();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment