Skip to content

Commit

Permalink
use more inclusive terms in the code
Browse files Browse the repository at this point in the history
Specifically, this patch makes the following changes.
build scripts:
- master_top_srcdir -> main_top_srcdir
Git:
- "master" -> "main" branch (variable names and comments)
global structures and variables:
- MPIR_ThreadInfo.master_thread -> MPIR_ThreadInfo.main_thread
- struct PMIMaster -> struct PMIMain
- PMI2_Connect_comm_t.isMaster -> PMI2_Connect_comm_t.isMain
names of tests:
- spawntest_master -> spawntest_parent
- taskmaster -> taskmanager
- th_taskmaster -> th_taskmanager`
comments and names of temporary/local variables:
- master -> main, parent, server, ...
- slave -> child, worker, client, ...
  • Loading branch information
shintaro-iwasaki committed Jun 30, 2020
1 parent 4e850aa commit 5ef6367
Show file tree
Hide file tree
Showing 94 changed files with 328 additions and 329 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ agreement. http://www.mpich.org/documentation/contributor-docs/
standards. https://wiki.mpich.org/mpich/index.php/Coding_Standards

3. Use the git pre-commit hook included with MPICH
(https://github.com/pmodels/mpich/blob/master/maint/hooks/pre-commit)
(mpich_root/maint/hooks/pre-commit)
to catch whitespace violations in new code. Patches with improper
whitespace may be automatically rejected for inclusion in MPICH. To
activate the pre-commit hook (from the top-level of your working
Expand Down
2 changes: 1 addition & 1 deletion confdb/aclocal_bugfix.m4
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ else
# come up with (see tt#1007) [goodell@]
AS_CASE(["$INSTALL"],
[/*],[:],
[*install-sh*],[INSTALL="$master_top_srcdir/$INSTALL"])
[*install-sh*],[INSTALL="$main_top_srcdir/$INSTALL"])
# Check that this install really works
rm -f conftest
Expand Down
8 changes: 4 additions & 4 deletions confdb/aclocal_shl.m4
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,11 @@ AC_DEFUN([PAC_CC_SUBDIR_SHLIBS],[
if test -z "$LIBTOOL" ; then
AC_MSG_WARN([libtool selected for shared library support but LIBTOOL is not defined])
fi
# Libtool needs master_top_builddir
if test "X$master_top_builddir" = "X" ; then
AC_MSG_ERROR([Libtool requires master_top_builddir - check configure.ac sources])
# Libtool needs main_top_builddir
if test "X$main_top_builddir" = "X" ; then
AC_MSG_ERROR([Libtool requires main_top_builddir - check configure.ac sources])
fi
AC_SUBST(master_top_builddir)
AC_SUBST(main_top_builddir)
fi
])

Expand Down
46 changes: 23 additions & 23 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -786,28 +786,28 @@ if test -z "$top_srcdir" ; then
else
use_top_srcdir=$top_srcdir
fi
if test -z "$master_top_srcdir" ; then
if test -z "$main_top_srcdir" ; then
# This needs to be an absolute pathname
case "$use_top_srcdir" in
/*) ;;
*)
use_top_srcdir=`(cd $use_top_srcdir && pwd)`
;;
esac
master_top_srcdir=$use_top_srcdir
main_top_srcdir=$use_top_srcdir
fi
# Get the directory that we're running in...
if test -z "$master_top_builddir" ; then
master_top_builddir="`pwd`"
if test -z "$main_top_builddir" ; then
main_top_builddir="`pwd`"
fi
AC_SUBST(master_top_builddir)
AC_SUBST(master_top_srcdir)
export master_top_builddir
export master_top_srcdir
AC_SUBST(main_top_builddir)
AC_SUBST(main_top_srcdir)
export main_top_builddir
export main_top_srcdir

if test -z "$with_cross"; then
if test -f "$master_top_srcdir/src/cross/$host_alias"; then
with_cross="$master_top_srcdir/src/cross/$host_alias"
if test -f "$main_top_srcdir/src/cross/$host_alias"; then
with_cross="$main_top_srcdir/src/cross/$host_alias"
else
with_cross=no
fi
Expand Down Expand Up @@ -1026,7 +1026,7 @@ if test "$with_mpl_prefix" = "embedded" ; then
# no need for libtool versioning when embedding MPL
mpl_subdir_args="--disable-versioning --enable-embedded"
PAC_CONFIG_SUBDIR_ARGS([src/mpl],[$mpl_subdir_args],[],[AC_MSG_ERROR(MPL configure failed)])
PAC_APPEND_FLAG([-I${master_top_builddir}/src/mpl/include], [CPPFLAGS])
PAC_APPEND_FLAG([-I${main_top_builddir}/src/mpl/include], [CPPFLAGS])
PAC_APPEND_FLAG([-I${use_top_srcdir}/src/mpl/include], [CPPFLAGS])

mplsrcdir="src/mpl"
Expand Down Expand Up @@ -1075,10 +1075,10 @@ if test "$enable_izem_queue" != "no" && test "$enable_izem_queue" != "none"; the
if test -e "${use_top_srcdir}/modules/izem" ; then
zm_subdir_args="--enable-embedded"
PAC_CONFIG_SUBDIR_ARGS([modules/izem],[$zm_subdir_args],[],[AC_MSG_ERROR(Izem configure failed)])
zmsrcdir="${master_top_builddir}/modules/izem"
zmlib="${master_top_builddir}/modules/izem/src/lib${ZMLIBNAME}.la"
zmsrcdir="${main_top_builddir}/modules/izem"
zmlib="${main_top_builddir}/modules/izem/src/lib${ZMLIBNAME}.la"
PAC_APPEND_FLAG([-I${use_top_srcdir}/modules/izem/src/include],[CPPFLAGS])
PAC_APPEND_FLAG([-I${master_top_builddir}/modules/izem/src/include],[CPPFLAGS])
PAC_APPEND_FLAG([-I${main_top_builddir}/modules/izem/src/include],[CPPFLAGS])
else
AC_MSG_WARN([Attempted to use the embedded Izem source tree in "modules/izem", but it is missing. Configuration or compilation may fail later.])
fi
Expand Down Expand Up @@ -1149,7 +1149,7 @@ if test "$with_yaksa_prefix" = "embedded" ; then
# no need for libtool versioning when embedding YAKSA
yaksa_subdir_args="--enable-embedded"
PAC_CONFIG_SUBDIR_ARGS([modules/yaksa],[$yaksa_subdir_args],[],[AC_MSG_ERROR(YAKSA configure failed)])
PAC_APPEND_FLAG([-I${master_top_builddir}/modules/yaksa/src/frontend/include], [CPPFLAGS])
PAC_APPEND_FLAG([-I${main_top_builddir}/modules/yaksa/src/frontend/include], [CPPFLAGS])
PAC_APPEND_FLAG([-I${use_top_srcdir}/modules/yaksa/src/frontend/include], [CPPFLAGS])

yaksasrcdir="modules/yaksa"
Expand Down Expand Up @@ -1202,10 +1202,10 @@ PAC_PUSH_ALL_FLAGS()
PAC_RESET_ALL_FLAGS()
PAC_CONFIG_SUBDIR_ARGS([modules/json-c],[--disable-werror],[],[AC_MSG_ERROR(json-c configure failed)])
PAC_POP_ALL_FLAGS()
jsonsrcdir="${master_top_builddir}/modules/json-c"
jsonlib="${master_top_builddir}/modules/json-c/libjson-c.la"
jsonsrcdir="${main_top_builddir}/modules/json-c"
jsonlib="${main_top_builddir}/modules/json-c/libjson-c.la"
PAC_APPEND_FLAG([-I${use_top_srcdir}/modules/json-c],[CPPFLAGS])
PAC_APPEND_FLAG([-I${master_top_builddir}/modules/json-c],[CPPFLAGS])
PAC_APPEND_FLAG([-I${main_top_builddir}/modules/json-c],[CPPFLAGS])

# ----------------------------------------------------------------------------
# HWLOC
Expand Down Expand Up @@ -1597,7 +1597,7 @@ if test "$enable_romio" = "yes" ; then
# This ought to be sufficient, but there is also a symlink setup in
# src/include to accomodate current mpicc limitations. See
# src/mpi/Makefile.mk for more info.
PAC_APPEND_FLAG([-I${master_top_builddir}/src/mpi/romio/include],[CPPFLAGS])
PAC_APPEND_FLAG([-I${main_top_builddir}/src/mpi/romio/include],[CPPFLAGS])

# Set environment variables that the romio configure expects
export use_top_srcdir
Expand Down Expand Up @@ -2200,7 +2200,7 @@ if test "$has_fort_real8" = "yes" ; then
cp src/include/mpif.h src/binding/fortran/mpif_h/mpif.h
fi
fi],
master_top_srcdir=$master_top_srcdir
main_top_srcdir=$main_top_srcdir
enable_f77=$enable_f77
enable_fc=$enable_fc
has_exclaim=$has_exclaim
Expand Down Expand Up @@ -3425,7 +3425,7 @@ export MPIX_C_FLOAT16
#
# ----------------------------------------------------------------------------
if test "$enable_f77" = yes ; then
# Up to size checking code in master configure.ac (where it tries to
# Up to size checking code in main configure.ac (where it tries to
# find the matching C sizes) as part of defining mpi_integer8 etc.
# The results are available in pac_cv_sizeof_f77_<type>
# Size is 0 if unknown or unavailable (or cross-compiling)
Expand Down Expand Up @@ -3954,7 +3954,7 @@ dnl Removed MPI_2COMPLEX and MPI_2DOUBLE_COMPLEX, leaving comments to explain th
# interface (was error)
# Check to see if the f77 binding has enabled the code to support
# the case of int != fint.
if grep HAVE_FINT_IS_INT $master_top_srcdir/src/binding/fortran/mpif_h/testf.c 2>&1 1>/dev/null ; then
if grep HAVE_FINT_IS_INT $main_top_srcdir/src/binding/fortran/mpif_h/testf.c 2>&1 1>/dev/null ; then
AC_MSG_WARN([Fortran integers and C ints are not the same size. Support for this case is experimental; use at your own risk])
else
AC_MSG_ERROR([Fortran integers and C ints are not the same size. The current Fortran binding does not support this case. Either force the Fortran compiler to use integers of $ac_cv_sizeof_int bytes, or use --disable-fortran on the configure line for MPICH.])
Expand Down Expand Up @@ -4728,7 +4728,7 @@ typedef struct MPIR_Comm MPIR_Comm;
#include <stdint.h>
#endif
#include "${master_top_srcdir}/src/include/mpir_bsend.h"]
#include "${main_top_srcdir}/src/include/mpir_bsend.h"]
)
if test "$ac_cv_sizeof_MPII_Bsend_data_t" = "0" ; then
AC_MSG_ERROR([Unable to determine the size of MPI_BSEND_OVERHEAD])
Expand Down
2 changes: 1 addition & 1 deletion doc/installguide/install.tex.vin
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ can be specified. Do
\end{verbatim}
for details. A typical example is:
\begin{verbatim}
mpiexec -f machinefile -n 1 ./master : -n 19 ./slave
mpiexec -f machinefile -n 1 ./main : -n 19 ./child
\end{verbatim}
to ensure that the process with rank 0 runs on your workstation.

Expand Down
40 changes: 20 additions & 20 deletions examples/pmandel_spaserv.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define MAX(x, y) (((x) > (y))?(x):(y))
#endif

#define DEFAULT_NUM_SLAVES 3 /* default number of children to spawn */
#define DEFAULT_NUM_CHILDREN 3 /* default number of children to spawn */
#define DEFAULT_PORT 7470 /* default port to listen on */
#define NOVALUE 99999 /* indicates a parameter is as of yet unspecified */
#define MAX_ITERATIONS 10000 /* maximum 'depth' to look for mandelbrot value */
Expand Down Expand Up @@ -160,8 +160,8 @@ int main(int argc, char *argv[])
color_t *colors = NULL;
MPI_Status status;
int save_image = 0;
int num_children = DEFAULT_NUM_SLAVES;
int master = 1;
int num_children = DEFAULT_NUM_CHILDREN;
int parent = 1;
MPI_Comm parent, *child_comm = NULL;
MPI_Request *child_request = NULL;
int error_code, error;
Expand All @@ -179,15 +179,15 @@ int main(int argc, char *argv[])

if (parent == MPI_COMM_NULL) {
if (numprocs > 1) {
printf("Error: only one process allowed for the master.\n");
printf("Error: only one process allowed for the parent.\n");
PrintUsage();
error_code = MPI_Abort(MPI_COMM_WORLD, -1);
exit(error_code);
}

printf("Welcome to the Mandelbrot/Julia set explorer.\n");

master = 1;
parent = 1;

/* Get inputs-- region to view (must be within x/ymin to x/ymax, make sure
* xmax>xmin and ymax>ymin) and resolution (number of pixels along an edge,
Expand All @@ -205,18 +205,18 @@ int main(int argc, char *argv[])
if (julia == 1) /* we're doing a julia figure */
check_julia_params(&julia_constant.real, &julia_constant.imaginary);

/* spawn slaves */
/* spawn children */
child_comm = (MPI_Comm *) malloc(num_children * sizeof(MPI_Comm));
child_request = (MPI_Request *) malloc(num_children * sizeof(MPI_Request));
result = (header_t *) malloc(num_children * sizeof(header_t));
if (child_comm == NULL || child_request == NULL || result == NULL) {
printf
("Error: unable to allocate an array of %d communicators, requests and work objects for the slaves.\n",
("Error: unable to allocate an array of %d communicators, requests and work objects for the children.\n",
num_children);
error_code = MPI_Abort(MPI_COMM_WORLD, -1);
exit(error_code);
}
printf("Spawning %d slaves.\n", num_children);
printf("Spawning %d children.\n", num_children);
for (i = 0; i < num_children; i++) {
error = MPI_Comm_spawn(argv[0], MPI_ARGV_NULL, 1,
MPI_INFO_NULL, 0, MPI_COMM_WORLD, &child_comm[i], &error_code);
Expand All @@ -243,7 +243,7 @@ int main(int argc, char *argv[])
MPI_Send(&alternate_equation, 1, MPI_INT, 0, 0, child_comm[i]);
}
} else {
master = 0;
parent = 0;
MPI_Recv(&num_colors, 1, MPI_INT, 0, 0, parent, MPI_STATUS_IGNORE);
MPI_Recv(&imax_iterations, 1, MPI_INT, 0, 0, parent, MPI_STATUS_IGNORE);
MPI_Recv(&ipixels_across, 1, MPI_INT, 0, 0, parent, MPI_STATUS_IGNORE);
Expand All @@ -255,7 +255,7 @@ int main(int argc, char *argv[])
MPI_Recv(&alternate_equation, 1, MPI_INT, 0, 0, parent, MPI_STATUS_IGNORE);
}

if (master) {
if (parent) {
colors = malloc((num_colors + 1) * sizeof(color_t));
if (colors == NULL) {
MPI_Abort(MPI_COMM_WORLD, -1);
Expand All @@ -272,7 +272,7 @@ int main(int argc, char *argv[])
exit(-1);
}

if (master) {
if (parent) {
int istep, jstep;
int i1[400], i2[400], j1[400], j2[400];
int ii, jj;
Expand Down Expand Up @@ -504,7 +504,7 @@ int main(int argc, char *argv[])

/* check for the end condition */
if (x_min == x_max && y_min == y_max) {
/*printf("slave done.\n");fflush(stdout); */
/*printf("child done.\n");fflush(stdout); */
break;
}

Expand Down Expand Up @@ -566,7 +566,7 @@ int main(int argc, char *argv[])
}
}

if (master && save_image) {
if (parent && save_image) {
imax_iterations = 0;
for (i = 0; i < ipixels_across * ipixels_down; ++i) {
/* look for "brightest" pixel value, for image use */
Expand Down Expand Up @@ -596,7 +596,7 @@ int main(int argc, char *argv[])
file_message, num_colors, colors);
}

if (master) {
if (parent) {
for (i = 0; i < num_children; i++) {
MPI_Comm_disconnect(&child_comm[i]);
}
Expand All @@ -614,7 +614,7 @@ void PrintUsage()
{
printf("usage: mpiexec -n 1 pmandel [options]\n");
printf
("options:\n -n # slaves\n -xmin # -xmax #\n -ymin # -ymax #\n -depth #\n -xscale # -yscale #\n -out filename\n -i\n");
("options:\n -n # children\n -xmin # -xmax #\n -ymin # -ymax #\n -depth #\n -xscale # -yscale #\n -out filename\n -i\n");
printf("All options are optional.\n");
printf
("-i will allow you to input the min/max parameters from stdin and output the resulting image to a ppm file.");
Expand Down Expand Up @@ -750,7 +750,7 @@ void read_mand_args(int argc, char *argv[], int *o_max_iterations,
*o_divergent_limit = INFINITE_LIMIT; /* default total range is assumed
* if not explicitly overwritten */

*num_children = DEFAULT_NUM_SLAVES;
*num_children = DEFAULT_NUM_CHILDREN;

/* We just cycle through all given parameters, matching what we can.
* Note that we force casting, because we expect that a nonsensical
Expand Down Expand Up @@ -894,12 +894,12 @@ void check_mand_params(int *m_max_iterations,
}

if (*m_num_children < 1) {
printf("Error, invalid number of slaves (%d), setting to %d\n", *m_num_children,
DEFAULT_NUM_SLAVES);
*m_num_children = DEFAULT_NUM_SLAVES;
printf("Error, invalid number of children (%d), setting to %d\n", *m_num_children,
DEFAULT_NUM_CHILDREN);
*m_num_children = DEFAULT_NUM_CHILDREN;
}
if (*m_num_children > 400) {
printf("Error, number of slaves (%d) exceeds the maximum, setting to 400.\n",
printf("Error, number of children (%d) exceeds the maximum, setting to 400.\n",
*m_num_children);
*m_num_children = 400;
}
Expand Down
Loading

0 comments on commit 5ef6367

Please sign in to comment.