From 3f4c511bca730bf5858dfd7f80bb68c5b44387e7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 16 May 2016 18:39:18 -0400 Subject: [PATCH] update COUPLE example library to be portable across MPI libraries --- examples/COUPLE/library/Makefile.g++ | 6 +++--- examples/COUPLE/library/error.cpp | 6 +++--- examples/COUPLE/library/error.h | 2 +- examples/COUPLE/library/files.cpp | 4 ++-- examples/COUPLE/library/files.h | 3 +++ examples/COUPLE/library/irregular.h | 2 +- examples/COUPLE/library/lammps_data_write.cpp | 5 +++-- examples/COUPLE/library/lammps_data_write.h | 2 +- examples/COUPLE/library/many2many.cpp | 4 +++- examples/COUPLE/library/many2many.h | 2 +- examples/COUPLE/library/many2one.h | 2 +- examples/COUPLE/library/memory.cpp | 6 +++--- examples/COUPLE/library/memory.h | 2 +- examples/COUPLE/library/one2many.cpp | 3 ++- examples/COUPLE/library/one2many.h | 2 +- examples/COUPLE/library/send2one.h | 2 +- 16 files changed, 30 insertions(+), 23 deletions(-) diff --git a/examples/COUPLE/library/Makefile.g++ b/examples/COUPLE/library/Makefile.g++ index 07e5807680..62e82c695b 100644 --- a/examples/COUPLE/library/Makefile.g++ +++ b/examples/COUPLE/library/Makefile.g++ @@ -4,10 +4,10 @@ SHELL = /bin/sh # System-specific settings -CC = g++ -CCFLAGS = -g -O -DMPICH_IGNORE_CXX_SEEK +CC = mpicxx +CCFLAGS = -g -O -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 DEPFLAGS = -M -LINK = g++ +LINK = mpicxx LINKFLAGS = -g -O ARCHIVE = ar ARFLAGS = -rc diff --git a/examples/COUPLE/library/error.cpp b/examples/COUPLE/library/error.cpp index c70ec26f93..f538dce23f 100644 --- a/examples/COUPLE/library/error.cpp +++ b/examples/COUPLE/library/error.cpp @@ -1,6 +1,6 @@ -#include "mpi.h" -#include "stdlib.h" -#include "stdio.h" +#include +#include +#include #include "error.h" /* ---------------------------------------------------------------------- */ diff --git a/examples/COUPLE/library/error.h b/examples/COUPLE/library/error.h index f62f620585..517ed2fb76 100644 --- a/examples/COUPLE/library/error.h +++ b/examples/COUPLE/library/error.h @@ -1,7 +1,7 @@ #ifndef ERROR_H #define ERROR_H -#include "mpi.h" +#include class Error { public: diff --git a/examples/COUPLE/library/files.cpp b/examples/COUPLE/library/files.cpp index 83464deb32..0d98e69a9e 100644 --- a/examples/COUPLE/library/files.cpp +++ b/examples/COUPLE/library/files.cpp @@ -1,5 +1,5 @@ -#include "stdio.h" -#include "string.h" +#include +#include #include "files.h" #define MAXLINE 256 diff --git a/examples/COUPLE/library/files.h b/examples/COUPLE/library/files.h index 75812d2991..c82ae70dc0 100644 --- a/examples/COUPLE/library/files.h +++ b/examples/COUPLE/library/files.h @@ -1,2 +1,5 @@ +#ifndef FILES_H +#define FILES_H void replace(char *, char *, int, char **); char **extract(char *, char *, int, char **); +#endif diff --git a/examples/COUPLE/library/irregular.h b/examples/COUPLE/library/irregular.h index ea649533ae..13c4896b27 100644 --- a/examples/COUPLE/library/irregular.h +++ b/examples/COUPLE/library/irregular.h @@ -1,7 +1,7 @@ #ifndef IRREGULAR_H #define IRREGULAR_H -#include "mpi.h" +#include class Irregular { public: diff --git a/examples/COUPLE/library/lammps_data_write.cpp b/examples/COUPLE/library/lammps_data_write.cpp index 7490537ee5..cb525871e2 100644 --- a/examples/COUPLE/library/lammps_data_write.cpp +++ b/examples/COUPLE/library/lammps_data_write.cpp @@ -1,5 +1,6 @@ -#include "stdlib.h" -#include "string.h" +#include +#include +#include #include "lammps_data_write.h" #include "memory.h" #include "error.h" diff --git a/examples/COUPLE/library/lammps_data_write.h b/examples/COUPLE/library/lammps_data_write.h index 5eda0f4044..9a6de2b63c 100644 --- a/examples/COUPLE/library/lammps_data_write.h +++ b/examples/COUPLE/library/lammps_data_write.h @@ -1,8 +1,8 @@ #ifndef LAMMPS_DATA_WRITE_H #define LAMMPS_DATA_WRITE_H +#include #include "send2one.h" -#include "stdio.h" class LAMMPSDataWrite : public Send2One { public: diff --git a/examples/COUPLE/library/many2many.cpp b/examples/COUPLE/library/many2many.cpp index 69ed866013..3ca9ca63bb 100644 --- a/examples/COUPLE/library/many2many.cpp +++ b/examples/COUPLE/library/many2many.cpp @@ -1,4 +1,6 @@ -#include "mpi.h" +#include +#include +#include #include "many2many.h" #include "irregular.h" #include "memory.h" diff --git a/examples/COUPLE/library/many2many.h b/examples/COUPLE/library/many2many.h index a0c4a2b4db..d372dc82bb 100644 --- a/examples/COUPLE/library/many2many.h +++ b/examples/COUPLE/library/many2many.h @@ -1,7 +1,7 @@ #ifndef MANY2MANY_H #define MANY2MANY_H -#include "mpi.h" +#include class Many2Many { public: diff --git a/examples/COUPLE/library/many2one.h b/examples/COUPLE/library/many2one.h index 7e487ec473..36642b38ad 100644 --- a/examples/COUPLE/library/many2one.h +++ b/examples/COUPLE/library/many2one.h @@ -1,7 +1,7 @@ #ifndef MANY2ONE_H #define MANY2ONE_H -#include "mpi.h" +#include class Many2One { public: diff --git a/examples/COUPLE/library/memory.cpp b/examples/COUPLE/library/memory.cpp index 7377fac744..9d299a8376 100644 --- a/examples/COUPLE/library/memory.cpp +++ b/examples/COUPLE/library/memory.cpp @@ -1,6 +1,6 @@ -#include "mpi.h" -#include "stdlib.h" -#include "stdio.h" +#include +#include +#include #include "memory.h" #include "error.h" diff --git a/examples/COUPLE/library/memory.h b/examples/COUPLE/library/memory.h index d6efa7789e..31ce31bd17 100644 --- a/examples/COUPLE/library/memory.h +++ b/examples/COUPLE/library/memory.h @@ -1,7 +1,7 @@ #ifndef MEMORY_H #define MEMORY_H -#include "mpi.h" +#include class Memory { public: diff --git a/examples/COUPLE/library/one2many.cpp b/examples/COUPLE/library/one2many.cpp index e26bf7086f..5c4a1799ba 100644 --- a/examples/COUPLE/library/one2many.cpp +++ b/examples/COUPLE/library/one2many.cpp @@ -1,4 +1,5 @@ -#include "mpi.h" +#include +#include #include "one2many.h" #include "memory.h" diff --git a/examples/COUPLE/library/one2many.h b/examples/COUPLE/library/one2many.h index 9797866112..a854d78344 100644 --- a/examples/COUPLE/library/one2many.h +++ b/examples/COUPLE/library/one2many.h @@ -1,7 +1,7 @@ #ifndef ONE2MANY_H #define ONE2MANY_H -#include "mpi.h" +#include #include diff --git a/examples/COUPLE/library/send2one.h b/examples/COUPLE/library/send2one.h index df25b5fb70..78af625938 100644 --- a/examples/COUPLE/library/send2one.h +++ b/examples/COUPLE/library/send2one.h @@ -1,7 +1,7 @@ #ifndef SEND2ONE_H #define SEND2ONE_H -#include "mpi.h" +#include class Send2One { public: