13 #define KMR_SPAWN_MAGIC (20160904) 14 #define KMR_SPAWN_SUBWORLDS (20) 15 #define KMR_SPAWN_ARGS_SIZE (8 * 1024) 16 #define KMR_SPAWN_RPC_TAG (600) 17 #define KMR_SPAWN_ICOMM_TAG (601) 22 KMR_SPAWN_NONE, KMR_SPAWN_WORK, KMR_SPAWN_NEXT
30 enum kmr_spawn_req req;
46 enum kmr_spawn_req req;
60 enum kmr_spawn_req req;
69 enum kmr_spawn_req req;
93 } subworlds[KMR_SPAWN_SUBWORLDS];
104 MPI_Comm spawn_world;
105 MPI_Comm spawn_parent;
107 _Bool mpi_initialized;
108 _Bool abort_when_mpi_abort;
116 char *options_heap_bottom;
122 void *saved_genuine_world;
123 size_t size_of_comm_data;
125 void (*exit)(
int status);
126 void (*raw_exit)(
int status);
127 int (*execve)(
const char *file,
char *
const argv[],
130 int (*PMPI_Init)(
int *argc,
char ***argv);
131 int (*PMPI_Init_thread)(
int *argc,
char ***argv,
int required,
133 int (*PMPI_Finalize)(void);
134 int (*PMPI_Abort)(MPI_Comm comm,
int errorcode);
135 int (*PMPI_Query_thread)(
int *provided);
139 void *mpi_comm_world;
143 int (*PMPI_Comm_get_parent)(MPI_Comm *parent);
144 int (*PMPI_Comm_get_name)(MPI_Comm comm,
char *name,
int *len);
145 int (*PMPI_Comm_set_name)(MPI_Comm comm,
char *name);
146 int (*PMPI_Comm_size)(MPI_Comm comm,
int *size);
147 int (*PMPI_Comm_rank)(MPI_Comm comm,
int *rank);
148 int (*PMPI_Comm_remote_size)(MPI_Comm comm,
int *size);
150 int (*PMPI_Intercomm_create)(MPI_Comm lcomm,
int lleader,
151 MPI_Comm pcomm,
int pleader,
152 int tag, MPI_Comm *newcomm);
153 int (*PMPI_Comm_dup)(MPI_Comm comm, MPI_Comm *newcomm);
154 int (*PMPI_Comm_free)(MPI_Comm *comm);
155 int (*PMPI_Send)(
void *buf,
int count, MPI_Datatype dty,
156 int dst,
int tag, MPI_Comm comm);
157 int (*PMPI_Recv)(
void *buf,
int count, MPI_Datatype dty,
158 int src,
int tag, MPI_Comm comm,
160 int (*PMPI_Get_count)(MPI_Status *status, MPI_Datatype dty,
163 char world_name[MPI_MAX_OBJECT_NAME];
171 MPI_Comm basecomm,
int masterrank,
175 MPI_Comm subworlds[],
unsigned long colors[],
177 extern void kmr_spawn_set_verbosity(
struct kmr_spawn_hooks *hooks,
int level);
178 extern void kmr_spawn_service(
struct kmr_spawn_hooks *hooks,
int status);
184 MPI_Comm basecomm,
int masterrank,
188 MPI_Comm subworlds[],
189 unsigned long colors[],
191 extern void kmr_spawn_set_verbosity_standin(
struct kmr_spawn_hooks *hooks,
198 extern void kmr_spawn_true_exit(
int status);
199 extern int kmr_spawn_true_execve(
const char *file,
char *
const argv[],
201 extern int kmr_spawn_true_mpi_finalize(
void);
202 extern int kmr_spawn_true_mpi_abort(MPI_Comm comm,
int code);
206 extern int kmr_spawn_mpi_comm_size(MPI_Comm comm,
int *size);
207 extern int kmr_spawn_mpi_comm_rank(MPI_Comm comm,
int *rank);
208 extern int kmr_spawn_mpi_comm_remote_size(MPI_Comm comm,
int *size);
209 extern int kmr_spawn_mpi_comm_get_name(MPI_Comm comm,
char *name,
int *len);
210 extern int kmr_spawn_mpi_comm_set_name(MPI_Comm comm,
char *name);
211 extern int kmr_spawn_mpi_intercomm_create(MPI_Comm lcomm,
int lleader,
212 MPI_Comm pcomm,
int pleader,
213 int tag, MPI_Comm *icomm);
214 extern int kmr_spawn_mpi_comm_dup(MPI_Comm comm, MPI_Comm *newcomm);
215 extern int kmr_spawn_mpi_comm_free(MPI_Comm *comm);
216 extern int kmr_spawn_mpi_send(
void *buf,
int count, MPI_Datatype dty,
217 int dst,
int tag, MPI_Comm comm);
218 extern int kmr_spawn_mpi_recv(
void *buf,
int count, MPI_Datatype dty,
219 int src,
int tag, MPI_Comm comm,
221 extern int kmr_spawn_mpi_get_count(MPI_Status *status, MPI_Datatype dty,