1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
/*
* Copyright (C) by Argonne National Laboratory
* See COPYRIGHT in top-level directory
*/
#include "mpi.h"
#include "mpitestconf.h"
#ifdef HAVE_IOSTREAM
// Not all C++ compilers have iostream instead of iostream.h
#include <iostream>
#ifdef HAVE_NAMESPACE_STD
// Those that do often need the std namespace; otherwise, a bare "cout"
// is likely to fail to compile
using namespace std;
#endif
#else
#include <iostream.h>
#endif
#include "mpitestcxx.h"
int main(int argc, char *argv[])
{
int errs = 0;
bool flag;
int provided, claimed;
provided = MPI::Init_thread(MPI::THREAD_MULTIPLE);
flag = MPI::Is_thread_main();
if (!flag) {
errs++;
cout << "This thread call init_thread but Is_thread_main gave false\n";
}
claimed = MPI::Query_thread();
if (claimed != provided) {
errs++;
cout << "Query thread gave thread level " << claimed <<
" but Init_thread gave " << provided << "\n";
}
MTest_Finalize(errs);
return 0;
}
|