[Debian-astro-commits] [gyoto] 57/221: Add yorick/check-mpi.i

Thibaut Jean-Claude Paumard thibaut at moszumanska.debian.org
Fri May 22 20:52:33 UTC 2015


This is an automated email from the git hooks/post-receive script.

thibaut pushed a commit to branch master
in repository gyoto.

commit 25a54daaaeb49d8ab96f972e7a8921424f44ae64
Author: Thibaut Paumard <paumard at users.sourceforge.net>
Date:   Wed Oct 15 16:23:17 2014 +0200

    Add yorick/check-mpi.i
---
 yorick/check-mpi.i | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 yorick/check.i     |  1 +
 2 files changed, 99 insertions(+)

diff --git a/yorick/check-mpi.i b/yorick/check-mpi.i
new file mode 100644
index 0000000..ee3226b
--- /dev/null
+++ b/yorick/check-mpi.i
@@ -0,0 +1,98 @@
+/*
+    Copyright 2014 Thibaut Paumard
+
+    This file is part of Gyoto.
+
+    Gyoto is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    Gyoto is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Gyoto.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "check-helpers.i"
+restore, gyoto;
+
+begin_section, "MPI functionalities";
+
+doing, "Checking whether MPI is built-in";
+have_mpi=haveMPI();
+output, (have_mpi?" yes":" no");
+
+doing, "Calling MPI_Initiliazed";
+if (mpiInitialized()) error, "MPI should not be initialized yet";
+done;
+
+doing, "Calling MPI_Init";
+if (mpiInit() && have_mpi) error, "MPI INIT FAILED";
+done;
+
+doing, "Calling MPI_Initiliazed again";
+inited=mpiInitialized();
+if (have_mpi && !inited) error, "MPI should be initialized by now";
+if (!have_mpi && inited) error, "MPI should not be initializable";
+done;
+
+doing, "Reading Scenery";
+sc = Scenery("../doc/examples/example-complex-astrobj.xml");
+done;
+
+doing, "Spawning workers";
+sc, mpispawn=4;
+done;
+
+doing, "Sending Scenery to the workers";
+sc, mpiclone=;
+done;
+
+doing, "Ray-tracing with MPI";
+data=sc();
+done;
+
+doing, "Terminating workers";
+sc, mpispawn=0;
+done;
+
+doing, "Integrating Scenery without MPI";
+sc, nthreads=4;
+data2=sc();
+done;
+
+doing, "Comparing results";
+diff=data-data2;
+ind=where(data);
+diff(ind)/=data(ind);
+mdiff=max(abs(diff));
+if (mdiff > 1e-6) error, "Results differ";
+output, " OK (max rel. dif.: "+pr1(mdiff)+")";
+
+doing, "Deleting Scenery";
+sc=[];
+done;
+
+doing, "Calling MPI_Finalized";
+if (mpiFinalized()) error, "MPI should not be finalized yet";
+done;
+
+doing, "Calling MPI_Finalize";
+if (mpiFinalize() && have_mpi) error, "MPI FINALIZE FAILED";
+done;
+
+doing, "Calling MPI_Finalized again";
+finited=mpiFinalized();
+if (have_mpi && !finited) error, "MPI should be finalized by now";
+if (!have_mpi && finited) error, "MPI should not be finalizable";
+done;
+
+doing, "Cleaning";
+data=data2=have_mpi=mdiff=diff=inited=finited=[];
+done;
+
+end_section, "MPI functionalities";
diff --git a/yorick/check.i b/yorick/check.i
index 832c61c..213d7a8 100644
--- a/yorick/check.i
+++ b/yorick/check.i
@@ -160,6 +160,7 @@ end_section, "basic functionality";
 #include "check-directionaldisk.i"
 //#include "check-disk3d.i"
 #include "check-polish-doughnut.i"
+#include "check-mpi.i"
 
 write, format="\n\n%s\n%s\n%s\n",
   "  ********************************************",

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/gyoto.git



More information about the Debian-astro-commits mailing list