10
10
* Copyright (c) 2004-2005 The Regents of the University of California.
11
11
* All rights reserved.
12
12
* Copyright (c) 2010-2018 Cisco Systems, Inc. All rights reserved
13
- * Copyright (c) 2015-2017 Research Organization for Information Science
14
- * and Technology (RIST). All rights reserved.
13
+ * Copyright (c) 2015-2019 Research Organization for Information Science
14
+ * and Technology (RIST). All rights reserved.
15
15
* Copyright (c) 2016 Los Alamos National Security, LLC. All rights
16
16
* reserved.
17
17
* $COPYRIGHT$
@@ -82,25 +82,29 @@ void ompi_comm_spawn_multiple_f(MPI_Fint *count, char *array_commands,
82
82
{
83
83
MPI_Comm c_comm , c_new_comm ;
84
84
MPI_Info * c_info ;
85
- int size , array_size , i , c_ierr ;
85
+ int array_size , i , c_ierr ;
86
86
int * c_errs ;
87
87
char * * c_array_commands ;
88
88
char * * * c_array_argv ;
89
+ int maxprocs ;
89
90
OMPI_ARRAY_NAME_DECL (array_maxprocs );
90
91
OMPI_ARRAY_NAME_DECL (array_errcds );
91
92
92
93
c_comm = PMPI_Comm_f2c (* comm );
93
94
94
- PMPI_Comm_size (c_comm , & size );
95
-
96
95
array_size = OMPI_FINT_2_INT (* count );
96
+ OMPI_ARRAY_FINT_2_INT (array_maxprocs , array_size );
97
97
98
98
/* It's allowed to ignore the errcodes */
99
99
100
100
if (OMPI_IS_FORTRAN_ERRCODES_IGNORE (array_errcds )) {
101
101
c_errs = MPI_ERRCODES_IGNORE ;
102
102
} else {
103
- OMPI_ARRAY_FINT_2_INT_ALLOC (array_errcds , size );
103
+ maxprocs = 0 ;
104
+ for (i = 0 ; i < array_size ; i ++ ) {
105
+ maxprocs += OMPI_ARRAY_NAME_CONVERT (array_maxprocs )[i ];
106
+ }
107
+ OMPI_ARRAY_FINT_2_INT_ALLOC (array_errcds , maxprocs );
104
108
c_errs = OMPI_ARRAY_NAME_CONVERT (array_errcds );
105
109
}
106
110
@@ -113,8 +117,6 @@ void ompi_comm_spawn_multiple_f(MPI_Fint *count, char *array_commands,
113
117
argv_string_len , & c_array_argv );
114
118
}
115
119
116
- OMPI_ARRAY_FINT_2_INT (array_maxprocs , array_size );
117
-
118
120
ompi_fortran_argv_count_f2c (array_commands , array_size , cmd_string_len ,
119
121
cmd_string_len , & c_array_commands );
120
122
@@ -138,9 +140,7 @@ void ompi_comm_spawn_multiple_f(MPI_Fint *count, char *array_commands,
138
140
}
139
141
140
142
if (!OMPI_IS_FORTRAN_ERRCODES_IGNORE (array_errcds )) {
141
- OMPI_ARRAY_INT_2_FINT (array_errcds , size );
142
- } else {
143
- OMPI_ARRAY_FINT_2_INT_CLEANUP (array_errcds );
143
+ OMPI_ARRAY_INT_2_FINT (array_errcds , maxprocs );
144
144
}
145
145
OMPI_ARRAY_FINT_2_INT_CLEANUP (array_maxprocs );
146
146
0 commit comments