*** ../globus-1.1.3/Miscellaneous/data_conversion/library/globus_dc.h Thu Mar 30 18:39:03 2000 --- Miscellaneous/data_conversion/library/globus_dc.h Fri Aug 11 19:24:40 2000 *************** *** 1,4 **** ! /* rcsid = $Header: /home/globdev/CVS/globus-1998_04_16/Globus/Miscellaneous/data_conversion/library/globus_dc.h,v 1.18 2000/03/30 16:39:03 bester Exp $ */ #ifndef NEXUS_DC_H #define NEXUS_DC_H --- 1,4 ---- ! /* rcsid = $Header: /home/globdev/CVS/globus-1.1.4/globus/Miscellaneous/data_conversion/library/globus_dc.h,v 1.2 2000/08/11 17:24:40 toonen Exp $ */ #ifndef NEXUS_DC_H #define NEXUS_DC_H *************** *** 425,429 **** --- 425,484 ---- */ #define NEXUS_DC_FORMAT_LOCAL GLOBUS_DC_FORMAT_LOCAL #define nexus_dc_format() globus_dc_format() + + /* + * Forward compatibility :-) + */ + #define globus_dc_sizeof_char nexus_dc_sizeof_char + #define globus_dc_sizeof_u_char nexus_dc_sizeof_u_char + #define globus_dc_sizeof_byte nexus_dc_sizeof_byte + #define globus_dc_sizeof_short nexus_dc_sizeof_short + #define globus_dc_sizeof_u_short nexus_dc_sizeof_u_short + #define globus_dc_sizeof_int nexus_dc_sizeof_int + #define globus_dc_sizeof_u_int nexus_dc_sizeof_u_int + #define globus_dc_sizeof_long nexus_dc_sizeof_long + #define globus_dc_sizeof_long_long nexus_dc_sizeof_long_long + #define globus_dc_sizeof_u_long nexus_dc_sizeof_u_long + #define globus_dc_sizeof_float nexus_dc_sizeof_float + #define globus_dc_sizeof_double nexus_dc_sizeof_double + + #define globus_dc_sizeof_remote_char nexus_dc_sizeof_remote_char + #define globus_dc_sizeof_remote_u_char nexus_dc_sizeof_remote_u_char + #define globus_dc_sizeof_remote_byte nexus_dc_sizeof_remote_byte + #define globus_dc_sizeof_remote_short nexus_dc_sizeof_remote_short + #define globus_dc_sizeof_remote_u_short nexus_dc_sizeof_remote_u_short + #define globus_dc_sizeof_remote_int nexus_dc_sizeof_remote_int + #define globus_dc_sizeof_remote_u_int nexus_dc_sizeof_remote_u_int + #define globus_dc_sizeof_remote_long nexus_dc_sizeof_remote_long + #define globus_dc_sizeof_remote_long_long nexus_dc_sizeof_remote_long_long + #define globus_dc_sizeof_remote_u_long nexus_dc_sizeof_remote_u_long + #define globus_dc_sizeof_remote_float nexus_dc_sizeof_remote_float + #define globus_dc_sizeof_remote_double nexus_dc_sizeof_remote_double + + #define globus_dc_put_char nexus_dc_put_char + #define globus_dc_put_u_char nexus_dc_put_u_char + #define globus_dc_put_byte nexus_dc_put_byte + #define globus_dc_put_short nexus_dc_put_short + #define globus_dc_put_u_short nexus_dc_put_u_short + #define globus_dc_put_int nexus_dc_put_int + #define globus_dc_put_u_int nexus_dc_put_u_int + #define globus_dc_put_long nexus_dc_put_long + #define globus_dc_put_long_long nexus_dc_put_long_long + #define globus_dc_put_u_long nexus_dc_put_u_long + #define globus_dc_put_float nexus_dc_put_float + #define globus_dc_put_double nexus_dc_put_double + + #define globus_dc_get_char nexus_dc_get_char + #define globus_dc_get_u_char nexus_dc_get_u_char + #define globus_dc_get_byte nexus_dc_get_byte + #define globus_dc_get_short nexus_dc_get_short + #define globus_dc_get_u_short nexus_dc_get_u_short + #define globus_dc_get_int nexus_dc_get_int + #define globus_dc_get_u_int nexus_dc_get_u_int + #define globus_dc_get_long nexus_dc_get_long + #define globus_dc_get_long_long nexus_dc_get_long_long + #define globus_dc_get_u_long nexus_dc_get_u_long + #define globus_dc_get_float nexus_dc_get_float + #define globus_dc_get_double nexus_dc_get_double #endif /* NEXUS_DC_H */ *** ../globus-1.1.3/Miscellaneous/data_conversion/library/globus_dc_64le.c Mon Mar 27 14:45:02 2000 --- Miscellaneous/data_conversion/library/globus_dc_64le.c Tue Sep 5 18:02:19 2000 *************** *** 2,8 **** * nexus_dc_64le.c */ ! static char *rcsid = "$Header: /home/globdev/CVS/globus-1998_04_16/Globus/Miscellaneous/data_conversion/library/globus_dc_64le.c,v 1.6 2000/03/27 12:45:02 toonen Exp $"; #include "globus_dc.h" --- 2,8 ---- * nexus_dc_64le.c */ ! static char *rcsid = "$Header: /home/globdev/CVS/globus-1.1.4/globus/Miscellaneous/data_conversion/library/globus_dc_64le.c,v 1.2 2000/09/05 16:02:19 toonen Exp $"; #include "globus_dc.h" *************** *** 1220,1226 **** */ int nexus_dc_is_native_long_long(int format) { ! if (format == NEXUS_FORMAT_32BIT_LE || format == NEXUS_DC_FORMAT_64BIT_LE) return(NEXUS_TRUE); else --- 1220,1226 ---- */ int nexus_dc_is_native_long_long(int format) { ! if (format == NEXUS_DC_FORMAT_32BIT_LE || format == NEXUS_DC_FORMAT_64BIT_LE) return(NEXUS_TRUE); else *** ../globus-1.1.3/Miscellaneous/mpich/Makefile.in Tue Aug 3 03:10:33 1999 --- Miscellaneous/mpich/Makefile.in Wed Aug 2 19:38:20 2000 *************** *** 13,19 **** @makefile_common_vars@ ! INSTALL_DATA_SYSCONFDIR=Makefile.mpich-1.1.2 Makefile.mpich-new install_headers_all:: do_makefile_mpich force --- 13,22 ---- @makefile_common_vars@ ! INSTALL_DATA_SYSCONFDIR= \ ! Makefile.mpich-1.1.2 \ ! Makefile.mpich-1.2.0 \ ! Makefile.mpich-1.2.1 install_headers_all:: do_makefile_mpich force *** /dev/null Tue May 5 22:32:27 1998 --- Miscellaneous/mpich/Makefile.mpich-1.2.0.in Wed Aug 2 19:38:20 2000 *************** *** 0 **** --- 1,142 ---- + # + # This makefile is used to bridge knowledge from Globus to MPICH, so that + # MPICH is built using the same compiler settings, and linking the correct + # libraries. + # + # It assumes that GLOBUS_INSTALL_PATH points to the TOP install directory. + # + + globus_prefix = $(GLOBUS_INSTALL_PATH) + prefix = $(globus_prefix) + exec_prefix = @installed_exec_prefix@ + + include $(exec_prefix)/etc/makefile_header + + # + # duroc_bootstrap is dependent on all other components used: + # DUROC runtime, Nexus, gram_myjob, duct, ... + # + MPICH_CFLAGS = $(GLOBUS_DUROC_BOOTSTRAP_CFLAGS) @EXTRA_MPICH_CFLAGS@ $(CFLAGS) + MPICH_LDFLAGS = $(GLOBUS_DUROC_BOOTSTRAP_LDFLAGS) $(LDFLAGS) + MPICH_LIBS = $(GLOBUS_DUROC_BOOTSTRAP_LIBS) $(LIBS) + + # + # removes duplicates... + # + MPICH_CLEANUP = $(AWK) '{ \ + for (i=NF;i>0;--i) { \ + if (index(s," "$$i" ")==0) \ + s =" "$$i" "s ; \ + } ; \ + } \ + END {print s}' + + # + # removes -D flags from CFLAGS (for FFLAGS) + # + MPICH_DASH_D = $(AWK) '{ \ + for (i=1;i<=NF;++i) { \ + if (index($$i,"-D")!=1) \ + s =s" "$$i ; \ + } ; \ + } \ + END {print s}' + + globusversion: + @echo $(GLOBUS_RELEASE) + + # + # Location of tools (globus-hostname2contacts, globusrun) + # + globustooldir: + @$(prefix)/bin/globus-tools-path -bindir ; + + # + # Globus-required include dir to make the MPICH globus device + # + globusincdir: + @echo -I$(includedir) + + # + # Globus-required include dir to make MPICH-G apps + # + userincdir: + @echo + + # + # Globus-required linkages: location + # + userlibpath: + @echo -L$(libdir) -L$(GLOBUS_SSL_PATH)/lib + + # + # Globus-required linkages: libraries + # + userlib: + @echo $(MPICH_LIBS) | $(MPICH_CLEANUP) + + # + # Tells whether nexus uses an underlying vendor implementation of MPI + # (could cause name clashing when building MPICH) + # + globus_nexus_uses_mpi: + @echo "@GLOBUS_NEXUS_USES_MPI@" + + # + # Tells whether the (jobtype=mpi) argument is required in the RSL built + # by mpirun.globus + # + globus_jobtype_mpi_required: + @echo "@GLOBUS_JOBTYPE_MPI_REQUIRED@" + + # + # Compiler, linkers, and flags + # + cc: + @echo $(CC) + + cflags: + @echo $(MPICH_CFLAGS) | $(MPICH_CLEANUP) + + clinker: + @echo $(LD) + + clinkerflags: + @echo $(MPICH_LDFLAGS) | $(MPICH_CLEANUP) + + CC: + @echo $(CXX) + + CCflags: + @echo $(CXXFLAGS) $(MPICH_CFLAGS) | $(MPICH_CLEANUP) + + CClinker: + @echo $(CXX) + + CClinkerflags: + @echo $(MPICH_LDFLAGS) | $(MPICH_CLEANUP) + + f77: + @echo $(F77) + + f77flags: + @echo $(F77FLAGS) $(MPICH_CFLAGS) | $(MPICH_CLEANUP) | $(MPICH_DASH_D) + + f77linker: + @echo $(F77) + + f77linkerflags: + @echo $(MPICH_LDFLAGS) | $(MPICH_CLEANUP) | $(MPICH_DASH_D) + + f90: + @echo $(F90) + + f90flags: + @echo $(F90FLAGS) $(MPICH_CFLAGS) | $(MPICH_CLEANUP) | $(MPICH_DASH_D) + + f90linker: + @echo $(F90) + + f90linkerflags: + @echo $(MPICH_LDFLAGS) | $(MPICH_CLEANUP) | $(MPICH_DASH_D) + *** /dev/null Tue May 5 22:32:27 1998 --- Miscellaneous/mpich/Makefile.mpich-1.2.1.in Wed Aug 2 19:40:21 2000 *************** *** 0 **** --- 1,145 ---- + # + # This makefile is used to bridge knowledge from Globus to MPICH, so that + # MPICH is built using the same compiler settings, and linking the correct + # libraries. + # + # It assumes that GLOBUS_INSTALL_PATH points to the TOP install directory. + # + + globus_prefix = $(GLOBUS_INSTALL_PATH) + prefix = $(globus_prefix) + exec_prefix = @installed_exec_prefix@ + + include $(exec_prefix)/etc/makefile_header + + # + # duroc_bootstrap is dependent on all other components used: + # DUROC runtime, Nexus, gram_myjob, duct, ... + # + MPICH_CFLAGS = $(GLOBUS_DUROC_BOOTSTRAP_CFLAGS) @EXTRA_MPICH_CFLAGS@ $(CFLAGS) + MPICH_LDFLAGS = $(GLOBUS_DUROC_BOOTSTRAP_LDFLAGS) $(LDFLAGS) + MPICH_LIBS = $(GLOBUS_DUROC_BOOTSTRAP_LIBS) $(LIBS) + + # + # removes duplicates... + # + MPICH_CLEANUP = $(AWK) '{ \ + for (i=NF;i>0;--i) { \ + if (index(s," "$$i" ")==0) \ + s =" "$$i" "s ; \ + } ; \ + } \ + END {print s}' + + # + # removes -D flags from CFLAGS (for FFLAGS) + # + MPICH_DASH_D = $(AWK) '{ \ + for (i=1;i<=NF;++i) { \ + if (index($$i,"-D")!=1) \ + s =s" "$$i ; \ + } ; \ + } \ + END {print s}' + + globusversion: + @echo $(GLOBUS_RELEASE) + + # + # Globus-required linkages: location + # + userlibpath: + @echo -L$(libdir) -L$(GLOBUS_SSL_PATH)/lib + + # + # Globus-required linkages: libraries + # + userlib: + @echo $(MPICH_LIBS) | $(MPICH_CLEANUP) + + # + # Are the Globus libraries built for use with a vendor implementation of MPI? + # + globus_mpi_enabled: + @echo "@GLOBUS_MPI_ENABLED@" + + # + # Are the Globus libraries multi-threaded? + # + globus_threads_enabled: + @echo "@GLOBUS_THREADS_ENABLED@" + + # + # Compiler, linkers, and flags + # + cc: + @echo $(CC) + + cflags: + @echo $(MPICH_CFLAGS) | $(MPICH_CLEANUP) + + base_cflags: + @echo $(BASE_CFLAGS) | $(MPICH_CLEANUP) + + clinker: + @echo $(LD) + + clinkerflags: + @echo $(MPICH_LDFLAGS) | $(MPICH_CLEANUP) + + base_clinkerflags: + @echo $(BASE_LDFLAGS) | $(MPICH_CLEANUP) + + CC: + @echo $(CXX) + + CCflags: + @echo $(CXXFLAGS) $(MPICH_CFLAGS) | $(MPICH_CLEANUP) + + base_CCflags: + @echo $(BASE_CXXFLAGS) | $(MPICH_CLEANUP) + + CClinker: + @echo $(CXX) + + CClinkerflags: + @echo $(MPICH_LDFLAGS) | $(MPICH_CLEANUP) + + base_CClinkerflags: + @echo $(BASE_LDFLAGS) | $(MPICH_CLEANUP) + + f77: + @echo $(F77) + + f77flags: + @echo $(F77FLAGS) $(MPICH_CFLAGS) | $(MPICH_CLEANUP) | $(MPICH_DASH_D) + + base_f77flags: + @echo $(F77FLAGS) | $(MPICH_CLEANUP) | $(MPICH_DASH_D) + + f77linker: + @echo $(F77) + + f77linkerflags: + @echo $(MPICH_LDFLAGS) | $(MPICH_CLEANUP) | $(MPICH_DASH_D) + + base_f77linkerflags: + @echo $(BASE_LDFLAGS) | $(MPICH_CLEANUP) + + f90: + @echo $(F90) + + f90flags: + @echo $(F90FLAGS) $(MPICH_CFLAGS) | $(MPICH_CLEANUP) | $(MPICH_DASH_D) + + base_f90flags: + @echo $(F90FLAGS) | $(MPICH_CLEANUP) | $(MPICH_DASH_D) + + f90linker: + @echo $(F90) + + f90linkerflags: + @echo $(MPICH_LDFLAGS) | $(MPICH_CLEANUP) | $(MPICH_DASH_D) + + base_f90linkerflags: + @echo $(BASE_LDFLAGS) | $(MPICH_CLEANUP) *** ../globus-1.1.3/Miscellaneous/mpich/configure.in Tue Aug 3 17:47:06 1999 --- Miscellaneous/mpich/configure.in Fri Aug 11 19:26:31 2000 *************** *** 1,35 **** ! AC_REVISION($Revision: 1.8 $) ! AC_INIT(Makefile.mpich-new.in) LAC_INIT LAC_COMPILERS_TARGET(no) EXTRA_MPICH_CFLAGS="" GLOBUS_NEXUS_USES_MPI="no" GLOBUS_JOBTYPE_MPI_REQUIRED="no" if test $lac_cv_mpi = "yes" ; then GLOBUS_NEXUS_USES_MPI="yes" GLOBUS_JOBTYPE_MPI_REQUIRED="yes" EXTRA_MPICH_CFLAGS="-DMPICH_RENAME_MPI_FUNCS" fi if test $lac_cv_mpl = "yes" ; then GLOBUS_JOBTYPE_MPI_REQUIRED="yes" fi if test $lac_cv_inx = "yes" ; then GLOBUS_JOBTYPE_MPI_REQUIRED="yes" fi AC_SUBST(EXTRA_MPICH_CFLAGS) AC_SUBST(GLOBUS_NEXUS_USES_MPI) AC_SUBST(GLOBUS_JOBTYPE_MPI_REQUIRED) SUBDIRS="" AC_SUBST(SUBDIRS) AC_CONFIG_SUBDIRS($SUBDIRS) if test $lac_cv_new_mpich != "no" ; then ! GLOBUS_MPICH_FILE="Makefile.mpich-new" else GLOBUS_MPICH_FILE="Makefile.mpich-1.1.2" fi --- 1,52 ---- ! AC_REVISION($Revision: 1.3 $) ! AC_INIT(Makefile.in) LAC_INIT LAC_COMPILERS_TARGET(no) EXTRA_MPICH_CFLAGS="" + GLOBUS_MPI_ENABLED="no" GLOBUS_NEXUS_USES_MPI="no" GLOBUS_JOBTYPE_MPI_REQUIRED="no" + if test $lac_cv_mpi = "yes" ; then + GLOBUS_MPI_ENABLED="yes" GLOBUS_NEXUS_USES_MPI="yes" GLOBUS_JOBTYPE_MPI_REQUIRED="yes" EXTRA_MPICH_CFLAGS="-DMPICH_RENAME_MPI_FUNCS" fi + if test $lac_cv_mpl = "yes" ; then GLOBUS_JOBTYPE_MPI_REQUIRED="yes" fi + if test $lac_cv_inx = "yes" ; then GLOBUS_JOBTYPE_MPI_REQUIRED="yes" fi + if test "$lac_cv_threads_type" != "no" ; then + GLOBUS_THREADS_ENABLED="yes" + else + GLOBUS_THREADS_ENABLED="no" + fi + AC_SUBST(EXTRA_MPICH_CFLAGS) + AC_SUBST(GLOBUS_MPI_ENABLED) AC_SUBST(GLOBUS_NEXUS_USES_MPI) AC_SUBST(GLOBUS_JOBTYPE_MPI_REQUIRED) + AC_SUBST(GLOBUS_THREADS_ENABLED) SUBDIRS="" AC_SUBST(SUBDIRS) AC_CONFIG_SUBDIRS($SUBDIRS) + dnl + dnl Provided for backwards compatibility. Newer version of MPICH use a + dnl specific version + dnl if test $lac_cv_new_mpich != "no" ; then ! GLOBUS_MPICH_FILE="Makefile.mpich-1.2.0" else GLOBUS_MPICH_FILE="Makefile.mpich-1.1.2" fi *************** *** 37,43 **** LAC_MAKEFILES(makefile_header, Makefile) ! AC_OUTPUT($lac_makefiles $lac_makefile_headers Makefile.mpich-new Makefile.mpich-1.1.2, LAC_INSERT_MAKEFILE_HEADERS echo timestamp > stamp-h, [lac_makefiles="$lac_makefiles"] ) --- 54,61 ---- LAC_MAKEFILES(makefile_header, Makefile) ! AC_OUTPUT($lac_makefiles $lac_makefile_headers ! Makefile.mpich-1.2.1 Makefile.mpich-1.2.0 Makefile.mpich-1.1.2, LAC_INSERT_MAKEFILE_HEADERS echo timestamp > stamp-h, [lac_makefiles="$lac_makefiles"] ) *** ../globus-1.1.3/ResourceManagement/duroc/src/bootstrap/duroc-bootstrap.c Fri Sep 10 18:55:51 1999 --- ResourceManagement/duroc/src/bootstrap/duroc-bootstrap.c Tue Sep 5 18:02:20 2000 *************** *** 1064,1066 **** --- 1064,1647 ---- (*sp_array) = NULL; return err; } + + + /* inter- and intra-subjob message tags */ + #define SUBJOB_MASTER_TO_SUBJOB0_MASTER_T "subjob mstr to subjob0 mstr topology" + #define SUBJOB0_MASTER_TO_SUBJOB_MASTER_T "subjob0 mstr to subjob mstr topology" + #define SUBJOB_MASTER_TO_SLAVE_T "subjob mstr to slave topology" + + #define SUBJOB_SLAVE_TO_MASTER_D "subjob slave to master data" + #define SUBJOB_MASTER_TO_SUBJOB_MASTER_D "subjob master to subjob master data" + #define SUBJOB_MASTER_TO_SLAVE_D "subjob master to slave data" + + #define MY_GRANK_STR_SIZE 10 + + + /***************************************/ + /* local utility function declarations */ + /***************************************/ + + static void copy_byte_array_from_tagged_buff(char *tagged_intrabuff, + int bufflen, + char **outbuffs, + int *outbufflens, + int *g_rank); + + /* + * globus_duroc_bootstrap_all_to_all_distribute_bytearray( + * globus_byte_t *inbuff, + * int inbufflen, + * int *nprocs, + * int *my_grank, + * globus_byte_t ***outbuffs, + * int **outbufflens); + * + * MUST be called by EVERY proc, each supplying inbuff,inbufflen + * (may be NULL,0). + * + * fills the last 4 args as follows: + * nprocs - total number of procs + * my_grank - unique id in range [0, nprocs-1]. + * preserves order of your subjob as it appears in envoking RSL, + * i.e., my_rank will be greater than all procs of + * subjobs appearing before mine in envoking RSL and + * less than all procs of subjobs appearing after mine. + * outbuffs - malloc'd a vector (length nprocs) where each element + * points to a (also malloc'd) copy of the byte array + * supplied by a particular proc such that + * outbuffs[i] is a copy of the byte array of + * the proc assigned my_grank=i (each proc should + * find a copy of the byte array they supplied in + * outbuffs[my_grank]) + * outbufflens - malloc'd a vector (length nprocs) of ints where + * outbufflens[i] is the length of the byte array + * outbuffs[i]. + * + */ + + /* NICK: should return 'globus-like' rc ... not 'void' */ + + void globus_duroc_bootstrap_all_to_all_distribute_bytearray( + globus_byte_t *inbuff, + int inbufflen, + int *nprocs, + int *my_grank, + globus_byte_t ***outbuffs, + int **outbufflens) + { + int rank_in_my_subjob; + int my_subjob_size; /* used by subjobmasters only */ + int nsubjobs; /* used by subjobmasters only */ + int *subjob_addresses; /* used by subjobmasters only */ + + globus_module_activate(GLOBUS_DUROC_BOOTSTRAP_MODULE); + + globus_duroc_runtime_intra_subjob_rank(&rank_in_my_subjob); + + globus_i_duroc_get_topology( + rank_in_my_subjob, + &my_subjob_size, + &subjob_addresses, + nprocs, + &nsubjobs, + my_grank); + + /* NICK: exiting on these failed mallocs is not right thing */ + /* to do. should set error rc and return. fix that */ + /* later when i learn more about globus rc stuff. */ + if (!(*outbuffs = + (globus_byte_t **) globus_libc_malloc(*nprocs*sizeof(globus_byte_t *)))) + { + globus_libc_fprintf(stderr, + "ERROR: failed malloc of %ld bytes\n", + *nprocs*sizeof(globus_byte_t *)); + exit(1); + } /* endif */ + if (!(*outbufflens = (int *) globus_libc_malloc(*nprocs*sizeof(int)))) + { + globus_libc_fprintf(stderr, + "ERROR: failed malloc of %ld bytes\n", *nprocs*sizeof(int)); + exit(1); + } /* endif */ + + globus_i_duroc_distribute_byte_array( + inbuff, + inbufflen, + rank_in_my_subjob, + my_subjob_size, + subjob_addresses, + *nprocs, + nsubjobs, + *my_grank, + *outbuffs, + *outbufflens); + + /************/ + /* clean-up */ + /************/ + + if (!rank_in_my_subjob) + /* subjob master */ + globus_libc_free(subjob_addresses); + + globus_module_deactivate(GLOBUS_DUROC_BOOTSTRAP_MODULE); + + } /* end NICK_globus_duroc_bootstrap_all_to_all_distribute_bytearray() */ + + + /* + * void + * globus_i_duroc_get_topology( + * int rank_in_my_subjob, + * int * my_subjob_size, + * int ** subjob_addresses, + * int * nprocs, + * int * nsubjobs, + * int * my_grank) + * + * MUST be called by EVERY proc, each supplying rank_in_my_subjob + * rank_in_my_subjob==0 -> subjobmaster, else subjobslave + * + * fills the remaining args: + * my_subjob_size - populated for subjobmasters only, + * nprocs (including master) in their subjob + * subjob_addresses - malloc'd and filled for OTHER subjobmasters only + * inter_subjob_addr's of other subjobmasters + * my subjob_addr NOT included (so njobs-1) + * nsubjobs - populated for subjobmasters only. + * total number of procs + * nprocs - total number of procs + * my_grank - my rank in [0, nprocs-1] + * + */ + + /* NICK: should return 'globus-like' rc ... not 'void' */ + + void + globus_i_duroc_get_topology( + int rank_in_my_subjob, + int * my_subjob_size, + int ** subjob_addresses, + int * nprocs, + int * nsubjobs, + int * my_grank) + { + char topology_buff[GRAM_MYJOB_MAX_BUFFER_LENGTH]; + char *buff; + int bufflen; + int i; + int sj0_master_idx; /* used by subjobmasters only */ + int *job_sizes; /* used by subjobmaster 0 only */ + int *g_ranks; /* used by subjobmaster 0 only */ + + if (rank_in_my_subjob) + { + /* subjob slave */ + + globus_duroc_runtime_intra_subjob_receive( + SUBJOB_MASTER_TO_SLAVE_T, /* tag */ + &bufflen, /* nbytes received? */ + (globus_byte_t *) topology_buff); /* message */ + + sscanf(topology_buff, "%d %d", nprocs, my_grank); + } + else + { + /* subjob master */ + int duroc_subjobmaster_rank; + int my_subjob_addr; + int rsl_subjob_rank; + char *rsl_subjob_rank_env_var; + + globus_duroc_runtime_intra_subjob_size(my_subjob_size); + globus_duroc_runtime_inter_subjob_structure(&my_subjob_addr, + nsubjobs, + subjob_addresses); + /* finding index of master subjob 0, he */ + /* is the one with the lowest address */ + for (i = 0, sj0_master_idx = -1, duroc_subjobmaster_rank = 0; + i < *nsubjobs; i ++) + { + if ((sj0_master_idx == -1 && (*subjob_addresses)[i] < my_subjob_addr) + || (sj0_master_idx != -1 + && (*subjob_addresses)[i] < (*subjob_addresses)[sj0_master_idx])) + sj0_master_idx = i; + if ((*subjob_addresses)[i] < my_subjob_addr) + duroc_subjobmaster_rank ++; + } /* endfor */ + /* globus_duroc_runtime_inter_subjob_structure reports the */ + /* number of REMOTE subjobs (*other* than the subjob i'm */ + /* master of). to get the TOTAL number of subjobs in this */ + /* run i must increment the value reported by */ + /* globus_duroc_runtime_inter_subjob_structure */ + (*nsubjobs) ++; + + /* NICK: should not exit here ... should set globus-like rc. */ + if (!(rsl_subjob_rank_env_var=getenv("GLOBUS_DUROC_SUBJOB_INDEX"))) + { + globus_libc_fprintf(stderr, + "ERROR: required environment variable GLOBUS_DUROC_SUBJOB_INDEX not set.\n"); + globus_libc_fprintf(stderr, + " Each subjob in envoking RSL must have GLOBUS_DUROC_SUBJOB_INDEX\n"); + globus_libc_fprintf(stderr, + " set to rank (0, 1, 2, ...) of subjob as it appears in the envoking RSL.\n"); + exit(1); + } /* endif */ + rsl_subjob_rank = atoi(rsl_subjob_rank_env_var); + if (rsl_subjob_rank < 0 || rsl_subjob_rank >= *nsubjobs) + { + globus_libc_fprintf(stderr, + "ERROR: env variable GLOBUS_DUROC_SUBJOB_INDEX %d must be >= 0 and\n", + rsl_subjob_rank); + globus_libc_fprintf(stderr, + "ERROR: less than the number of subjobs %d for this run.\n", + *nsubjobs); + exit(1); + } /* endif */ + + if (duroc_subjobmaster_rank) + { + /* NOT master of subjob 0 */ + + sprintf(topology_buff, + "%d %d %d", + duroc_subjobmaster_rank, + rsl_subjob_rank, + *my_subjob_size); + + globus_duroc_runtime_inter_subjob_send( + (*subjob_addresses)[sj0_master_idx], /* dest */ + SUBJOB_MASTER_TO_SUBJOB0_MASTER_T, /* tag */ + strlen(topology_buff)+1, /* nbytes */ + (globus_byte_t *) topology_buff); /* data */ + + globus_duroc_runtime_inter_subjob_receive( + SUBJOB0_MASTER_TO_SUBJOB_MASTER_T, /* tag */ + &bufflen, /* nbytes received? */ + (globus_byte_t **) &buff); /* message */ + + sscanf(buff, "%d %d", nprocs, my_grank); + + globus_libc_free(buff); + } + else + { + /* master of subjob 0 */ + + int j; + int temp; + /* vectors len nsubjobs, all indexed by duroc_subjobmaster_rank */ + int *rsl_ranks; /* received from other subjob masters */ + + /* NICK: exiting on these failed mallocs is not right thing */ + /* to do. should set error rc and return. fix that */ + /* later when i learn more about globus rc stuff. */ + if (!(rsl_ranks = + (int *) globus_libc_malloc(*nsubjobs*sizeof(int)))) + { + globus_libc_fprintf(stderr, + "ERROR: failed malloc of %ld bytes\n", + *nsubjobs*sizeof(int)); + exit(1); + } /* endif */ + if (!(job_sizes = + (int *) globus_libc_malloc(*nsubjobs*sizeof(int)))) + { + globus_libc_fprintf(stderr, + "ERROR: failed malloc of %ld bytes\n", + *nsubjobs*sizeof(int)); + exit(1); + } /* endif */ + if (!(g_ranks = (int *) globus_libc_malloc(*nsubjobs*sizeof(int)))) + { + globus_libc_fprintf(stderr, + "ERROR: failed malloc of %ld bytes\n", + *nsubjobs*sizeof(int)); + exit(1); + } /* endif */ + + /* need to sort subjob_addresses so that i may associate */ + /* (using incoming duroc_subjobmaster_rank) incoming */ + /* rsl_subjob_rank and my_subjob_size with dest addr */ + /* in subjob_addresses */ + for (i = 1; i < *nsubjobs-1; i ++) + { + for (j = i; j > 0; j --) + { + if ((*subjob_addresses)[j] < (*subjob_addresses)[j-1]) + { + temp = (*subjob_addresses)[j]; + (*subjob_addresses)[j] = (*subjob_addresses)[j-1]; + (*subjob_addresses)[j-1] = temp; + } /* endif */ + } /* endfor */ + } /* endfor */ + + /* rsl_ranks[] and job_sizes[] are indexed by */ + /* duroc_subjobmaster_rank, and i know that my */ + /* duroc_subjobmaster_rank==0 */ + rsl_ranks[0] = rsl_subjob_rank; + job_sizes[0] = *my_subjob_size; + + for (i = 1; i < *nsubjobs; i ++) + { + int ranks, sizes; + + /* + * receiving 3 longs from other subjob master + * duroc_subjobmaster_rank (used to index job_sizes[] + * and rsl_ranks[]) + * rsl_subjob_rank + * my_subjob_size + */ + globus_duroc_runtime_inter_subjob_receive( + SUBJOB_MASTER_TO_SUBJOB0_MASTER_T, /* tag */ + &bufflen, /* nbytes received? */ + (globus_byte_t **) &buff); /* message */ + + sscanf(buff, "%d %d %d", &j, &ranks, &sizes); + rsl_ranks[j] = ranks; + job_sizes[j] = sizes; + + globus_libc_free(buff); + } /* endfor */ + + /* calculating nprocs and everyones' g_rank based */ + /* on rsl_rank and job_sizes ... */ + /* mygrank = sum job_size for all rsl_ranks */ + /* that are less than mine */ + for (i = 0, *nprocs = 0; i < *nsubjobs; i ++) + { + (*nprocs) += job_sizes[i]; + for (g_ranks[i] = 0, j = 0; j < *nsubjobs; j ++) + if (rsl_ranks[i] > rsl_ranks[j]) + g_ranks[i] += job_sizes[j]; + } /* endfor */ + *my_grank = g_ranks[0]; + + /* sending other subjob masters nprocs and their g_rank */ + for (i = 0; i < *nsubjobs-1; i ++) + { + sprintf(topology_buff, "%d %d", *nprocs, g_ranks[i+1]); + globus_duroc_runtime_inter_subjob_send( + (*subjob_addresses)[i], /* dest */ + SUBJOB0_MASTER_TO_SUBJOB_MASTER_T, /* tag */ + strlen(topology_buff)+1, /* nbytes */ + (globus_byte_t *) topology_buff); /* data */ + } /* endfor */ + + globus_libc_free(rsl_ranks); + globus_libc_free(job_sizes); + globus_libc_free(g_ranks); + + } /* endif */ + + /* all subjob masters sending nprocs and g_rank to their slaves */ + for (i = 1; i < *my_subjob_size; i ++) + { + sprintf(topology_buff, "%d %d", *nprocs, (*my_grank) + i); + globus_duroc_runtime_intra_subjob_send( + i, /* dest */ + SUBJOB_MASTER_TO_SLAVE_T, /* tag */ + strlen(topology_buff)+1, /* nbytes */ + (globus_byte_t *) topology_buff); /* data */ + } /* endfor */ + } /* endif */ + + } /* end globus_i_duroc_get_topology() */ + + void + globus_i_duroc_distribute_byte_array( + globus_byte_t * inbuff, + int inbufflen, + int rank_in_my_subjob, + int my_subjob_size, + int * subjob_addresses, + int nprocs, + int nsubjobs, + int my_grank, + globus_byte_t ** outbuffs, + int * outbufflens) + { + + int i; + int j; + char *buff; + int bufflen; + char tagged_intrabuff[GRAM_MYJOB_MAX_BUFFER_LENGTH]; + int g_rank; + + /* everyone needs to copy their byte array into outbuffs */ + if (!(outbuffs[my_grank] = (globus_byte_t *) globus_libc_malloc(inbufflen))) + { + globus_libc_fprintf(stderr, + "ERROR: failed malloc of %d bytes\n", inbufflen); + exit(1); + } /* endif */ + memcpy(outbuffs[my_grank], inbuff, inbufflen); + outbufflens[my_grank] = inbufflen; + + /* tagging and copying my byte array for distribution */ + sprintf(tagged_intrabuff, "%d", my_grank); + memcpy(tagged_intrabuff+MY_GRANK_STR_SIZE, inbuff, inbufflen); + + if (rank_in_my_subjob) + { + /* subjob slave */ + + /* send my byte array to my master */ + globus_duroc_runtime_intra_subjob_send( + 0, /* dest */ + SUBJOB_SLAVE_TO_MASTER_D, /* tag */ + MY_GRANK_STR_SIZE+inbufflen, /* nbytes */ + (globus_byte_t *) tagged_intrabuff); /* data */ + + /* receiving all other byte arrays from my master */ + for (i = 0; i < nprocs-1; i ++) + { + globus_duroc_runtime_intra_subjob_receive( + SUBJOB_MASTER_TO_SLAVE_D, /* tag */ + &bufflen, /* nbytes received? */ + (globus_byte_t *) tagged_intrabuff); /* message */ + + copy_byte_array_from_tagged_buff(tagged_intrabuff, + bufflen, + (char **) outbuffs, + outbufflens, + &g_rank); + } /* endfor */ + } + else + { + /* subjob master */ + + /* sending my byte array to all my slaves */ + for (i = 1; i < my_subjob_size; i ++) + { + globus_duroc_runtime_intra_subjob_send( + i, /* dest */ + SUBJOB_MASTER_TO_SLAVE_D, /* tag */ + MY_GRANK_STR_SIZE+inbufflen, /* nbytes */ + (globus_byte_t *) tagged_intrabuff); /* data */ + } /* endfor */ + + /* sending my byte array to other subjob masters */ + for (i = 0; i < nsubjobs-1; i ++) + { + globus_duroc_runtime_inter_subjob_send( + subjob_addresses[i], /* dest */ + SUBJOB_MASTER_TO_SUBJOB_MASTER_D, /* tag */ + MY_GRANK_STR_SIZE+inbufflen, /* nbytes */ + (globus_byte_t *) tagged_intrabuff); /* data */ + } /* endfor */ + + /* receiving byte arrays from my slaves. making a copy */ + /* for myself, distributing it to my other slaves, and */ + /* finally other subjob masters */ + for (i = 0; i < my_subjob_size-1; i ++) + { + globus_duroc_runtime_intra_subjob_receive( + SUBJOB_SLAVE_TO_MASTER_D, /* tag */ + &bufflen, /* nbytes received? */ + (globus_byte_t *) tagged_intrabuff); /* message */ + + /* making copy for myself */ + copy_byte_array_from_tagged_buff(tagged_intrabuff, + bufflen, + (char **) outbuffs, + outbufflens, + &g_rank); + + /* send to other of slaves */ + for (j = 1; j < my_subjob_size; j ++) + { + if (my_grank+j != g_rank) + { + /* message originated at slave other than this one */ + globus_duroc_runtime_intra_subjob_send( + j, /* dest */ + SUBJOB_MASTER_TO_SLAVE_D, /* tag */ + bufflen, /* nbytes */ + (globus_byte_t *) tagged_intrabuff); /* data */ + } /* endif */ + } /* endfor */ + + /* sending to other subjob masters */ + for (j = 0; j < nsubjobs-1; j ++) + { + globus_duroc_runtime_inter_subjob_send( + subjob_addresses[j], /* dest */ + SUBJOB_MASTER_TO_SUBJOB_MASTER_D, /* tag */ + bufflen, /* nbytes */ + (globus_byte_t *) tagged_intrabuff); /* data */ + } /* endfor */ + } /* endfor */ + + /* receiving from other subjob masters, making a copy for */ + /* myself, distributing to my slaves */ + for (i = 0; i < nprocs-my_subjob_size; i ++) + { + globus_duroc_runtime_inter_subjob_receive( + SUBJOB_MASTER_TO_SUBJOB_MASTER_D, /* tag */ + &bufflen, /* nbytes received? */ + (globus_byte_t **) &buff); /* message */ + + /* make copy for myself */ + copy_byte_array_from_tagged_buff(buff, + bufflen, + (char **) outbuffs, + outbufflens, + &g_rank); + + /* distribute to all my slaves */ + for (j = 1; j < my_subjob_size; j ++) + { + globus_duroc_runtime_intra_subjob_send( + j, /* dest */ + SUBJOB_MASTER_TO_SLAVE_D, /* tag */ + bufflen, /* nbytes */ + (globus_byte_t *) buff); /* data */ + } /* endfor */ + + globus_libc_free(buff); + + } /* endfor */ + } /* endif */ + + } /* end globus_i_duroc_distribute_byte_array() */ + + + /***************************/ + /* Local Utility Functions */ + /***************************/ + + static void copy_byte_array_from_tagged_buff(char *tagged_intrabuff, + int bufflen, + char **outbuffs, + int *outbufflens, + int *g_rank) + { + int len; + + sscanf(tagged_intrabuff, "%d", g_rank); + + if (len = bufflen - MY_GRANK_STR_SIZE) + { + if (!(outbuffs[*g_rank] = (char *) globus_libc_malloc(len))) + { + globus_libc_fprintf(stderr, + "ERROR: failed malloc of %d bytes\n", len); + exit(1); + } /* endif */ + + memcpy(outbuffs[*g_rank], + tagged_intrabuff + MY_GRANK_STR_SIZE, + len); + } + else + outbuffs[*g_rank] = (char *) NULL; + + outbufflens[*g_rank] = len; + + } /* end copy_byte_array_from_tagged_buff() */ *** ../globus-1.1.3/ResourceManagement/duroc/src/bootstrap/globus_duroc_bootstrap.h Thu Jun 17 00:19:21 1999 --- ResourceManagement/duroc/src/bootstrap/globus_duroc_bootstrap.h Tue Sep 5 18:02:20 2000 *************** *** 77,82 **** --- 77,115 ---- int * job_sizep, nexus_startpoint_t ** sp_vectorp); + extern + void + globus_duroc_bootstrap_all_to_all_distribute_bytearray( + globus_byte_t * inbuff, + int inbufflen, + int * nprocs, + int * my_grank, + globus_byte_t *** outbuffs, + int ** outbufflens); + + extern + void + globus_i_duroc_get_topology( + int rank_in_my_subjob, + int * my_subjob_size, + int ** subjob_addresses, + int * nprocs, + int * nsubjobs, + int * my_grank); + + extern + void + globus_i_duroc_distribute_byte_array( + globus_byte_t * inbuff, + int inbufflen, + int rank_in_my_subjob, + int my_subjob_size, + int * subjob_addresses, + int nprocs, + int nsubjobs, + int my_grank, + globus_byte_t ** outbuffs, + int * outbufflens); EXTERN_C_END *** ../globus-1.1.3/CHANGES Wed Apr 26 18:12:03 2000 --- CHANGES Fri Aug 11 19:37:39 2000 *************** *** 1,5 **** ************************************************************************ ! Changes made Post 1.1.2 ************************************************************************ Security/gssapi_ssleay --- 1,23 ---- ************************************************************************ ! Changes made in 1.1.3 through 1.1.4 ! ************************************************************************ ! ! Miscellaneous/data_conversion ! ----------------------------- ! * globus_dc aliases added for all nexus_dc functions ! ! Miscellaneous/mpich ! ------------------- ! * added Makefile.mpich-1.2.1 to support MPICH-G2 ! ! ResourceManagement/duroc/bootstrap ! ---------------------------------- ! * added globus_duroc_bootstrap_all_to_all_distribute_bytearray() ! and supporting functions ! ! ! ************************************************************************ ! Changes made in 1.1.2 through 1.1.3 ************************************************************************ Security/gssapi_ssleay *************** *** 74,80 **** avoid a race condition reported from OPENLDAP security advisory ************************************************************************ ! Changes made in 1.1.1 through 1.1.2 ************************************************************************ Configuration --- 92,98 ---- avoid a race condition reported from OPENLDAP security advisory ************************************************************************ ! Changes made in 1.1.1 through 1.1.2 ************************************************************************ Configuration