From chail at mvapich.cse.ohio-state.edu Tue Mar 4 13:53:54 2008 From: chail at mvapich.cse.ohio-state.edu (chail@mvapich.cse.ohio-state.edu) Date: Tue Mar 4 13:54:08 2008 Subject: [mvapich-commit] r2173 - mvapich/trunk/mpid/ch_smp/process Message-ID: <200803041853.m24Irsi3003554@mvapich.cse.ohio-state.edu> Author: chail Date: 2008-03-04 13:53:53 -0500 (Tue, 04 Mar 2008) New Revision: 2173 Modified: mvapich/trunk/mpid/ch_smp/process/mpirun_rsh.c Log: Add back the feature that for ch_smp hostnames can be omitted. Modified: mvapich/trunk/mpid/ch_smp/process/mpirun_rsh.c =================================================================== --- mvapich/trunk/mpid/ch_smp/process/mpirun_rsh.c 2008-03-02 21:34:13 UTC (rev 2172) +++ mvapich/trunk/mpid/ch_smp/process/mpirun_rsh.c 2008-03-04 18:53:53 UTC (rev 2173) @@ -189,7 +189,7 @@ int version; int timeout; - size_t hostname_len = 0; + size_t hostname_len = 256; totalview_cmd[199] = 0; display[0]='\0'; @@ -313,12 +313,9 @@ if (!hostfile_on) { /* get hostnames from argument list */ if (argc - optind < nprocs + 1) { - fprintf(stderr, "Without hostfile option, hostnames must be " - "specified on command line.\n"); - usage(); - exit(EXIT_FAILURE); + aout_index = optind; } - aout_index = nprocs + optind; + else aout_index = nprocs + optind; } else { aout_index = optind; } @@ -361,7 +358,8 @@ hostname_len = read_hostfile(hostfile); } else { for (i = 0; i < nprocs; i++) { - plist[i].hostname = (char *)strndup(argv[optind + i], 100); + plist[i].hostname = (char *)malloc(hostname_len); + gethostname(plist[i].hostname, hostname_len); hostname_len = hostname_len > strlen(plist[i].hostname) ? hostname_len : strlen(plist[i].hostname); } @@ -594,6 +592,10 @@ wait_for_errors (s, (struct sockaddr *)&sockaddr, sockaddr_len); + for (i = 0; i < nprocs; i++) { + free(plist[i].hostname); + } + /* * This return should never be reached. */ From mamidala at mvapich.cse.ohio-state.edu Tue Mar 4 18:40:26 2008 From: mamidala at mvapich.cse.ohio-state.edu (mamidala@mvapich.cse.ohio-state.edu) Date: Tue Mar 4 18:40:42 2008 Subject: [mvapich-commit] r2179 - mvapich/trunk/src/context Message-ID: <200803042340.m24NeQMO004395@mvapich.cse.ohio-state.edu> Author: mamidala Date: 2008-03-04 18:40:24 -0500 (Tue, 04 Mar 2008) New Revision: 2179 Modified: mvapich/trunk/src/context/create_2level_comm.c Log: checking in a fix for BLACS seg. fault problem. Problem occurs when application holds onto MPI communicators not freeing immediately Modified: mvapich/trunk/src/context/create_2level_comm.c =================================================================== --- mvapich/trunk/src/context/create_2level_comm.c 2008-03-04 21:08:01 UTC (rev 2178) +++ mvapich/trunk/src/context/create_2level_comm.c 2008-03-04 23:40:24 UTC (rev 2179) @@ -85,12 +85,19 @@ } if (comm_ptr->shmem_comm != MPI_COMM_NULL) { - struct MPIR_COMMUNICATOR* shmem_ptr; - shmem_ptr= MPIR_GET_COMM_PTR(comm_ptr->shmem_comm); - pthread_spin_lock(&shmem_coll->shmem_coll_lock); - shmem_coll_obj.shmem_avail[shmem_ptr->shmem_comm_rank] = 1; - pthread_spin_unlock(&shmem_coll->shmem_coll_lock); - MPI_Comm_free(&(comm_ptr->shmem_comm)); + struct MPIR_COMMUNICATOR* shmem_ptr; + shmem_ptr= MPIR_GET_COMM_PTR(comm_ptr->shmem_comm); + + int my_local_id; + MPI_Comm_rank(comm_ptr->shmem_comm, &my_local_id); + + if ((my_local_id == 0)&&(comm_ptr->shmem_coll_ok == 1)){ + pthread_spin_lock(&shmem_coll->shmem_coll_lock); + shmem_coll_obj.shmem_avail[shmem_ptr->shmem_comm_rank] = 1; + pthread_spin_unlock(&shmem_coll->shmem_coll_lock); + } + + MPI_Comm_free(&(comm_ptr->shmem_comm)); } From mamidala at mvapich.cse.ohio-state.edu Sun Mar 9 17:22:32 2008 From: mamidala at mvapich.cse.ohio-state.edu (mamidala@mvapich.cse.ohio-state.edu) Date: Sun Mar 9 17:22:48 2008 Subject: [mvapich-commit] r2230 - mvapich/branches/1.0/src/context Message-ID: <200803092122.m29LMW6h009812@mvapich.cse.ohio-state.edu> Author: mamidala Date: 2008-03-09 17:22:30 -0400 (Sun, 09 Mar 2008) New Revision: 2230 Modified: mvapich/branches/1.0/src/context/create_2level_comm.c Log: Checking in fix for the BLACS problem. Thanks to Byoung-Do Kim (TACC) for pointing this out. Modified: mvapich/branches/1.0/src/context/create_2level_comm.c =================================================================== --- mvapich/branches/1.0/src/context/create_2level_comm.c 2008-03-09 20:59:18 UTC (rev 2229) +++ mvapich/branches/1.0/src/context/create_2level_comm.c 2008-03-09 21:22:30 UTC (rev 2230) @@ -87,9 +87,15 @@ if (comm_ptr->shmem_comm != MPI_COMM_NULL) { struct MPIR_COMMUNICATOR* shmem_ptr; shmem_ptr= MPIR_GET_COMM_PTR(comm_ptr->shmem_comm); - pthread_spin_lock(&shmem_coll->shmem_coll_lock); - shmem_coll_obj.shmem_avail[shmem_ptr->shmem_comm_rank] = 1; - pthread_spin_unlock(&shmem_coll->shmem_coll_lock); + int my_local_id; + MPI_Comm_rank(comm_ptr->shmem_comm, &my_local_id); + + if ((my_local_id == 0)&&(comm_ptr->shmem_coll_ok == 1)){ + pthread_spin_lock(&shmem_coll->shmem_coll_lock); + shmem_coll_obj.shmem_avail[shmem_ptr->shmem_comm_rank] = 1; + pthread_spin_unlock(&shmem_coll->shmem_coll_lock); + } + MPI_Comm_free(&(comm_ptr->shmem_comm)); } From sridharj at mvapich.cse.ohio-state.edu Sun Mar 9 17:44:49 2008 From: sridharj at mvapich.cse.ohio-state.edu (sridharj@mvapich.cse.ohio-state.edu) Date: Sun Mar 9 17:45:04 2008 Subject: [mvapich-commit] r2231 - in mvapich/branches/1.0/mpid: ch_gen2/process ch_gen2_ud/process ch_psm/process ch_smp/process Message-ID: <200803092144.m29Linl5009843@mvapich.cse.ohio-state.edu> Author: sridharj Date: 2008-03-09 17:44:46 -0400 (Sun, 09 Mar 2008) New Revision: 2231 Modified: mvapich/branches/1.0/mpid/ch_gen2/process/mpispawn.c mvapich/branches/1.0/mpid/ch_gen2_ud/process/mpispawn.c mvapich/branches/1.0/mpid/ch_psm/process/mpispawn.c mvapich/branches/1.0/mpid/ch_smp/process/mpispawn.c Log: Change error message to a more relevant one. (Trac:179) Modified: mvapich/branches/1.0/mpid/ch_gen2/process/mpispawn.c =================================================================== --- mvapich/branches/1.0/mpid/ch_gen2/process/mpispawn.c 2008-03-09 21:22:30 UTC (rev 2230) +++ mvapich/branches/1.0/mpid/ch_gen2/process/mpispawn.c 2008-03-09 21:44:46 UTC (rev 2231) @@ -300,7 +300,7 @@ } else { - fprintf (stderr, "%s:%d Unexpected exit status\n", __FILE__, __LINE__); + fprintf (stderr, "MPI process terminated unexpectedly\n"); cleanup(); } } Modified: mvapich/branches/1.0/mpid/ch_gen2_ud/process/mpispawn.c =================================================================== --- mvapich/branches/1.0/mpid/ch_gen2_ud/process/mpispawn.c 2008-03-09 21:22:30 UTC (rev 2230) +++ mvapich/branches/1.0/mpid/ch_gen2_ud/process/mpispawn.c 2008-03-09 21:44:46 UTC (rev 2231) @@ -300,7 +300,7 @@ } else { - fprintf (stderr, "%s:%d Unexpected exit status\n", __FILE__, __LINE__); + fprintf (stderr, "MPI process terminated unexpectedly\n"); cleanup(); } } Modified: mvapich/branches/1.0/mpid/ch_psm/process/mpispawn.c =================================================================== --- mvapich/branches/1.0/mpid/ch_psm/process/mpispawn.c 2008-03-09 21:22:30 UTC (rev 2230) +++ mvapich/branches/1.0/mpid/ch_psm/process/mpispawn.c 2008-03-09 21:44:46 UTC (rev 2231) @@ -300,7 +300,7 @@ } else { - fprintf (stderr, "%s:%d Unexpected exit status\n", __FILE__, __LINE__); + fprintf (stderr, "MPI process terminated unexpectedly\n"); cleanup(); } } Modified: mvapich/branches/1.0/mpid/ch_smp/process/mpispawn.c =================================================================== --- mvapich/branches/1.0/mpid/ch_smp/process/mpispawn.c 2008-03-09 21:22:30 UTC (rev 2230) +++ mvapich/branches/1.0/mpid/ch_smp/process/mpispawn.c 2008-03-09 21:44:46 UTC (rev 2231) @@ -300,7 +300,7 @@ } else { - fprintf (stderr, "%s:%d Unexpected exit status\n", __FILE__, __LINE__); + fprintf (stderr, "MPI process terminated unexpectedly\n"); cleanup(); } } From sridharj at mvapich.cse.ohio-state.edu Sun Mar 9 17:45:14 2008 From: sridharj at mvapich.cse.ohio-state.edu (sridharj@mvapich.cse.ohio-state.edu) Date: Sun Mar 9 17:45:29 2008 Subject: [mvapich-commit] r2232 - in mvapich/trunk/mpid: ch_gen2/process ch_gen2_ud/process ch_psm/process ch_smp/process Message-ID: <200803092145.m29LjEn7009855@mvapich.cse.ohio-state.edu> Author: sridharj Date: 2008-03-09 17:45:13 -0400 (Sun, 09 Mar 2008) New Revision: 2232 Modified: mvapich/trunk/mpid/ch_gen2/process/mpispawn.c mvapich/trunk/mpid/ch_gen2_ud/process/mpispawn.c mvapich/trunk/mpid/ch_psm/process/mpispawn.c mvapich/trunk/mpid/ch_smp/process/mpispawn.c Log: Change error message to a more relevant one. (Trac:179) Modified: mvapich/trunk/mpid/ch_gen2/process/mpispawn.c =================================================================== --- mvapich/trunk/mpid/ch_gen2/process/mpispawn.c 2008-03-09 21:44:46 UTC (rev 2231) +++ mvapich/trunk/mpid/ch_gen2/process/mpispawn.c 2008-03-09 21:45:13 UTC (rev 2232) @@ -300,7 +300,7 @@ } else { - fprintf (stderr, "%s:%d Unexpected exit status\n", __FILE__, __LINE__); + fprintf (stderr, "MPI process terminated unexpectedly\n"); cleanup(); } } Modified: mvapich/trunk/mpid/ch_gen2_ud/process/mpispawn.c =================================================================== --- mvapich/trunk/mpid/ch_gen2_ud/process/mpispawn.c 2008-03-09 21:44:46 UTC (rev 2231) +++ mvapich/trunk/mpid/ch_gen2_ud/process/mpispawn.c 2008-03-09 21:45:13 UTC (rev 2232) @@ -300,7 +300,7 @@ } else { - fprintf (stderr, "%s:%d Unexpected exit status\n", __FILE__, __LINE__); + fprintf (stderr, "MPI process terminated unexpectedly\n"); cleanup(); } } Modified: mvapich/trunk/mpid/ch_psm/process/mpispawn.c =================================================================== --- mvapich/trunk/mpid/ch_psm/process/mpispawn.c 2008-03-09 21:44:46 UTC (rev 2231) +++ mvapich/trunk/mpid/ch_psm/process/mpispawn.c 2008-03-09 21:45:13 UTC (rev 2232) @@ -300,7 +300,7 @@ } else { - fprintf (stderr, "%s:%d Unexpected exit status\n", __FILE__, __LINE__); + fprintf (stderr, "MPI process terminated unexpectedly\n"); cleanup(); } } Modified: mvapich/trunk/mpid/ch_smp/process/mpispawn.c =================================================================== --- mvapich/trunk/mpid/ch_smp/process/mpispawn.c 2008-03-09 21:44:46 UTC (rev 2231) +++ mvapich/trunk/mpid/ch_smp/process/mpispawn.c 2008-03-09 21:45:13 UTC (rev 2232) @@ -300,7 +300,7 @@ } else { - fprintf (stderr, "%s:%d Unexpected exit status\n", __FILE__, __LINE__); + fprintf (stderr, "MPI process terminated unexpectedly\n"); cleanup(); } } From chail at mvapich.cse.ohio-state.edu Sun Mar 9 22:29:50 2008 From: chail at mvapich.cse.ohio-state.edu (chail@mvapich.cse.ohio-state.edu) Date: Sun Mar 9 22:30:07 2008 Subject: [mvapich-commit] r2236 - mvapich/tags/release-1.0/mpid/ch_smp/process Message-ID: <200803100229.m2A2ToHL010464@mvapich.cse.ohio-state.edu> Author: chail Date: 2008-03-09 22:29:48 -0400 (Sun, 09 Mar 2008) New Revision: 2236 Modified: mvapich/tags/release-1.0/mpid/ch_smp/process/mpirun_rsh.c Log: Allow users to omit hostnames for ch_smp devices. Modified: mvapich/tags/release-1.0/mpid/ch_smp/process/mpirun_rsh.c =================================================================== --- mvapich/tags/release-1.0/mpid/ch_smp/process/mpirun_rsh.c 2008-03-10 02:03:27 UTC (rev 2235) +++ mvapich/tags/release-1.0/mpid/ch_smp/process/mpirun_rsh.c 2008-03-10 02:29:48 UTC (rev 2236) @@ -189,7 +189,7 @@ int version; int timeout; - size_t hostname_len = 0; + size_t hostname_len = 256; totalview_cmd[199] = 0; display[0]='\0'; @@ -313,12 +313,9 @@ if (!hostfile_on) { /* get hostnames from argument list */ if (argc - optind < nprocs + 1) { - fprintf(stderr, "Without hostfile option, hostnames must be " - "specified on command line.\n"); - usage(); - exit(EXIT_FAILURE); + aout_index = optind; } - aout_index = nprocs + optind; + else aout_index = nprocs + optind; } else { aout_index = optind; } @@ -361,7 +358,8 @@ hostname_len = read_hostfile(hostfile); } else { for (i = 0; i < nprocs; i++) { - plist[i].hostname = (char *)strndup(argv[optind + i], 100); + plist[i].hostname = (char *)malloc(hostname_len); + gethostname(plist[i].hostname, hostname_len); hostname_len = hostname_len > strlen(plist[i].hostname) ? hostname_len : strlen(plist[i].hostname); } @@ -517,6 +515,10 @@ spawn_linear(argc, argv, totalview_cmd, env); + for (i = 0; i < nprocs; i++) { + free(plist[i].hostname); + } + if(show_on) exit(EXIT_SUCCESS); /* build up an array of file descriptors for pmgr_processops */ From chail at mvapich.cse.ohio-state.edu Sun Mar 9 22:33:50 2008 From: chail at mvapich.cse.ohio-state.edu (chail@mvapich.cse.ohio-state.edu) Date: Sun Mar 9 22:34:07 2008 Subject: [mvapich-commit] r2237 - mvapich/trunk/mpid/ch_smp/process Message-ID: <200803100233.m2A2Xo1B010498@mvapich.cse.ohio-state.edu> Author: chail Date: 2008-03-09 22:33:50 -0400 (Sun, 09 Mar 2008) New Revision: 2237 Modified: mvapich/trunk/mpid/ch_smp/process/mpirun_rsh.c Log: A minor fix to free a variable in a proper place. Modified: mvapich/trunk/mpid/ch_smp/process/mpirun_rsh.c =================================================================== --- mvapich/trunk/mpid/ch_smp/process/mpirun_rsh.c 2008-03-10 02:29:48 UTC (rev 2236) +++ mvapich/trunk/mpid/ch_smp/process/mpirun_rsh.c 2008-03-10 02:33:50 UTC (rev 2237) @@ -515,6 +515,10 @@ spawn_linear(argc, argv, totalview_cmd, env); + for (i = 0; i < nprocs; i++) { + free(plist[i].hostname); + } + if(show_on) exit(EXIT_SUCCESS); /* build up an array of file descriptors for pmgr_processops */ @@ -592,10 +596,6 @@ wait_for_errors (s, (struct sockaddr *)&sockaddr, sockaddr_len); - for (i = 0; i < nprocs; i++) { - free(plist[i].hostname); - } - /* * This return should never be reached. */ From chail at mvapich.cse.ohio-state.edu Tue Mar 18 13:33:08 2008 From: chail at mvapich.cse.ohio-state.edu (chail@mvapich.cse.ohio-state.edu) Date: Tue Mar 18 13:33:23 2008 Subject: [mvapich-commit] r2295 - mvapich/trunk Message-ID: <200803181733.m2IHX8U4024942@mvapich.cse.ohio-state.edu> Author: chail Date: 2008-03-18 13:33:07 -0400 (Tue, 18 Mar 2008) New Revision: 2295 Modified: mvapich/trunk/CHANGELOG Log: Edited changelog. Modified: mvapich/trunk/CHANGELOG =================================================================== --- mvapich/trunk/CHANGELOG 2008-03-14 21:53:24 UTC (rev 2294) +++ mvapich/trunk/CHANGELOG 2008-03-18 17:33:07 UTC (rev 2295) @@ -4,6 +4,9 @@ This file briefly describes the latest changes to MVAPICH software package. The logs are arranged in the "most recent first" order. +01/24/2008 +* Enabled user specified cpu binding. + 10/29/2007 * Added the typo patch provided by pat latifi@qlogic From chail at mvapich.cse.ohio-state.edu Tue Mar 18 13:35:04 2008 From: chail at mvapich.cse.ohio-state.edu (chail@mvapich.cse.ohio-state.edu) Date: Tue Mar 18 13:35:23 2008 Subject: [mvapich-commit] r2296 - mvapich/tags/release-1.0 Message-ID: <200803181735.m2IHZ4xB024954@mvapich.cse.ohio-state.edu> Author: chail Date: 2008-03-18 13:35:04 -0400 (Tue, 18 Mar 2008) New Revision: 2296 Modified: mvapich/tags/release-1.0/CHANGELOG Log: Edited changelog. Modified: mvapich/tags/release-1.0/CHANGELOG =================================================================== --- mvapich/tags/release-1.0/CHANGELOG 2008-03-18 17:33:07 UTC (rev 2295) +++ mvapich/tags/release-1.0/CHANGELOG 2008-03-18 17:35:04 UTC (rev 2296) @@ -4,6 +4,9 @@ This file briefly describes the latest changes to MVAPICH software package. The logs are arranged in the "most recent first" order. +01/24/2008 +* Enabled user specified cpu binding. + 10/29/2007 * Added the typo patch provided by pat latifi@qlogic From noronha at mvapich.cse.ohio-state.edu Tue Mar 18 15:28:56 2008 From: noronha at mvapich.cse.ohio-state.edu (noronha@mvapich.cse.ohio-state.edu) Date: Tue Mar 18 15:29:14 2008 Subject: [mvapich-commit] r2297 - mvapich/trunk Message-ID: <200803181928.m2IJSujL025278@mvapich.cse.ohio-state.edu> Author: noronha Date: 2008-03-18 15:28:55 -0400 (Tue, 18 Mar 2008) New Revision: 2297 Modified: mvapich/trunk/CHANGELOG Log: Lustre ADIO driver. Modified: mvapich/trunk/CHANGELOG =================================================================== --- mvapich/trunk/CHANGELOG 2008-03-18 17:35:04 UTC (rev 2296) +++ mvapich/trunk/CHANGELOG 2008-03-18 19:28:55 UTC (rev 2297) @@ -4,6 +4,9 @@ This file briefly describes the latest changes to MVAPICH software package. The logs are arranged in the "most recent first" order. +02/01/2008 +* Add Lustre ADIO driver. This is a contribution from Future Technologies Group, Oak Ridge National Laboratory. + 01/24/2008 * Enabled user specified cpu binding. From chail at mvapich.cse.ohio-state.edu Tue Mar 25 11:58:51 2008 From: chail at mvapich.cse.ohio-state.edu (chail@mvapich.cse.ohio-state.edu) Date: Tue Mar 25 11:58:56 2008 Subject: [mvapich-commit] r2321 - in mvapich/trunk/mpid: ch_gen2 ch_gen2_ud ch_psm ch_smp Message-ID: <200803251558.m2PFwpCA006136@mvapich.cse.ohio-state.edu> Author: chail Date: 2008-03-25 11:58:51 -0400 (Tue, 25 Mar 2008) New Revision: 2321 Modified: mvapich/trunk/mpid/ch_gen2/viainit.c mvapich/trunk/mpid/ch_gen2_ud/mv_init.c mvapich/trunk/mpid/ch_psm/psminit.c mvapich/trunk/mpid/ch_smp/viainit.c Log: Free the string cpu_mapping. Modified: mvapich/trunk/mpid/ch_gen2/viainit.c =================================================================== --- mvapich/trunk/mpid/ch_gen2/viainit.c 2008-03-25 15:53:20 UTC (rev 2320) +++ mvapich/trunk/mpid/ch_gen2/viainit.c 2008-03-25 15:58:51 UTC (rev 2321) @@ -154,6 +154,8 @@ tp = cp + 1; j++; } + + free(cpu_mapping); } else { /* The user has not specified how to map the processes, * use the default scheme Modified: mvapich/trunk/mpid/ch_gen2_ud/mv_init.c =================================================================== --- mvapich/trunk/mpid/ch_gen2_ud/mv_init.c 2008-03-25 15:53:20 UTC (rev 2320) +++ mvapich/trunk/mpid/ch_gen2_ud/mv_init.c 2008-03-25 15:58:51 UTC (rev 2321) @@ -97,6 +97,8 @@ tp = cp + 1; j++; } + + free(cpu_mapping); } else { /* The user has not specified how to map the processes, * use the default scheme Modified: mvapich/trunk/mpid/ch_psm/psminit.c =================================================================== --- mvapich/trunk/mpid/ch_psm/psminit.c 2008-03-25 15:53:20 UTC (rev 2320) +++ mvapich/trunk/mpid/ch_psm/psminit.c 2008-03-25 15:58:51 UTC (rev 2321) @@ -102,6 +102,8 @@ tp = cp + 1; j++; } + + free(cpu_mapping); } else { /* The user has not specified how to map the processes, * use the default scheme Modified: mvapich/trunk/mpid/ch_smp/viainit.c =================================================================== --- mvapich/trunk/mpid/ch_smp/viainit.c 2008-03-25 15:53:20 UTC (rev 2320) +++ mvapich/trunk/mpid/ch_smp/viainit.c 2008-03-25 15:58:51 UTC (rev 2321) @@ -398,6 +398,8 @@ tp = cp + 1; j++; } + + free(cpu_mapping); } else { /* The user has not specified how to map the processes, * use the default scheme From chail at mvapich.cse.ohio-state.edu Tue Mar 25 12:05:53 2008 From: chail at mvapich.cse.ohio-state.edu (chail@mvapich.cse.ohio-state.edu) Date: Tue Mar 25 12:06:00 2008 Subject: [mvapich-commit] r2322 - in mvapich/tags/release-1.0/mpid: ch_gen2 ch_gen2_ud ch_psm ch_smp Message-ID: <200803251605.m2PG5rAQ006176@mvapich.cse.ohio-state.edu> Author: chail Date: 2008-03-25 12:05:52 -0400 (Tue, 25 Mar 2008) New Revision: 2322 Modified: mvapich/tags/release-1.0/mpid/ch_gen2/viainit.c mvapich/tags/release-1.0/mpid/ch_gen2_ud/mv_init.c mvapich/tags/release-1.0/mpid/ch_psm/psminit.c mvapich/tags/release-1.0/mpid/ch_smp/viainit.c Log: Free the string cpu_mappnig. Modified: mvapich/tags/release-1.0/mpid/ch_gen2/viainit.c =================================================================== --- mvapich/tags/release-1.0/mpid/ch_gen2/viainit.c 2008-03-25 15:58:51 UTC (rev 2321) +++ mvapich/tags/release-1.0/mpid/ch_gen2/viainit.c 2008-03-25 16:05:52 UTC (rev 2322) @@ -154,6 +154,8 @@ tp = cp + 1; j++; } + + free(cpu_mapping); } else { /* The user has not specified how to map the processes, * use the default scheme Modified: mvapich/tags/release-1.0/mpid/ch_gen2_ud/mv_init.c =================================================================== --- mvapich/tags/release-1.0/mpid/ch_gen2_ud/mv_init.c 2008-03-25 15:58:51 UTC (rev 2321) +++ mvapich/tags/release-1.0/mpid/ch_gen2_ud/mv_init.c 2008-03-25 16:05:52 UTC (rev 2322) @@ -97,6 +97,8 @@ tp = cp + 1; j++; } + + free(cpu_mapping); } else { /* The user has not specified how to map the processes, * use the default scheme Modified: mvapich/tags/release-1.0/mpid/ch_psm/psminit.c =================================================================== --- mvapich/tags/release-1.0/mpid/ch_psm/psminit.c 2008-03-25 15:58:51 UTC (rev 2321) +++ mvapich/tags/release-1.0/mpid/ch_psm/psminit.c 2008-03-25 16:05:52 UTC (rev 2322) @@ -102,6 +102,8 @@ tp = cp + 1; j++; } + + free(cpu_mapping); } else { /* The user has not specified how to map the processes, * use the default scheme Modified: mvapich/tags/release-1.0/mpid/ch_smp/viainit.c =================================================================== --- mvapich/tags/release-1.0/mpid/ch_smp/viainit.c 2008-03-25 15:58:51 UTC (rev 2321) +++ mvapich/tags/release-1.0/mpid/ch_smp/viainit.c 2008-03-25 16:05:52 UTC (rev 2322) @@ -398,6 +398,8 @@ tp = cp + 1; j++; } + + free(cpu_mapping); } else { /* The user has not specified how to map the processes, * use the default scheme From chail at mvapich.cse.ohio-state.edu Tue Mar 25 13:16:08 2008 From: chail at mvapich.cse.ohio-state.edu (chail@mvapich.cse.ohio-state.edu) Date: Tue Mar 25 13:16:16 2008 Subject: [mvapich-commit] r2324 - in mvapich/branches/1.0/mpid: ch_gen2 ch_gen2_ud ch_psm ch_smp Message-ID: <200803251716.m2PHG89V006376@mvapich.cse.ohio-state.edu> Author: chail Date: 2008-03-25 13:16:07 -0400 (Tue, 25 Mar 2008) New Revision: 2324 Modified: mvapich/branches/1.0/mpid/ch_gen2/viainit.c mvapich/branches/1.0/mpid/ch_gen2_ud/mv_init.c mvapich/branches/1.0/mpid/ch_psm/psminit.c mvapich/branches/1.0/mpid/ch_smp/viainit.c Log: Free the string cpu_mapping to 1.0 branch. Modified: mvapich/branches/1.0/mpid/ch_gen2/viainit.c =================================================================== --- mvapich/branches/1.0/mpid/ch_gen2/viainit.c 2008-03-25 16:17:11 UTC (rev 2323) +++ mvapich/branches/1.0/mpid/ch_gen2/viainit.c 2008-03-25 17:16:07 UTC (rev 2324) @@ -154,6 +154,8 @@ tp = cp + 1; j++; } + + free(cpu_mapping); } else { /* The user has not specified how to map the processes, * use the default scheme Modified: mvapich/branches/1.0/mpid/ch_gen2_ud/mv_init.c =================================================================== --- mvapich/branches/1.0/mpid/ch_gen2_ud/mv_init.c 2008-03-25 16:17:11 UTC (rev 2323) +++ mvapich/branches/1.0/mpid/ch_gen2_ud/mv_init.c 2008-03-25 17:16:07 UTC (rev 2324) @@ -97,6 +97,8 @@ tp = cp + 1; j++; } + + free(cpu_mapping); } else { /* The user has not specified how to map the processes, * use the default scheme Modified: mvapich/branches/1.0/mpid/ch_psm/psminit.c =================================================================== --- mvapich/branches/1.0/mpid/ch_psm/psminit.c 2008-03-25 16:17:11 UTC (rev 2323) +++ mvapich/branches/1.0/mpid/ch_psm/psminit.c 2008-03-25 17:16:07 UTC (rev 2324) @@ -102,6 +102,8 @@ tp = cp + 1; j++; } + + free(cpu_mapping); } else { /* The user has not specified how to map the processes, * use the default scheme Modified: mvapich/branches/1.0/mpid/ch_smp/viainit.c =================================================================== --- mvapich/branches/1.0/mpid/ch_smp/viainit.c 2008-03-25 16:17:11 UTC (rev 2323) +++ mvapich/branches/1.0/mpid/ch_smp/viainit.c 2008-03-25 17:16:07 UTC (rev 2324) @@ -398,6 +398,8 @@ tp = cp + 1; j++; } + + free(cpu_mapping); } else { /* The user has not specified how to map the processes, * use the default scheme From chail at mvapich.cse.ohio-state.edu Tue Mar 25 13:17:14 2008 From: chail at mvapich.cse.ohio-state.edu (chail@mvapich.cse.ohio-state.edu) Date: Tue Mar 25 13:17:20 2008 Subject: [mvapich-commit] r2325 - in mvapich/tags/release-1.0/mpid: ch_gen2 ch_gen2_ud ch_psm ch_smp Message-ID: <200803251717.m2PHHEAX006390@mvapich.cse.ohio-state.edu> Author: chail Date: 2008-03-25 13:17:11 -0400 (Tue, 25 Mar 2008) New Revision: 2325 Modified: mvapich/tags/release-1.0/mpid/ch_gen2/viainit.c mvapich/tags/release-1.0/mpid/ch_gen2_ud/mv_init.c mvapich/tags/release-1.0/mpid/ch_psm/psminit.c mvapich/tags/release-1.0/mpid/ch_smp/viainit.c Log: Keep 1.0 tagged version unmodified. Modified: mvapich/tags/release-1.0/mpid/ch_gen2/viainit.c =================================================================== --- mvapich/tags/release-1.0/mpid/ch_gen2/viainit.c 2008-03-25 17:16:07 UTC (rev 2324) +++ mvapich/tags/release-1.0/mpid/ch_gen2/viainit.c 2008-03-25 17:17:11 UTC (rev 2325) @@ -154,8 +154,6 @@ tp = cp + 1; j++; } - - free(cpu_mapping); } else { /* The user has not specified how to map the processes, * use the default scheme Modified: mvapich/tags/release-1.0/mpid/ch_gen2_ud/mv_init.c =================================================================== --- mvapich/tags/release-1.0/mpid/ch_gen2_ud/mv_init.c 2008-03-25 17:16:07 UTC (rev 2324) +++ mvapich/tags/release-1.0/mpid/ch_gen2_ud/mv_init.c 2008-03-25 17:17:11 UTC (rev 2325) @@ -97,8 +97,6 @@ tp = cp + 1; j++; } - - free(cpu_mapping); } else { /* The user has not specified how to map the processes, * use the default scheme Modified: mvapich/tags/release-1.0/mpid/ch_psm/psminit.c =================================================================== --- mvapich/tags/release-1.0/mpid/ch_psm/psminit.c 2008-03-25 17:16:07 UTC (rev 2324) +++ mvapich/tags/release-1.0/mpid/ch_psm/psminit.c 2008-03-25 17:17:11 UTC (rev 2325) @@ -102,8 +102,6 @@ tp = cp + 1; j++; } - - free(cpu_mapping); } else { /* The user has not specified how to map the processes, * use the default scheme Modified: mvapich/tags/release-1.0/mpid/ch_smp/viainit.c =================================================================== --- mvapich/tags/release-1.0/mpid/ch_smp/viainit.c 2008-03-25 17:16:07 UTC (rev 2324) +++ mvapich/tags/release-1.0/mpid/ch_smp/viainit.c 2008-03-25 17:17:11 UTC (rev 2325) @@ -398,8 +398,6 @@ tp = cp + 1; j++; } - - free(cpu_mapping); } else { /* The user has not specified how to map the processes, * use the default scheme From sridharj at mvapich.cse.ohio-state.edu Mon Mar 31 13:11:52 2008 From: sridharj at mvapich.cse.ohio-state.edu (sridharj@mvapich.cse.ohio-state.edu) Date: Mon Mar 31 13:11:59 2008 Subject: [mvapich-commit] r2354 - in mvapich/trunk/mpid: ch_gen2/process ch_gen2_ud/process ch_psm/process ch_smp/process Message-ID: <200803311711.m2VHBq4Z010474@mvapich.cse.ohio-state.edu> Author: sridharj Date: 2008-03-31 13:11:52 -0400 (Mon, 31 Mar 2008) New Revision: 2354 Modified: mvapich/trunk/mpid/ch_gen2/process/mpirun_rsh.c mvapich/trunk/mpid/ch_gen2_ud/process/mpirun_rsh.c mvapich/trunk/mpid/ch_psm/process/mpirun_rsh.c mvapich/trunk/mpid/ch_smp/process/mpirun_rsh.c Log: Startup: Try to find mpispawn in the same directory where we found mpirun_rsh. Modified: mvapich/trunk/mpid/ch_gen2/process/mpirun_rsh.c =================================================================== --- mvapich/trunk/mpid/ch_gen2/process/mpirun_rsh.c 2008-03-31 17:11:36 UTC (rev 2353) +++ mvapich/trunk/mpid/ch_gen2/process/mpirun_rsh.c 2008-03-31 17:11:52 UTC (rev 2354) @@ -1591,10 +1591,43 @@ } } +int file_exists (char *filename) +{ + FILE *fp = fopen (filename, "r"); + if (fp) { + fclose (fp); + return 1; + } + return 0; +} + +int getpath(char *buf, int buf_len) +{ + char link[32]; + pid_t pid; + unsigned len; + pid = getpid(); + snprintf(&link[0], sizeof(link), "/proc/%i/exe", pid); + + if ((len = readlink(&link[0], buf, buf_len)) == -1) { + buf[0] = 0; + return 0; + } + else + { + buf[len] = 0; + while (len && buf[--len] != '/'); + if (buf[len] == '/') buf[len] = 0; + return len; + } +} + void spawn_fast(int argc, char *argv[], char *totalview_cmd, char *env) { char * mpispawn_env, * tmp, * ld_library_path; char * name, * value; int i, n; + char pathbuf[PATH_MAX]; + int pathlen; if(ld_library_path = getenv("LD_LIBRARY_PATH")) { mpispawn_env = mkstr("MPISPAWN_LD_LIBRARY_PATH=%s:%s", @@ -1898,13 +1931,19 @@ argv[arg_offset++] = SSH_CMD; argv[arg_offset++] = SSH_ARG; } - - if (use_dirname) + + if (getpath(pathbuf, PATH_MAX) && file_exists (pathbuf)) { command = mkstr("cd %s; %s %s %s %s/mpispawn", wd, ENV_CMD, + mpispawn_env, env, pathbuf); + } + else if (use_dirname) { + command = mkstr("cd %s; %s %s %s %s/mpispawn", wd, ENV_CMD, mpispawn_env, env, binary_dirname); - else + } + else { command = mkstr("cd %s; %s %s %s mpispawn", wd, ENV_CMD, mpispawn_env, env); + } if(!command) { fprintf(stderr, "Couldn't allocate string for remote command!\n"); Modified: mvapich/trunk/mpid/ch_gen2_ud/process/mpirun_rsh.c =================================================================== --- mvapich/trunk/mpid/ch_gen2_ud/process/mpirun_rsh.c 2008-03-31 17:11:36 UTC (rev 2353) +++ mvapich/trunk/mpid/ch_gen2_ud/process/mpirun_rsh.c 2008-03-31 17:11:52 UTC (rev 2354) @@ -1591,10 +1591,43 @@ } } +int file_exists (char *filename) +{ + FILE *fp = fopen (filename, "r"); + if (fp) { + fclose (fp); + return 1; + } + return 0; +} + +int getpath(char *buf, int buf_len) +{ + char link[32]; + pid_t pid; + unsigned len; + pid = getpid(); + snprintf(&link[0], sizeof(link), "/proc/%i/exe", pid); + + if ((len = readlink(&link[0], buf, buf_len)) == -1) { + buf[0] = 0; + return 0; + } + else + { + buf[len] = 0; + while (len && buf[--len] != '/'); + if (buf[len] == '/') buf[len] = 0; + return len; + } +} + void spawn_fast(int argc, char *argv[], char *totalview_cmd, char *env) { char * mpispawn_env, * tmp, * ld_library_path; char * name, * value; int i, n; + char pathbuf[PATH_MAX]; + int pathlen; if(ld_library_path = getenv("LD_LIBRARY_PATH")) { mpispawn_env = mkstr("MPISPAWN_LD_LIBRARY_PATH=%s:%s", @@ -1898,13 +1931,19 @@ argv[arg_offset++] = SSH_CMD; argv[arg_offset++] = SSH_ARG; } - - if (use_dirname) + + if (getpath(pathbuf, PATH_MAX) && file_exists (pathbuf)) { command = mkstr("cd %s; %s %s %s %s/mpispawn", wd, ENV_CMD, + mpispawn_env, env, pathbuf); + } + else if (use_dirname) { + command = mkstr("cd %s; %s %s %s %s/mpispawn", wd, ENV_CMD, mpispawn_env, env, binary_dirname); - else + } + else { command = mkstr("cd %s; %s %s %s mpispawn", wd, ENV_CMD, mpispawn_env, env); + } if(!command) { fprintf(stderr, "Couldn't allocate string for remote command!\n"); Modified: mvapich/trunk/mpid/ch_psm/process/mpirun_rsh.c =================================================================== --- mvapich/trunk/mpid/ch_psm/process/mpirun_rsh.c 2008-03-31 17:11:36 UTC (rev 2353) +++ mvapich/trunk/mpid/ch_psm/process/mpirun_rsh.c 2008-03-31 17:11:52 UTC (rev 2354) @@ -1591,10 +1591,43 @@ } } +int file_exists (char *filename) +{ + FILE *fp = fopen (filename, "r"); + if (fp) { + fclose (fp); + return 1; + } + return 0; +} + +int getpath(char *buf, int buf_len) +{ + char link[32]; + pid_t pid; + unsigned len; + pid = getpid(); + snprintf(&link[0], sizeof(link), "/proc/%i/exe", pid); + + if ((len = readlink(&link[0], buf, buf_len)) == -1) { + buf[0] = 0; + return 0; + } + else + { + buf[len] = 0; + while (len && buf[--len] != '/'); + if (buf[len] == '/') buf[len] = 0; + return len; + } +} + void spawn_fast(int argc, char *argv[], char *totalview_cmd, char *env) { char * mpispawn_env, * tmp, * ld_library_path; char * name, * value; int i, n; + char pathbuf[PATH_MAX]; + int pathlen; if(ld_library_path = getenv("LD_LIBRARY_PATH")) { mpispawn_env = mkstr("MPISPAWN_LD_LIBRARY_PATH=%s:%s", @@ -1898,13 +1931,19 @@ argv[arg_offset++] = SSH_CMD; argv[arg_offset++] = SSH_ARG; } - - if (use_dirname) + + if (getpath(pathbuf, PATH_MAX) && file_exists (pathbuf)) { command = mkstr("cd %s; %s %s %s %s/mpispawn", wd, ENV_CMD, + mpispawn_env, env, pathbuf); + } + else if (use_dirname) { + command = mkstr("cd %s; %s %s %s %s/mpispawn", wd, ENV_CMD, mpispawn_env, env, binary_dirname); - else + } + else { command = mkstr("cd %s; %s %s %s mpispawn", wd, ENV_CMD, mpispawn_env, env); + } if(!command) { fprintf(stderr, "Couldn't allocate string for remote command!\n"); Modified: mvapich/trunk/mpid/ch_smp/process/mpirun_rsh.c =================================================================== --- mvapich/trunk/mpid/ch_smp/process/mpirun_rsh.c 2008-03-31 17:11:36 UTC (rev 2353) +++ mvapich/trunk/mpid/ch_smp/process/mpirun_rsh.c 2008-03-31 17:11:52 UTC (rev 2354) @@ -1593,10 +1593,43 @@ } } +int file_exists (char *filename) +{ + FILE *fp = fopen (filename, "r"); + if (fp) { + fclose (fp); + return 1; + } + return 0; +} + +int getpath(char *buf, int buf_len) +{ + char link[32]; + pid_t pid; + unsigned len; + pid = getpid(); + snprintf(&link[0], sizeof(link), "/proc/%i/exe", pid); + + if ((len = readlink(&link[0], buf, buf_len)) == -1) { + buf[0] = 0; + return 0; + } + else + { + buf[len] = 0; + while (len && buf[--len] != '/'); + if (buf[len] == '/') buf[len] = 0; + return len; + } +} + void spawn_fast(int argc, char *argv[], char *totalview_cmd, char *env) { char * mpispawn_env, * tmp, * ld_library_path; char * name, * value; int i, n; + char pathbuf[PATH_MAX]; + int pathlen; if(ld_library_path = getenv("LD_LIBRARY_PATH")) { mpispawn_env = mkstr("MPISPAWN_LD_LIBRARY_PATH=%s:%s", @@ -1900,13 +1933,19 @@ argv[arg_offset++] = SSH_CMD; argv[arg_offset++] = SSH_ARG; } - - if (use_dirname) + + if (getpath(pathbuf, PATH_MAX) && file_exists (pathbuf)) { command = mkstr("cd %s; %s %s %s %s/mpispawn", wd, ENV_CMD, + mpispawn_env, env, pathbuf); + } + else if (use_dirname) { + command = mkstr("cd %s; %s %s %s %s/mpispawn", wd, ENV_CMD, mpispawn_env, env, binary_dirname); - else + } + else { command = mkstr("cd %s; %s %s %s mpispawn", wd, ENV_CMD, mpispawn_env, env); + } if(!command) { fprintf(stderr, "Couldn't allocate string for remote command!\n"); From sridharj at mvapich.cse.ohio-state.edu Mon Mar 31 13:11:37 2008 From: sridharj at mvapich.cse.ohio-state.edu (sridharj@mvapich.cse.ohio-state.edu) Date: Mon Mar 31 13:12:04 2008 Subject: [mvapich-commit] r2353 - in mvapich/branches/1.0/mpid: ch_gen2/process ch_gen2_ud/process ch_psm/process ch_smp/process Message-ID: <200803311711.m2VHBbhk010464@mvapich.cse.ohio-state.edu> Author: sridharj Date: 2008-03-31 13:11:36 -0400 (Mon, 31 Mar 2008) New Revision: 2353 Modified: mvapich/branches/1.0/mpid/ch_gen2/process/mpirun_rsh.c mvapich/branches/1.0/mpid/ch_gen2_ud/process/mpirun_rsh.c mvapich/branches/1.0/mpid/ch_psm/process/mpirun_rsh.c mvapich/branches/1.0/mpid/ch_smp/process/mpirun_rsh.c Log: Startup: Try to find mpispawn in the same directory where we found mpirun_rsh. Modified: mvapich/branches/1.0/mpid/ch_gen2/process/mpirun_rsh.c =================================================================== --- mvapich/branches/1.0/mpid/ch_gen2/process/mpirun_rsh.c 2008-03-31 14:30:19 UTC (rev 2352) +++ mvapich/branches/1.0/mpid/ch_gen2/process/mpirun_rsh.c 2008-03-31 17:11:36 UTC (rev 2353) @@ -1591,10 +1591,43 @@ } } +int file_exists (char *filename) +{ + FILE *fp = fopen (filename, "r"); + if (fp) { + fclose (fp); + return 1; + } + return 0; +} + +int getpath(char *buf, int buf_len) +{ + char link[32]; + pid_t pid; + unsigned len; + pid = getpid(); + snprintf(&link[0], sizeof(link), "/proc/%i/exe", pid); + + if ((len = readlink(&link[0], buf, buf_len)) == -1) { + buf[0] = 0; + return 0; + } + else + { + buf[len] = 0; + while (len && buf[--len] != '/'); + if (buf[len] == '/') buf[len] = 0; + return len; + } +} + void spawn_fast(int argc, char *argv[], char *totalview_cmd, char *env) { char * mpispawn_env, * tmp, * ld_library_path; char * name, * value; int i, n; + char pathbuf[PATH_MAX]; + int pathlen; if(ld_library_path = getenv("LD_LIBRARY_PATH")) { mpispawn_env = mkstr("MPISPAWN_LD_LIBRARY_PATH=%s:%s", @@ -1898,13 +1931,19 @@ argv[arg_offset++] = SSH_CMD; argv[arg_offset++] = SSH_ARG; } - - if (use_dirname) + + if (getpath(pathbuf, PATH_MAX) && file_exists (pathbuf)) { command = mkstr("cd %s; %s %s %s %s/mpispawn", wd, ENV_CMD, + mpispawn_env, env, pathbuf); + } + else if (use_dirname) { + command = mkstr("cd %s; %s %s %s %s/mpispawn", wd, ENV_CMD, mpispawn_env, env, binary_dirname); - else + } + else { command = mkstr("cd %s; %s %s %s mpispawn", wd, ENV_CMD, mpispawn_env, env); + } if(!command) { fprintf(stderr, "Couldn't allocate string for remote command!\n"); Modified: mvapich/branches/1.0/mpid/ch_gen2_ud/process/mpirun_rsh.c =================================================================== --- mvapich/branches/1.0/mpid/ch_gen2_ud/process/mpirun_rsh.c 2008-03-31 14:30:19 UTC (rev 2352) +++ mvapich/branches/1.0/mpid/ch_gen2_ud/process/mpirun_rsh.c 2008-03-31 17:11:36 UTC (rev 2353) @@ -1591,10 +1591,43 @@ } } +int file_exists (char *filename) +{ + FILE *fp = fopen (filename, "r"); + if (fp) { + fclose (fp); + return 1; + } + return 0; +} + +int getpath(char *buf, int buf_len) +{ + char link[32]; + pid_t pid; + unsigned len; + pid = getpid(); + snprintf(&link[0], sizeof(link), "/proc/%i/exe", pid); + + if ((len = readlink(&link[0], buf, buf_len)) == -1) { + buf[0] = 0; + return 0; + } + else + { + buf[len] = 0; + while (len && buf[--len] != '/'); + if (buf[len] == '/') buf[len] = 0; + return len; + } +} + void spawn_fast(int argc, char *argv[], char *totalview_cmd, char *env) { char * mpispawn_env, * tmp, * ld_library_path; char * name, * value; int i, n; + char pathbuf[PATH_MAX]; + int pathlen; if(ld_library_path = getenv("LD_LIBRARY_PATH")) { mpispawn_env = mkstr("MPISPAWN_LD_LIBRARY_PATH=%s:%s", @@ -1898,13 +1931,19 @@ argv[arg_offset++] = SSH_CMD; argv[arg_offset++] = SSH_ARG; } - - if (use_dirname) + + if (getpath(pathbuf, PATH_MAX) && file_exists (pathbuf)) { command = mkstr("cd %s; %s %s %s %s/mpispawn", wd, ENV_CMD, + mpispawn_env, env, pathbuf); + } + else if (use_dirname) { + command = mkstr("cd %s; %s %s %s %s/mpispawn", wd, ENV_CMD, mpispawn_env, env, binary_dirname); - else + } + else { command = mkstr("cd %s; %s %s %s mpispawn", wd, ENV_CMD, mpispawn_env, env); + } if(!command) { fprintf(stderr, "Couldn't allocate string for remote command!\n"); Modified: mvapich/branches/1.0/mpid/ch_psm/process/mpirun_rsh.c =================================================================== --- mvapich/branches/1.0/mpid/ch_psm/process/mpirun_rsh.c 2008-03-31 14:30:19 UTC (rev 2352) +++ mvapich/branches/1.0/mpid/ch_psm/process/mpirun_rsh.c 2008-03-31 17:11:36 UTC (rev 2353) @@ -1591,10 +1591,43 @@ } } +int file_exists (char *filename) +{ + FILE *fp = fopen (filename, "r"); + if (fp) { + fclose (fp); + return 1; + } + return 0; +} + +int getpath(char *buf, int buf_len) +{ + char link[32]; + pid_t pid; + unsigned len; + pid = getpid(); + snprintf(&link[0], sizeof(link), "/proc/%i/exe", pid); + + if ((len = readlink(&link[0], buf, buf_len)) == -1) { + buf[0] = 0; + return 0; + } + else + { + buf[len] = 0; + while (len && buf[--len] != '/'); + if (buf[len] == '/') buf[len] = 0; + return len; + } +} + void spawn_fast(int argc, char *argv[], char *totalview_cmd, char *env) { char * mpispawn_env, * tmp, * ld_library_path; char * name, * value; int i, n; + char pathbuf[PATH_MAX]; + int pathlen; if(ld_library_path = getenv("LD_LIBRARY_PATH")) { mpispawn_env = mkstr("MPISPAWN_LD_LIBRARY_PATH=%s:%s", @@ -1898,13 +1931,19 @@ argv[arg_offset++] = SSH_CMD; argv[arg_offset++] = SSH_ARG; } - - if (use_dirname) + + if (getpath(pathbuf, PATH_MAX) && file_exists (pathbuf)) { command = mkstr("cd %s; %s %s %s %s/mpispawn", wd, ENV_CMD, + mpispawn_env, env, pathbuf); + } + else if (use_dirname) { + command = mkstr("cd %s; %s %s %s %s/mpispawn", wd, ENV_CMD, mpispawn_env, env, binary_dirname); - else + } + else { command = mkstr("cd %s; %s %s %s mpispawn", wd, ENV_CMD, mpispawn_env, env); + } if(!command) { fprintf(stderr, "Couldn't allocate string for remote command!\n"); Modified: mvapich/branches/1.0/mpid/ch_smp/process/mpirun_rsh.c =================================================================== --- mvapich/branches/1.0/mpid/ch_smp/process/mpirun_rsh.c 2008-03-31 14:30:19 UTC (rev 2352) +++ mvapich/branches/1.0/mpid/ch_smp/process/mpirun_rsh.c 2008-03-31 17:11:36 UTC (rev 2353) @@ -1591,10 +1591,43 @@ } } +int file_exists (char *filename) +{ + FILE *fp = fopen (filename, "r"); + if (fp) { + fclose (fp); + return 1; + } + return 0; +} + +int getpath(char *buf, int buf_len) +{ + char link[32]; + pid_t pid; + unsigned len; + pid = getpid(); + snprintf(&link[0], sizeof(link), "/proc/%i/exe", pid); + + if ((len = readlink(&link[0], buf, buf_len)) == -1) { + buf[0] = 0; + return 0; + } + else + { + buf[len] = 0; + while (len && buf[--len] != '/'); + if (buf[len] == '/') buf[len] = 0; + return len; + } +} + void spawn_fast(int argc, char *argv[], char *totalview_cmd, char *env) { char * mpispawn_env, * tmp, * ld_library_path; char * name, * value; int i, n; + char pathbuf[PATH_MAX]; + int pathlen; if(ld_library_path = getenv("LD_LIBRARY_PATH")) { mpispawn_env = mkstr("MPISPAWN_LD_LIBRARY_PATH=%s:%s", @@ -1898,13 +1931,19 @@ argv[arg_offset++] = SSH_CMD; argv[arg_offset++] = SSH_ARG; } - - if (use_dirname) + + if (getpath(pathbuf, PATH_MAX) && file_exists (pathbuf)) { command = mkstr("cd %s; %s %s %s %s/mpispawn", wd, ENV_CMD, + mpispawn_env, env, pathbuf); + } + else if (use_dirname) { + command = mkstr("cd %s; %s %s %s %s/mpispawn", wd, ENV_CMD, mpispawn_env, env, binary_dirname); - else + } + else { command = mkstr("cd %s; %s %s %s mpispawn", wd, ENV_CMD, mpispawn_env, env); + } if(!command) { fprintf(stderr, "Couldn't allocate string for remote command!\n"); From sridharj at mvapich.cse.ohio-state.edu Mon Mar 31 13:17:36 2008 From: sridharj at mvapich.cse.ohio-state.edu (sridharj@mvapich.cse.ohio-state.edu) Date: Mon Mar 31 13:17:50 2008 Subject: [mvapich-commit] r2355 - in mvapich/branches/1.0/mpid: ch_gen2/process ch_gen2_ud/process ch_psm/process ch_smp/process Message-ID: <200803311717.m2VHHaQ6010529@mvapich.cse.ohio-state.edu> Author: sridharj Date: 2008-03-31 13:17:36 -0400 (Mon, 31 Mar 2008) New Revision: 2355 Modified: mvapich/branches/1.0/mpid/ch_gen2/process/mpispawn.c mvapich/branches/1.0/mpid/ch_gen2_ud/process/mpispawn.c mvapich/branches/1.0/mpid/ch_psm/process/mpispawn.c mvapich/branches/1.0/mpid/ch_smp/process/mpispawn.c Log: On a few occasions, some processes weren't getting cleaned up on MPI_Abort. Modified: mvapich/branches/1.0/mpid/ch_gen2/process/mpispawn.c =================================================================== --- mvapich/branches/1.0/mpid/ch_gen2/process/mpispawn.c 2008-03-31 17:11:52 UTC (rev 2354) +++ mvapich/branches/1.0/mpid/ch_gen2/process/mpispawn.c 2008-03-31 17:17:36 UTC (rev 2355) @@ -393,7 +393,7 @@ sockaddr_len) { int wfe_socket, wfe_abort_code, wfe_abort_rank, wfe_abort_msglen; - +WFE: while ((wfe_socket = accept(s, sockaddr, &sockaddr_len)) < 0) { if (errno == EINTR || errno == EAGAIN) continue; @@ -409,11 +409,12 @@ } else { char wfe_abort_message[wfe_abort_msglen]; - fprintf (stderr, "Abort signaled rank %d:", wfe_abort_rank); + fprintf (stderr, "Abort signaled by rank %d: ", wfe_abort_rank); if (!read_socket(wfe_socket, &wfe_abort_message, wfe_abort_msglen)) fprintf(stderr, "%s\n", wfe_abort_message); mpispawn_abort (MPISPAWN_RANK_ERROR); } + goto WFE; } int main(int argc, char *argv[]) { @@ -535,8 +536,9 @@ mtpmgr_processops (); wait_for_errors(c_socket, (struct sockaddr *)&c_sockaddr, sockaddr_len); - - return EXIT_SUCCESS; + + /* Should never get here */ + return EXIT_FAILURE; } /* vi:set sw=4 sts=4 tw=80: */ Modified: mvapich/branches/1.0/mpid/ch_gen2_ud/process/mpispawn.c =================================================================== --- mvapich/branches/1.0/mpid/ch_gen2_ud/process/mpispawn.c 2008-03-31 17:11:52 UTC (rev 2354) +++ mvapich/branches/1.0/mpid/ch_gen2_ud/process/mpispawn.c 2008-03-31 17:17:36 UTC (rev 2355) @@ -393,7 +393,7 @@ sockaddr_len) { int wfe_socket, wfe_abort_code, wfe_abort_rank, wfe_abort_msglen; - +WFE: while ((wfe_socket = accept(s, sockaddr, &sockaddr_len)) < 0) { if (errno == EINTR || errno == EAGAIN) continue; @@ -409,11 +409,12 @@ } else { char wfe_abort_message[wfe_abort_msglen]; - fprintf (stderr, "Abort signaled rank %d:", wfe_abort_rank); + fprintf (stderr, "Abort signaled by rank %d: ", wfe_abort_rank); if (!read_socket(wfe_socket, &wfe_abort_message, wfe_abort_msglen)) fprintf(stderr, "%s\n", wfe_abort_message); mpispawn_abort (MPISPAWN_RANK_ERROR); } + goto WFE; } int main(int argc, char *argv[]) { @@ -535,8 +536,9 @@ mtpmgr_processops (); wait_for_errors(c_socket, (struct sockaddr *)&c_sockaddr, sockaddr_len); - - return EXIT_SUCCESS; + + /* Should never get here */ + return EXIT_FAILURE; } /* vi:set sw=4 sts=4 tw=80: */ Modified: mvapich/branches/1.0/mpid/ch_psm/process/mpispawn.c =================================================================== --- mvapich/branches/1.0/mpid/ch_psm/process/mpispawn.c 2008-03-31 17:11:52 UTC (rev 2354) +++ mvapich/branches/1.0/mpid/ch_psm/process/mpispawn.c 2008-03-31 17:17:36 UTC (rev 2355) @@ -393,7 +393,7 @@ sockaddr_len) { int wfe_socket, wfe_abort_code, wfe_abort_rank, wfe_abort_msglen; - +WFE: while ((wfe_socket = accept(s, sockaddr, &sockaddr_len)) < 0) { if (errno == EINTR || errno == EAGAIN) continue; @@ -409,11 +409,12 @@ } else { char wfe_abort_message[wfe_abort_msglen]; - fprintf (stderr, "Abort signaled rank %d:", wfe_abort_rank); + fprintf (stderr, "Abort signaled by rank %d: ", wfe_abort_rank); if (!read_socket(wfe_socket, &wfe_abort_message, wfe_abort_msglen)) fprintf(stderr, "%s\n", wfe_abort_message); mpispawn_abort (MPISPAWN_RANK_ERROR); } + goto WFE; } int main(int argc, char *argv[]) { @@ -535,8 +536,9 @@ mtpmgr_processops (); wait_for_errors(c_socket, (struct sockaddr *)&c_sockaddr, sockaddr_len); - - return EXIT_SUCCESS; + + /* Should never get here */ + return EXIT_FAILURE; } /* vi:set sw=4 sts=4 tw=80: */ Modified: mvapich/branches/1.0/mpid/ch_smp/process/mpispawn.c =================================================================== --- mvapich/branches/1.0/mpid/ch_smp/process/mpispawn.c 2008-03-31 17:11:52 UTC (rev 2354) +++ mvapich/branches/1.0/mpid/ch_smp/process/mpispawn.c 2008-03-31 17:17:36 UTC (rev 2355) @@ -393,7 +393,7 @@ sockaddr_len) { int wfe_socket, wfe_abort_code, wfe_abort_rank, wfe_abort_msglen; - +WFE: while ((wfe_socket = accept(s, sockaddr, &sockaddr_len)) < 0) { if (errno == EINTR || errno == EAGAIN) continue; @@ -409,11 +409,12 @@ } else { char wfe_abort_message[wfe_abort_msglen]; - fprintf (stderr, "Abort signaled rank %d:", wfe_abort_rank); + fprintf (stderr, "Abort signaled by rank %d: ", wfe_abort_rank); if (!read_socket(wfe_socket, &wfe_abort_message, wfe_abort_msglen)) fprintf(stderr, "%s\n", wfe_abort_message); mpispawn_abort (MPISPAWN_RANK_ERROR); } + goto WFE; } int main(int argc, char *argv[]) { @@ -535,8 +536,9 @@ mtpmgr_processops (); wait_for_errors(c_socket, (struct sockaddr *)&c_sockaddr, sockaddr_len); - - return EXIT_SUCCESS; + + /* Should never get here */ + return EXIT_FAILURE; } /* vi:set sw=4 sts=4 tw=80: */ From sridharj at mvapich.cse.ohio-state.edu Mon Mar 31 13:17:50 2008 From: sridharj at mvapich.cse.ohio-state.edu (sridharj@mvapich.cse.ohio-state.edu) Date: Mon Mar 31 13:17:56 2008 Subject: [mvapich-commit] r2356 - in mvapich/trunk/mpid: ch_gen2/process ch_gen2_ud/process ch_psm/process ch_smp/process Message-ID: <200803311717.m2VHHoYg010546@mvapich.cse.ohio-state.edu> Author: sridharj Date: 2008-03-31 13:17:50 -0400 (Mon, 31 Mar 2008) New Revision: 2356 Modified: mvapich/trunk/mpid/ch_gen2/process/mpispawn.c mvapich/trunk/mpid/ch_gen2_ud/process/mpispawn.c mvapich/trunk/mpid/ch_psm/process/mpispawn.c mvapich/trunk/mpid/ch_smp/process/mpispawn.c Log: On a few occasions, some processes weren't getting cleaned up on MPI_Abort. Modified: mvapich/trunk/mpid/ch_gen2/process/mpispawn.c =================================================================== --- mvapich/trunk/mpid/ch_gen2/process/mpispawn.c 2008-03-31 17:17:36 UTC (rev 2355) +++ mvapich/trunk/mpid/ch_gen2/process/mpispawn.c 2008-03-31 17:17:50 UTC (rev 2356) @@ -393,7 +393,7 @@ sockaddr_len) { int wfe_socket, wfe_abort_code, wfe_abort_rank, wfe_abort_msglen; - +WFE: while ((wfe_socket = accept(s, sockaddr, &sockaddr_len)) < 0) { if (errno == EINTR || errno == EAGAIN) continue; @@ -409,11 +409,12 @@ } else { char wfe_abort_message[wfe_abort_msglen]; - fprintf (stderr, "Abort signaled rank %d:", wfe_abort_rank); + fprintf (stderr, "Abort signaled by rank %d: ", wfe_abort_rank); if (!read_socket(wfe_socket, &wfe_abort_message, wfe_abort_msglen)) fprintf(stderr, "%s\n", wfe_abort_message); mpispawn_abort (MPISPAWN_RANK_ERROR); } + goto WFE; } int main(int argc, char *argv[]) { @@ -535,8 +536,9 @@ mtpmgr_processops (); wait_for_errors(c_socket, (struct sockaddr *)&c_sockaddr, sockaddr_len); - - return EXIT_SUCCESS; + + /* Should never get here */ + return EXIT_FAILURE; } /* vi:set sw=4 sts=4 tw=80: */ Modified: mvapich/trunk/mpid/ch_gen2_ud/process/mpispawn.c =================================================================== --- mvapich/trunk/mpid/ch_gen2_ud/process/mpispawn.c 2008-03-31 17:17:36 UTC (rev 2355) +++ mvapich/trunk/mpid/ch_gen2_ud/process/mpispawn.c 2008-03-31 17:17:50 UTC (rev 2356) @@ -393,7 +393,7 @@ sockaddr_len) { int wfe_socket, wfe_abort_code, wfe_abort_rank, wfe_abort_msglen; - +WFE: while ((wfe_socket = accept(s, sockaddr, &sockaddr_len)) < 0) { if (errno == EINTR || errno == EAGAIN) continue; @@ -409,11 +409,12 @@ } else { char wfe_abort_message[wfe_abort_msglen]; - fprintf (stderr, "Abort signaled rank %d:", wfe_abort_rank); + fprintf (stderr, "Abort signaled by rank %d: ", wfe_abort_rank); if (!read_socket(wfe_socket, &wfe_abort_message, wfe_abort_msglen)) fprintf(stderr, "%s\n", wfe_abort_message); mpispawn_abort (MPISPAWN_RANK_ERROR); } + goto WFE; } int main(int argc, char *argv[]) { @@ -535,8 +536,9 @@ mtpmgr_processops (); wait_for_errors(c_socket, (struct sockaddr *)&c_sockaddr, sockaddr_len); - - return EXIT_SUCCESS; + + /* Should never get here */ + return EXIT_FAILURE; } /* vi:set sw=4 sts=4 tw=80: */ Modified: mvapich/trunk/mpid/ch_psm/process/mpispawn.c =================================================================== --- mvapich/trunk/mpid/ch_psm/process/mpispawn.c 2008-03-31 17:17:36 UTC (rev 2355) +++ mvapich/trunk/mpid/ch_psm/process/mpispawn.c 2008-03-31 17:17:50 UTC (rev 2356) @@ -393,7 +393,7 @@ sockaddr_len) { int wfe_socket, wfe_abort_code, wfe_abort_rank, wfe_abort_msglen; - +WFE: while ((wfe_socket = accept(s, sockaddr, &sockaddr_len)) < 0) { if (errno == EINTR || errno == EAGAIN) continue; @@ -409,11 +409,12 @@ } else { char wfe_abort_message[wfe_abort_msglen]; - fprintf (stderr, "Abort signaled rank %d:", wfe_abort_rank); + fprintf (stderr, "Abort signaled by rank %d: ", wfe_abort_rank); if (!read_socket(wfe_socket, &wfe_abort_message, wfe_abort_msglen)) fprintf(stderr, "%s\n", wfe_abort_message); mpispawn_abort (MPISPAWN_RANK_ERROR); } + goto WFE; } int main(int argc, char *argv[]) { @@ -535,8 +536,9 @@ mtpmgr_processops (); wait_for_errors(c_socket, (struct sockaddr *)&c_sockaddr, sockaddr_len); - - return EXIT_SUCCESS; + + /* Should never get here */ + return EXIT_FAILURE; } /* vi:set sw=4 sts=4 tw=80: */ Modified: mvapich/trunk/mpid/ch_smp/process/mpispawn.c =================================================================== --- mvapich/trunk/mpid/ch_smp/process/mpispawn.c 2008-03-31 17:17:36 UTC (rev 2355) +++ mvapich/trunk/mpid/ch_smp/process/mpispawn.c 2008-03-31 17:17:50 UTC (rev 2356) @@ -393,7 +393,7 @@ sockaddr_len) { int wfe_socket, wfe_abort_code, wfe_abort_rank, wfe_abort_msglen; - +WFE: while ((wfe_socket = accept(s, sockaddr, &sockaddr_len)) < 0) { if (errno == EINTR || errno == EAGAIN) continue; @@ -409,11 +409,12 @@ } else { char wfe_abort_message[wfe_abort_msglen]; - fprintf (stderr, "Abort signaled rank %d:", wfe_abort_rank); + fprintf (stderr, "Abort signaled by rank %d: ", wfe_abort_rank); if (!read_socket(wfe_socket, &wfe_abort_message, wfe_abort_msglen)) fprintf(stderr, "%s\n", wfe_abort_message); mpispawn_abort (MPISPAWN_RANK_ERROR); } + goto WFE; } int main(int argc, char *argv[]) { @@ -535,8 +536,9 @@ mtpmgr_processops (); wait_for_errors(c_socket, (struct sockaddr *)&c_sockaddr, sockaddr_len); - - return EXIT_SUCCESS; + + /* Should never get here */ + return EXIT_FAILURE; } /* vi:set sw=4 sts=4 tw=80: */