commit
a19f906258
12 changed files with 356 additions and 4 deletions
@ -0,0 +1,27 @@ |
||||
#include <stdio.h> |
||||
#include <mpi.h> |
||||
|
||||
int main(int argc, char **argv) |
||||
{ |
||||
int ier, flag; |
||||
ier = MPI_Init(&argc, &argv); |
||||
if (ier) { |
||||
printf("Unable to initialize MPI: %d\n", ier); |
||||
return 1; |
||||
} |
||||
ier = MPI_Initialized(&flag); |
||||
if (ier) { |
||||
printf("Unable to check MPI initialization state: %d\n", ier); |
||||
return 1; |
||||
} |
||||
if (!flag) { |
||||
printf("MPI did not initialize!\n"); |
||||
return 1; |
||||
} |
||||
ier = MPI_Finalize(); |
||||
if (ier) { |
||||
printf("Unable to finalize MPI: %d\n", ier); |
||||
return 1; |
||||
} |
||||
return 0; |
||||
} |
@ -0,0 +1,11 @@ |
||||
#include <mpi.h> |
||||
|
||||
int main(int argc, char **argv) |
||||
{ |
||||
MPI::Init(argc, argv); |
||||
if (!MPI::Is_initialized()) { |
||||
printf("MPI did not initialize!\n"); |
||||
return 1; |
||||
} |
||||
MPI::Finalize(); |
||||
} |
@ -0,0 +1,21 @@ |
||||
program mpitest |
||||
implicit none |
||||
include 'mpif.h' |
||||
logical :: flag |
||||
integer :: ier |
||||
call MPI_Init(ier) |
||||
if (ier /= 0) then |
||||
print *, 'Unable to initialize MPI: ', ier |
||||
stop 1 |
||||
endif |
||||
call MPI_Initialized(flag, ier) |
||||
if (ier /= 0) then |
||||
print *, 'Unable to check MPI initialization state: ', ier |
||||
stop 1 |
||||
endif |
||||
call MPI_Finalize(ier) |
||||
if (ier /= 0) then |
||||
print *, 'Unable to finalize MPI: ', ier |
||||
stop 1 |
||||
endif |
||||
end program mpitest |
@ -0,0 +1,33 @@ |
||||
project('mpi', 'c', 'cpp') |
||||
|
||||
cc = meson.get_compiler('c') |
||||
|
||||
if build_machine.system() == 'windows' and cc.get_id() != 'msvc' |
||||
error('MESON_SKIP_TEST: MPI not available on Windows without MSVC.') |
||||
endif |
||||
|
||||
mpic = dependency('mpi', language : 'c') |
||||
exec = executable('exec', |
||||
'main.c', |
||||
dependencies : [mpic]) |
||||
|
||||
test('MPI C', exec) |
||||
|
||||
if build_machine.system() != 'windows' |
||||
# C++ MPI not supported by MS-MPI used on AppVeyor. |
||||
mpicpp = dependency('mpi', language : 'cpp') |
||||
execpp = executable('execpp', |
||||
'main.cpp', |
||||
dependencies : [mpicpp]) |
||||
|
||||
test('MPI C++', execpp) |
||||
endif |
||||
|
||||
if add_languages('fortran', required : false) |
||||
mpifort = dependency('mpi', language : 'fortran') |
||||
exef = executable('exef', |
||||
'main.f90', |
||||
dependencies : [mpifort]) |
||||
|
||||
test('MPI Fortran', exef) |
||||
endif |
Loading…
Reference in new issue