Revision: 54890
http://brlcad.svn.sourceforge.net/brlcad/?rev=54890&view=rev
Author: brlcad
Date: 2013-03-26 20:38:03 +0000 (Tue, 26 Mar 2013)
Log Message:
-----------
bu_set_affinity() doesn't need to be public API if we call it on all
bu_parallel() threads for the user. it becomes an implementation detail.
rename to parallel_set_affinity(), update accordingly to depublish, and add to
old build.
Modified Paths:
--------------
brlcad/trunk/include/bu.h
brlcad/trunk/src/libbu/CMakeLists.txt
brlcad/trunk/src/libbu/Makefile.am
brlcad/trunk/src/libbu/affinity.c
brlcad/trunk/src/libbu/parallel.c
Added Paths:
-----------
brlcad/trunk/src/libbu/parallel.h
Modified: brlcad/trunk/include/bu.h
===================================================================
--- brlcad/trunk/include/bu.h 2013-03-26 20:26:56 UTC (rev 54889)
+++ brlcad/trunk/include/bu.h 2013-03-26 20:38:03 UTC (rev 54890)
@@ -432,20 +432,6 @@
/*----------------------------------------------------------------------*/
-/**
- * Set affinity mask of current thread to the CPU set it is currently
- * running on. If it is not running on any CPUs in the set, it is
- * migrated to CPU 0 by default.
- *
- * Return:
- * 0 on Suceess
- * -1 on Failure
- *
- */
-BU_EXPORT extern int bu_set_affinity(void);
-
-/*----------------------------------------------------------------------*/
-
/** @addtogroup conv */
/** @ingroup data */
/** @{*/
Modified: brlcad/trunk/src/libbu/CMakeLists.txt
===================================================================
--- brlcad/trunk/src/libbu/CMakeLists.txt 2013-03-26 20:26:56 UTC (rev
54889)
+++ brlcad/trunk/src/libbu/CMakeLists.txt 2013-03-26 20:38:03 UTC (rev
54890)
@@ -105,6 +105,7 @@
add_subdirectory(tests)
set(bu_ignore_files
+ parallel.h
rb_internals.h
uce-dirent.h
vls_internals.h
Modified: brlcad/trunk/src/libbu/Makefile.am
===================================================================
--- brlcad/trunk/src/libbu/Makefile.am 2013-03-26 20:26:56 UTC (rev 54889)
+++ brlcad/trunk/src/libbu/Makefile.am 2013-03-26 20:38:03 UTC (rev 54890)
@@ -3,6 +3,7 @@
noinst_LTLIBRARIES = libbu_nil.la
libbu_nil_la_SOURCES = \
+ affinity.c \
argv.c \
avs.c \
backtrace.c \
@@ -91,6 +92,7 @@
${BU_LIBS}
noinst_HEADERS = \
+ parallel.h \
rb_internals.h \
vls_internals.h
Modified: brlcad/trunk/src/libbu/affinity.c
===================================================================
--- brlcad/trunk/src/libbu/affinity.c 2013-03-26 20:26:56 UTC (rev 54889)
+++ brlcad/trunk/src/libbu/affinity.c 2013-03-26 20:38:03 UTC (rev 54890)
@@ -29,7 +29,7 @@
int
-bu_set_affinity(void)
+parallel_set_affinity(void)
{
#if defined(_GNU_SOURCE) && defined(HAVE_PTHREAD_H)
Modified: brlcad/trunk/src/libbu/parallel.c
===================================================================
--- brlcad/trunk/src/libbu/parallel.c 2013-03-26 20:26:56 UTC (rev 54889)
+++ brlcad/trunk/src/libbu/parallel.c 2013-03-26 20:38:03 UTC (rev 54890)
@@ -156,7 +156,9 @@
#include "bu.h"
+#include "./parallel.h"
+
#ifdef CRAY
static struct taskcontrol {
int tsk_len;
@@ -577,7 +579,7 @@
HIDDEN void
parallel_interface_arg(struct thread_data *user_thread_data)
{
- bu_set_affinity();
+ parallel_set_affinity();
(*((*user_thread_data).user_func))((*user_thread_data).cpu_id,
(*user_thread_data).user_arg);
}
@@ -599,7 +601,7 @@
{
struct thread_data user_thread_data_pi;
- bu_set_affinity();
+ parallel_set_affinity();
user_thread_data_pi.user_func = parallel_func;
user_thread_data_pi.user_arg = parallel_arg;
Added: brlcad/trunk/src/libbu/parallel.h
===================================================================
--- brlcad/trunk/src/libbu/parallel.h (rev 0)
+++ brlcad/trunk/src/libbu/parallel.h 2013-03-26 20:38:03 UTC (rev 54890)
@@ -0,0 +1,45 @@
+/* P A R A L L E L . H
+ * BRL-CAD
+ *
+ * Copyright (c) 2013 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+
+#include "bu.h"
+
+/**
+ * Set affinity mask of current thread to the CPU set it is currently
+ * running on. If it is not running on any CPUs in the set, it is
+ * migrated to CPU 0 by default.
+ *
+ * Return:
+ * 0 on Suceess
+ * -1 on Failure
+ *
+ */
+extern int parallel_set_affinity(void);
+
+
+
+/*
+ * Local Variables:
+ * mode: C
+ * tab-width: 8
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */
Property changes on: brlcad/trunk/src/libbu/parallel.h
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits