Skip to content
Snippets Groups Projects
Commit 9e39be4b authored by Sergey Kosukhin's avatar Sergey Kosukhin
Browse files

Generate source file for 'test_resource_copy_mpi'.

parent b225216e
No related branches found
No related tags found
2 merge requests!34Version 2.2.0,!13Consolidation with CDI-PIO (develop)
......@@ -160,6 +160,8 @@ test_month_adjust_SOURCES = test_month_adjust.c
test_resource_copy_SOURCES = test_resource_copy.c
test_resource_copy_LDADD = $(top_builddir)/src/libcdiresunpack.la
nodist_test_resource_copy_mpi_SOURCES = test_resource_copy.parallel.c
test_resource_copy_mpi_LDADD = $(top_builddir)/src/libcdipio.la $(PPM_CORE_C_LIB) $(YAXT_C_LIB)
test_table_SOURCES = test_table.c
......@@ -170,9 +172,6 @@ test_cdf_write_SOURCES = \
simple_model_helper.h \
test_cdf_write.c
test_resource_copy_mpi_SOURCES = test_resource_copy_mpi.c
test_resource_copy_mpi_LDADD = $(top_builddir)/src/libcdipio.la $(PPM_CORE_C_LIB) $(YAXT_C_LIB)
clean-local:
-rm -f *.parallel.c
-rm -f *.grb *.grb2 *.nc *.nc2 *.nc4 *.srv *.ext *.cksum *.ieg *.stderr *.stdout
......
......@@ -12,7 +12,7 @@
#include "resource_handle.h"
#include "resource_unpack.h"
#ifdef MPI_MARSHALLING
#ifdef USE_MPI
#include <mpi.h>
#include "cdipio.h"
#include "pio_serialize.h"
......@@ -191,7 +191,7 @@ modelRun(MPI_Comm comm)
char *recvBuffer, *sendBuffer;
int bufferSize;
#ifdef MPI_MARSHALLING
#ifdef USE_MPI
cdiPioSerializeSetMPI();
#endif
......@@ -203,7 +203,7 @@ modelRun(MPI_Comm comm)
struct idPair temp = defineVlist(gridID, zaxisID, taxisID);
int vlistID = temp.id1;
#ifdef MPI_MARSHALLING
#ifdef USE_MPI
int streamID = streamOpenWrite("example_resource_copy_mpi.grb", CDI_FILETYPE_GRB);
#else
int streamID = streamOpenWrite("example_resource_copy.grb", CDI_FILETYPE_GRB);
......@@ -215,7 +215,7 @@ modelRun(MPI_Comm comm)
reshPackBufferCreate(&sendBuffer, &bufferSize, &comm);
recvBuffer = (char *) malloc((size_t) bufferSize);
#ifdef MPI_MARSHALLING
#ifdef USE_MPI
xmpi(MPI_Sendrecv(sendBuffer, bufferSize, MPI_PACKED, 0, 0, recvBuffer, bufferSize, MPI_PACKED, 0, 0, MPI_COMM_SELF,
MPI_STATUS_IGNORE));
#else
......@@ -238,7 +238,7 @@ main(int argc, char *argv[])
{
int exitCode = 77;
MPI_Comm commModel;
#ifdef MPI_MARSHALLING
#ifdef USE_MPI
MPI_Init(&argc, &argv);
commModel = MPI_COMM_WORLD;
#else
......@@ -250,7 +250,7 @@ main(int argc, char *argv[])
exitCode = modelRun(commModel);
#ifdef MPI_MARSHALLING
#ifdef USE_MPI
xmpi(MPI_Finalize());
#endif
......
#define MPI_MARSHALLING
#include "test_resource_copy.c"
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