FrontISTR  5.9.0
Large-scale structural analysis program with finit element method
hecmw_comm.c
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2019 FrontISTR Commons
3  * This software is released under the MIT License, see LICENSE.txt
4  *****************************************************************************/
5 
6 #include <stdio.h>
7 #include "hecmw_config.h"
8 #include "hecmw_comm.h"
9 #include "hecmw_util.h"
10 
11 static int is_initialized;
12 
13 static HECMW_Comm hecmw_comm;
14 static HECMW_Group hecmw_group;
15 static int comm_size;
16 static int comm_rank;
17 
18 int HECMW_Comm_rank(HECMW_Comm comm, int *rank) {
19 #ifndef HECMW_SERIAL
20  int rtc;
21  rtc = MPI_Comm_rank(comm, rank);
22 
23  if (rtc != MPI_SUCCESS) {
24  HECMW_set_error(HECMW_ALL_E1003, "MPI_Comm_rank");
25  goto error;
26  }
27 
28  return 0;
29 error:
30  return -1;
31 #else
32  *rank = 0;
33  return 0;
34 #endif
35 }
36 
37 int HECMW_Comm_size(HECMW_Comm comm, int *size) {
38 #ifndef HECMW_SERIAL
39  int rtc;
40  rtc = MPI_Comm_size(comm, size);
41 
42  if (rtc != MPI_SUCCESS) {
43  HECMW_set_error(HECMW_ALL_E1003, "MPI_Comm_size");
44  goto error;
45  }
46 
47  return 0;
48 error:
49  return -1;
50 #else
51  *size = 1;
52  return 0;
53 #endif
54 }
55 
56 int HECMW_Comm_dup(HECMW_Comm comm, HECMW_Comm *new_comm) {
57 #ifndef HECMW_SERIAL
58  int rtc;
59  rtc = MPI_Comm_dup(comm, new_comm);
60 
61  if (rtc != MPI_SUCCESS) {
62  HECMW_set_error(HECMW_ALL_E1003, "MPI_Comm_dup");
63  goto error;
64  }
65 
66  return 0;
67 error:
68  return -1;
69 #else
70  *new_comm = 0;
71  return 0;
72 #endif
73 }
74 
76 #ifndef HECMW_SERIAL
77  int rtc;
78  rtc = MPI_Comm_free(comm);
79 
80  if (rtc != MPI_SUCCESS) {
81  HECMW_set_error(HECMW_ALL_E1003, "MPI_Comm_free");
82  goto error;
83  }
84 
85  return 0;
86 error:
87  return -1;
88 #else
89  return 0;
90 #endif
91 }
92 
93 /*-----------------------------------------------------------------------------*/
94 
95 extern int HECMW_Barrier(HECMW_Comm comm) {
96 #ifndef HECMW_SERIAL
97  int rtc;
98  rtc = MPI_Barrier(comm);
99 
100  if (rtc != MPI_SUCCESS) {
101  HECMW_set_error(HECMW_ALL_E1003, "MPI_Barrier");
102  goto error;
103  }
104 
105  return 0;
106 error:
107  return -1;
108 #else
109  return 0;
110 #endif
111 }
112 
113 extern int HECMW_Wait(HECMW_Request *array_of_requests,
114  HECMW_Status *array_of_statuses) {
115 #ifndef HECMW_SERIAL
116  int rtc;
117  rtc = MPI_Wait(array_of_requests, array_of_statuses);
118 
119  if (rtc != MPI_SUCCESS) {
120  HECMW_set_error(HECMW_ALL_E1003, "MPI_Waitall");
121  goto error;
122  }
123 
124  return 0;
125 error:
126  return -1;
127 #else
128  return 0;
129 #endif
130 }
131 
132 extern int HECMW_Waitall(int count, HECMW_Request *array_of_requests,
133  HECMW_Status *array_of_statuses) {
134 #ifndef HECMW_SERIAL
135  int rtc;
136  rtc = MPI_Waitall(count, array_of_requests, array_of_statuses);
137 
138  if (rtc != MPI_SUCCESS) {
139  HECMW_set_error(HECMW_ALL_E1003, "MPI_Waitall");
140  goto error;
141  }
142 
143  return 0;
144 error:
145  return -1;
146 #else
147  return 0;
148 #endif
149 }
150 
151 extern int HECMW_Bcast(void *buffer, int count, HECMW_Datatype datatype,
152  int root, HECMW_Comm comm) {
153 #ifndef HECMW_SERIAL
154  int rtc;
155 
156  if (datatype == HECMW_INT) {
157  rtc = MPI_Bcast(buffer, count, MPI_INT, root, comm);
158 
159  if (rtc != MPI_SUCCESS) {
160  HECMW_set_error(HECMW_ALL_E1003, "MPI_Bcast");
161  goto error;
162  }
163 
164  } else if (datatype == HECMW_DOUBLE) {
165  rtc = MPI_Bcast(buffer, count, MPI_DOUBLE, root, comm);
166 
167  if (rtc != MPI_SUCCESS) {
168  HECMW_set_error(HECMW_ALL_E1003, "MPI_Bcast");
169  goto error;
170  }
171 
172  } else if (datatype == HECMW_CHAR) {
173  rtc = MPI_Bcast(buffer, count, MPI_CHAR, root, comm);
174 
175  if (rtc != MPI_SUCCESS) {
176  HECMW_set_error(HECMW_ALL_E1003, "MPI_Bcast");
177  goto error;
178  }
179 
180  } else if (datatype == HECMW_LONG_LONG) {
181  rtc = MPI_Bcast(buffer, count, MPI_LONG_LONG, root, comm);
182 
183  if (rtc != MPI_SUCCESS) {
184  HECMW_set_error(HECMW_ALL_E1003, "MPI_Bcast");
185  goto error;
186  }
187 
188  } else {
189  HECMW_set_error(HECMW_ALL_E1003, "Invalid data type is found");
190  goto error;
191  }
192 
193  return 0;
194 error:
195  return -1;
196 #else
197  return 0;
198 #endif
199 }
200 
201 extern int HECMW_Send(void *buffer, int count, HECMW_Datatype datatype,
202  int dest, int tag, HECMW_Comm comm) {
203 #ifndef HECMW_SERIAL
204  int rtc;
205 
206  if (datatype == HECMW_INT) {
207  rtc = MPI_Send(buffer, count, MPI_INT, dest, tag, comm);
208 
209  if (rtc != MPI_SUCCESS) {
210  HECMW_set_error(HECMW_ALL_E1003, "MPI_Send");
211  goto error;
212  }
213 
214  } else if (datatype == HECMW_DOUBLE) {
215  rtc = MPI_Send(buffer, count, MPI_DOUBLE, dest, tag, comm);
216 
217  if (rtc != MPI_SUCCESS) {
218  HECMW_set_error(HECMW_ALL_E1003, "MPI_Send");
219  goto error;
220  }
221 
222  } else if (datatype == HECMW_CHAR) {
223  rtc = MPI_Send(buffer, count, MPI_CHAR, dest, tag, comm);
224 
225  if (rtc != MPI_SUCCESS) {
226  HECMW_set_error(HECMW_ALL_E1003, "MPI_Send");
227  goto error;
228  }
229 
230  } else if (datatype == HECMW_LONG_LONG) {
231  rtc = MPI_Send(buffer, count, MPI_LONG_LONG, dest, tag, comm);
232 
233  if (rtc != MPI_SUCCESS) {
234  HECMW_set_error(HECMW_ALL_E1003, "MPI_Send");
235  goto error;
236  }
237 
238  } else {
239  HECMW_set_error(HECMW_ALL_E1003, "Invalid data type is found");
240  goto error;
241  }
242 
243  return 0;
244 error:
245  return -1;
246 #else
247  return 0;
248 #endif
249 }
250 
251 extern int HECMW_Recv(void *buffer, int count, HECMW_Datatype datatype,
252  int source, int tag, HECMW_Comm comm,
253  HECMW_Status *status) {
254 #ifndef HECMW_SERIAL
255  int rtc;
256 
257  if (datatype == HECMW_INT) {
258  rtc = MPI_Recv(buffer, count, MPI_INT, source, tag, comm, status);
259 
260  if (rtc != MPI_SUCCESS) {
261  HECMW_set_error(HECMW_ALL_E1003, "MPI_Recv");
262  goto error;
263  }
264 
265  } else if (datatype == HECMW_DOUBLE) {
266  rtc = MPI_Recv(buffer, count, MPI_DOUBLE, source, tag, comm, status);
267 
268  if (rtc != MPI_SUCCESS) {
269  HECMW_set_error(HECMW_ALL_E1003, "MPI_Recv");
270  goto error;
271  }
272 
273  } else if (datatype == HECMW_CHAR) {
274  rtc = MPI_Recv(buffer, count, MPI_CHAR, source, tag, comm, status);
275 
276  if (rtc != MPI_SUCCESS) {
277  HECMW_set_error(HECMW_ALL_E1003, "MPI_Recv");
278  goto error;
279  }
280 
281  } else if (datatype == HECMW_LONG_LONG) {
282  rtc = MPI_Recv(buffer, count, MPI_LONG_LONG, source, tag, comm, status);
283 
284  if (rtc != MPI_SUCCESS) {
285  HECMW_set_error(HECMW_ALL_E1003, "MPI_Recv");
286  goto error;
287  }
288 
289  } else {
290  HECMW_set_error(HECMW_ALL_E1003, "Invalid data type is found");
291  goto error;
292  }
293 
294  return 0;
295 error:
296  return -1;
297 #else
298  return 0;
299 #endif
300 }
301 
302 extern int HECMW_Isend(void *buffer, int count, HECMW_Datatype datatype,
303  int dest, int tag, HECMW_Comm comm,
304  HECMW_Request *request) {
305 #ifndef HECMW_SERIAL
306  int rtc;
307 
308  if (datatype == HECMW_INT) {
309  rtc = MPI_Isend(buffer, count, MPI_INT, dest, tag, comm, request);
310 
311  if (rtc != MPI_SUCCESS) {
312  HECMW_set_error(HECMW_ALL_E1003, "MPI_Isend");
313  goto error;
314  }
315 
316  } else if (datatype == HECMW_DOUBLE) {
317  rtc = MPI_Isend(buffer, count, MPI_DOUBLE, dest, tag, comm, request);
318 
319  if (rtc != MPI_SUCCESS) {
320  HECMW_set_error(HECMW_ALL_E1003, "MPI_Isend");
321  goto error;
322  }
323 
324  } else if (datatype == HECMW_CHAR) {
325  rtc = MPI_Isend(buffer, count, MPI_CHAR, dest, tag, comm, request);
326 
327  if (rtc != MPI_SUCCESS) {
328  HECMW_set_error(HECMW_ALL_E1003, "MPI_Isend");
329  goto error;
330  }
331 
332  } else if (datatype == HECMW_LONG_LONG) {
333  rtc = MPI_Isend(buffer, count, MPI_LONG_LONG, dest, tag, comm, request);
334 
335  if (rtc != MPI_SUCCESS) {
336  HECMW_set_error(HECMW_ALL_E1003, "MPI_Isend");
337  goto error;
338  }
339 
340  } else {
341  HECMW_set_error(HECMW_ALL_E1003, "Invalid data type is found");
342  goto error;
343  }
344 
345  return 0;
346 error:
347  return -1;
348 #else
349  return 0;
350 #endif
351 }
352 
353 extern int HECMW_Irecv(void *buffer, int count, HECMW_Datatype datatype,
354  int source, int tag, HECMW_Comm comm,
355  HECMW_Request *request) {
356 #ifndef HECMW_SERIAL
357  int rtc;
358 
359  if (datatype == HECMW_INT) {
360  rtc = MPI_Irecv(buffer, count, MPI_INT, source, tag, comm, request);
361 
362  if (rtc != MPI_SUCCESS) {
363  HECMW_set_error(HECMW_ALL_E1003, "MPI_Irecv");
364  goto error;
365  }
366 
367  } else if (datatype == HECMW_DOUBLE) {
368  rtc = MPI_Irecv(buffer, count, MPI_DOUBLE, source, tag, comm, request);
369 
370  if (rtc != MPI_SUCCESS) {
371  HECMW_set_error(HECMW_ALL_E1003, "MPI_Irecv");
372  goto error;
373  }
374 
375  } else if (datatype == HECMW_CHAR) {
376  rtc = MPI_Irecv(buffer, count, MPI_CHAR, source, tag, comm, request);
377 
378  if (rtc != MPI_SUCCESS) {
379  HECMW_set_error(HECMW_ALL_E1003, "MPI_Irecv");
380  goto error;
381  }
382 
383  } else if (datatype == HECMW_LONG_LONG) {
384  rtc = MPI_Irecv(buffer, count, MPI_LONG_LONG, source, tag, comm, request);
385 
386  if (rtc != MPI_SUCCESS) {
387  HECMW_set_error(HECMW_ALL_E1003, "MPI_Irecv");
388  goto error;
389  }
390 
391  } else {
392  HECMW_set_error(HECMW_ALL_E1003, "Invalid data type is found");
393  goto error;
394  }
395 
396  return 0;
397 error:
398  return -1;
399 #else
400  return 0;
401 #endif
402 }
403 
404 extern int HECMW_Allreduce(void *sendbuf, void *recvbuf, int count,
405  HECMW_Datatype datatype, HECMW_Op op,
406  HECMW_Comm comm) {
407 #ifndef HECMW_SERIAL
408  MPI_Datatype _datatype;
409  MPI_Op _op;
410  int rtc;
411 
412  if (datatype == HECMW_INT) {
413  _datatype = MPI_INT;
414 
415  } else if (datatype == HECMW_DOUBLE) {
416  _datatype = MPI_DOUBLE;
417 
418  } else if (datatype == HECMW_CHAR) {
419  _datatype = MPI_CHAR;
420 
421  } else if (datatype == HECMW_LONG_LONG) {
422  _datatype = MPI_LONG_LONG;
423 
424  } else {
425  HECMW_set_error(HECMW_ALL_E1003, "Invalid data type is found");
426  goto error;
427  }
428 
429  if (op == HECMW_SUM) {
430  _op = MPI_SUM;
431 
432  } else if (op == HECMW_MIN) {
433  _op = MPI_MIN;
434 
435  } else if (op == HECMW_MAX) {
436  _op = MPI_MAX;
437 
438  } else {
439  HECMW_set_error(HECMW_ALL_E1003, "Invalid operation is found");
440  goto error;
441  }
442 
443  rtc = MPI_Allreduce(sendbuf, recvbuf, count, _datatype, _op, comm);
444 
445  if (rtc != MPI_SUCCESS) {
446  HECMW_set_error(HECMW_ALL_E1003, "MPI_Allreduce");
447  goto error;
448  }
449 
450  return 0;
451 error:
452  return -1;
453 #else
454 
455  if (datatype == HECMW_INT) {
456  memcpy(recvbuf, sendbuf, sizeof(int) * count);
457 
458  } else if (datatype == HECMW_DOUBLE) {
459  memcpy(recvbuf, sendbuf, sizeof(double) * count);
460 
461  } else if (datatype == HECMW_CHAR) {
462  memcpy(recvbuf, sendbuf, sizeof(char) * count);
463 
464  } else if (datatype == HECMW_LONG_LONG) {
465  memcpy(recvbuf, sendbuf, sizeof(long long) * count);
466 
467  } else {
468  HECMW_set_error(HECMW_ALL_E1003, "Invalid data type is found");
469  goto error;
470  }
471 
472  return 0;
473 error:
474  return -1;
475 #endif
476 }
477 
478 extern int HECMW_Allgather(void *sendbuf, int sendcount,
479  HECMW_Datatype sendtype, void *recvbuf,
480  int recvcount, HECMW_Datatype recvtype,
481  HECMW_Comm comm) {
482 #ifndef HECMW_SERIAL
483  MPI_Datatype _sendtype, _recvtype;
484  int rtc;
485 
486  if (sendtype == HECMW_INT) {
487  _sendtype = MPI_INT;
488 
489  } else if (sendtype == HECMW_DOUBLE) {
490  _sendtype = MPI_DOUBLE;
491 
492  } else if (sendtype == HECMW_CHAR) {
493  _sendtype = MPI_CHAR;
494 
495  } else if (sendtype == HECMW_LONG_LONG) {
496  _sendtype = MPI_LONG_LONG;
497 
498  } else {
499  HECMW_set_error(HECMW_ALL_E1003, "Invalid data type is found");
500  goto error;
501  }
502 
503  if (recvtype == HECMW_INT) {
504  _recvtype = MPI_INT;
505 
506  } else if (recvtype == HECMW_DOUBLE) {
507  _recvtype = MPI_DOUBLE;
508 
509  } else if (recvtype == HECMW_CHAR) {
510  _recvtype = MPI_CHAR;
511 
512  } else if (recvtype == HECMW_LONG_LONG) {
513  _recvtype = MPI_LONG_LONG;
514 
515  } else {
516  HECMW_set_error(HECMW_ALL_E1003, "Invalid data type is found");
517  goto error;
518  }
519 
520  rtc = MPI_Allgather(sendbuf, sendcount, _sendtype, recvbuf, recvcount,
521  _recvtype, comm);
522 
523  if (rtc != MPI_SUCCESS) {
524  HECMW_set_error(HECMW_ALL_E1003, "MPI_Allgather");
525  goto error;
526  }
527 
528  return 0;
529 error:
530  return -1;
531 #else
532  return 0;
533 #endif
534 }
535 
536 extern int HECMW_Group_incl(HECMW_Group group, int n, int *ranks,
537  HECMW_Group *newgroup) {
538 #ifndef HECMW_SERIAL
539  int rtc;
540  rtc = MPI_Group_incl(group, n, ranks, newgroup);
541 
542  if (rtc != MPI_SUCCESS) {
543  HECMW_set_error(HECMW_ALL_E1003, "MPI_Group_excl");
544  goto error;
545  }
546 
547  return 0;
548 error:
549  return -1;
550 #else
551  return 0;
552 #endif
553 }
554 
555 extern int HECMW_Group_excl(HECMW_Group group, int n, int *ranks,
556  HECMW_Group *newgroup) {
557 #ifndef HECMW_SERIAL
558  int rtc;
559  rtc = MPI_Group_excl(group, n, ranks, newgroup);
560 
561  if (rtc != MPI_SUCCESS) {
562  HECMW_set_error(HECMW_ALL_E1003, "MPI_Group_excl");
563  goto error;
564  }
565 
566  return 0;
567 error:
568  return -1;
569 #else
570  return 0;
571 #endif
572 }
573 
574 extern int HECMW_Comm_create(HECMW_Comm comm, HECMW_Group group,
575  HECMW_Comm *comm_out) {
576 #ifndef HECMW_SERIAL
577  int rtc;
578  rtc = MPI_Comm_create(comm, group, comm_out);
579 
580  if (rtc != MPI_SUCCESS) {
581  HECMW_set_error(HECMW_ALL_E1003, "MPI_Comm_create");
582  goto error;
583  }
584 
585  return 0;
586 error:
587  return -1;
588 #else
589  return 0;
590 #endif
591 }
592 
593 extern int HECMW_Group_rank(HECMW_Group group, int *rank) {
594 #ifndef HECMW_SERIAL
595  int rtc;
596  rtc = MPI_Group_rank(group, rank);
597 
598  if (rtc != MPI_SUCCESS) {
599  HECMW_set_error(HECMW_ALL_E1003, "MPI_Group_rank");
600  goto error;
601  }
602 
603  return 0;
604 error:
605  return -1;
606 #else
607  *rank = 0;
608  return 0;
609 #endif
610 }
611 
612 extern int HECMW_Group_size(HECMW_Group group, int *size) {
613 #ifndef HECMW_SERIAL
614  int rtc;
615  rtc = MPI_Group_size(group, size);
616 
617  if (rtc != MPI_SUCCESS) {
618  HECMW_set_error(HECMW_ALL_E1003, "MPI_Group_size");
619  goto error;
620  }
621 
622  return 0;
623 error:
624  return -1;
625 #else
626  *size = 1;
627  return 0;
628 #endif
629 }
630 
631 extern int HECMW_Comm_group(HECMW_Comm comm, HECMW_Group *group) {
632 #ifndef HECMW_SERIAL
633  int rtc;
634  rtc = MPI_Comm_group(comm, group);
635 
636  if (rtc != MPI_SUCCESS) {
637  HECMW_set_error(HECMW_ALL_E1003, "MPI_Comm_group");
638  goto error;
639  }
640 
641  return 0;
642 error:
643  return -1;
644 #else
645  return 0;
646 #endif
647 }
648 
649 static int check_is_initialized(void) {
650 #ifdef HECMW_SERIAL
651  is_initialized = 1;
652 #endif
653 
654  if (!is_initialized) {
656  return 0;
657  }
658 
659  return 1;
660 }
661 
662 static int setup_comm(void) {
663 #ifndef HECMW_SERIAL
664 
665  if (MPI_Comm_dup(MPI_COMM_WORLD, &hecmw_comm) != MPI_SUCCESS) {
667  return -1;
668  }
669 
670 #else
671  hecmw_comm = 0;
672 #endif
673  return 0;
674 }
675 
676 static int setup_comm_size(void) {
677 #ifndef HECMW_SERIAL
678 
679  if (MPI_Comm_size(MPI_COMM_WORLD, &comm_size) != MPI_SUCCESS) {
681  return -1;
682  }
683 
684 #else
685  comm_size = 1;
686 #endif
687  return 0;
688 }
689 
690 static int setup_comm_rank(void) {
691 #ifndef HECMW_SERIAL
692 
693  if (MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank) != MPI_SUCCESS) {
695  return -1;
696  }
697 
698 #else
699  comm_rank = 0;
700 #endif
701  return 0;
702 }
703 
704 static int setup_comm_group(void) {
705 #ifndef HECMW_SERIAL
706 
707  if (MPI_Comm_group(MPI_COMM_WORLD, &hecmw_group) != MPI_SUCCESS) {
709  return -1;
710  }
711 
712 #else
713  hecmw_group = 0;
714 #endif
715  return 0;
716 }
717 
718 int HECMW_comm_init(int *argc, char ***argv) {
719 #ifndef HECMW_SERIAL
720 
721  if (MPI_Init(argc, argv) != MPI_SUCCESS) {
723  return -1;
724  }
725 
726  is_initialized = 1;
727  HECMW_log(HECMW_LOG_DEBUG, "MPI initialized");
728 #endif
729 
730  if (setup_comm()) {
731  return -1;
732  }
733 
734  if (setup_comm_size()) {
735  return -1;
736  }
737 
738  if (setup_comm_rank()) {
739  return -1;
740  }
741 
742  if (setup_comm_group()) {
743  return -1;
744  }
745 
746  return 0;
747 }
748 
749 int HECMW_comm_is_initialized(void) { return is_initialized; }
750 
752  return check_is_initialized() ? hecmw_comm : (HECMW_Comm)-1;
753 }
754 
756  return check_is_initialized() ? comm_size : -1;
757 }
758 
760  return check_is_initialized() ? comm_rank : -1;
761 }
762 
764  return check_is_initialized() ? hecmw_group : (HECMW_Group)-1;
765 }
766 
768 #ifndef HECMW_SERIAL
769  return MPI_Comm_c2f(comm);
770 #else
771  return comm;
772 #endif
773 }
774 
776 #ifndef HECMW_SERIAL
777  return MPI_Comm_f2c(comm);
778 #else
779  return comm;
780 #endif
781 }
782 
784 #ifndef HECMW_SERIAL
785  return MPI_Group_f2c(group);
786 #else
787  return group;
788 #endif
789 }
790 
791 /*---------------------------------------------------------------------------*/
792 
793 extern void hecmw_comm_init_if(HECMW_Fint *comm, int *size, int *rank,
794  HECMW_Fint *group) {
795  is_initialized = 1;
796  hecmw_comm = HECMW_Comm_f2c(*comm);
797  comm_size = *size;
798  comm_rank = *rank;
799  hecmw_group = HECMW_Group_f2c(*group);
800 }
801 
802 extern void hecmw_comm_init_if_(HECMW_Fint *comm, int *size, int *rank,
803  HECMW_Fint *group) {
804  hecmw_comm_init_if(comm, size, rank, group);
805 }
806 
807 extern void hecmw_comm_init_if__(HECMW_Fint *comm, int *size, int *rank,
808  HECMW_Fint *group) {
809  hecmw_comm_init_if(comm, size, rank, group);
810 }
811 
812 extern void HECMW_COMM_INIT_IF(HECMW_Fint *comm, int *size, int *rank,
813  HECMW_Fint *group) {
814  hecmw_comm_init_if(comm, size, rank, group);
815 }
int HECMW_Comm_create(HECMW_Comm comm, HECMW_Group group, HECMW_Comm *comm_out)
Definition: hecmw_comm.c:574
int HECMW_Comm_rank(HECMW_Comm comm, int *rank)
Definition: hecmw_comm.c:18
int HECMW_Irecv(void *buffer, int count, HECMW_Datatype datatype, int source, int tag, HECMW_Comm comm, HECMW_Request *request)
Definition: hecmw_comm.c:353
void hecmw_comm_init_if__(HECMW_Fint *comm, int *size, int *rank, HECMW_Fint *group)
Definition: hecmw_comm.c:807
int HECMW_Isend(void *buffer, int count, HECMW_Datatype datatype, int dest, int tag, HECMW_Comm comm, HECMW_Request *request)
Definition: hecmw_comm.c:302
void hecmw_comm_init_if_(HECMW_Fint *comm, int *size, int *rank, HECMW_Fint *group)
Definition: hecmw_comm.c:802
int HECMW_Waitall(int count, HECMW_Request *array_of_requests, HECMW_Status *array_of_statuses)
Definition: hecmw_comm.c:132
HECMW_Fint HECMW_Comm_c2f(HECMW_Comm comm)
Definition: hecmw_comm.c:767
int HECMW_comm_init(int *argc, char ***argv)
Definition: hecmw_comm.c:718
HECMW_Comm HECMW_comm_get_comm(void)
Definition: hecmw_comm.c:751
int HECMW_Group_size(HECMW_Group group, int *size)
Definition: hecmw_comm.c:612
int HECMW_Comm_size(HECMW_Comm comm, int *size)
Definition: hecmw_comm.c:37
int HECMW_Group_excl(HECMW_Group group, int n, int *ranks, HECMW_Group *newgroup)
Definition: hecmw_comm.c:555
int HECMW_Allreduce(void *sendbuf, void *recvbuf, int count, HECMW_Datatype datatype, HECMW_Op op, HECMW_Comm comm)
Definition: hecmw_comm.c:404
int HECMW_comm_get_rank(void)
Definition: hecmw_comm.c:759
int HECMW_Send(void *buffer, int count, HECMW_Datatype datatype, int dest, int tag, HECMW_Comm comm)
Definition: hecmw_comm.c:201
int HECMW_Barrier(HECMW_Comm comm)
Definition: hecmw_comm.c:95
int HECMW_Recv(void *buffer, int count, HECMW_Datatype datatype, int source, int tag, HECMW_Comm comm, HECMW_Status *status)
Definition: hecmw_comm.c:251
HECMW_Group HECMW_Group_f2c(HECMW_Fint group)
Definition: hecmw_comm.c:783
void hecmw_comm_init_if(HECMW_Fint *comm, int *size, int *rank, HECMW_Fint *group)
Definition: hecmw_comm.c:793
int HECMW_Comm_free(HECMW_Comm *comm)
Definition: hecmw_comm.c:75
int HECMW_comm_get_size(void)
Definition: hecmw_comm.c:755
int HECMW_Comm_group(HECMW_Comm comm, HECMW_Group *group)
Definition: hecmw_comm.c:631
HECMW_Group HECMW_comm_get_group(void)
Definition: hecmw_comm.c:763
void HECMW_COMM_INIT_IF(HECMW_Fint *comm, int *size, int *rank, HECMW_Fint *group)
Definition: hecmw_comm.c:812
int HECMW_Group_rank(HECMW_Group group, int *rank)
Definition: hecmw_comm.c:593
int HECMW_comm_is_initialized(void)
Definition: hecmw_comm.c:749
HECMW_Comm HECMW_Comm_f2c(HECMW_Fint comm)
Definition: hecmw_comm.c:775
int HECMW_Group_incl(HECMW_Group group, int n, int *ranks, HECMW_Group *newgroup)
Definition: hecmw_comm.c:536
int HECMW_Wait(HECMW_Request *array_of_requests, HECMW_Status *array_of_statuses)
Definition: hecmw_comm.c:113
int HECMW_Allgather(void *sendbuf, int sendcount, HECMW_Datatype sendtype, void *recvbuf, int recvcount, HECMW_Datatype recvtype, HECMW_Comm comm)
Definition: hecmw_comm.c:478
int HECMW_Comm_dup(HECMW_Comm comm, HECMW_Comm *new_comm)
Definition: hecmw_comm.c:56
int HECMW_Bcast(void *buffer, int count, HECMW_Datatype datatype, int root, HECMW_Comm comm)
Definition: hecmw_comm.c:151
MPI_Group HECMW_Group
Definition: hecmw_config.h:32
#define HECMW_INT
Definition: hecmw_config.h:48
MPI_Datatype HECMW_Datatype
Definition: hecmw_config.h:38
MPI_Op HECMW_Op
Definition: hecmw_config.h:40
#define HECMW_MAX
Definition: hecmw_config.h:58
MPI_Fint HECMW_Fint
Definition: hecmw_config.h:42
MPI_Status HECMW_Status
Definition: hecmw_config.h:36
#define HECMW_DOUBLE
Definition: hecmw_config.h:50
MPI_Comm HECMW_Comm
Definition: hecmw_config.h:30
MPI_Request HECMW_Request
Definition: hecmw_config.h:34
#define HECMW_MIN
Definition: hecmw_config.h:56
#define HECMW_SUM
Definition: hecmw_config.h:60
#define HECMW_LONG_LONG
Definition: hecmw_config.h:54
#define HECMW_CHAR
Definition: hecmw_config.h:52
int HECMW_set_error(int errorno, const char *fmt,...)
Definition: hecmw_error.c:37
int HECMW_log(int loglv, const char *fmt,...)
Definition: hecmw_log.c:260
#define HECMW_LOG_DEBUG
Definition: hecmw_log.h:21
#define HECMW_ALL_E1003
Definition: hecmw_msgno.h:12
#define HECMW_ALL_E1002
Definition: hecmw_msgno.h:11
#define HECMW_ALL_E1001
Definition: hecmw_msgno.h:10