summaryrefslogtreecommitdiff
path: root/src/comm
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-01-28 00:24:28 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-01-28 00:24:28 +0000
commit9c97a201f9e51181bf3143c6d8a0dedfc23c742d (patch)
tree2a70272727f308824b889ca409cbf1bee570e531 /src/comm
parentf16bc7b6fee87a8383f446a9a9d63011510846df (diff)
Added new function
int CCTK_SyncGroupsI(cGH *GH, int n_groups, int *groups) which synchronises a list of groups. Added some more grdoc. Added #include of new header for this file. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@1321 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/comm')
-rw-r--r--src/comm/CactusSync.c115
1 files changed, 101 insertions, 14 deletions
diff --git a/src/comm/CactusSync.c b/src/comm/CactusSync.c
index 1d3c162b..07120a91 100644
--- a/src/comm/CactusSync.c
+++ b/src/comm/CactusSync.c
@@ -1,10 +1,3 @@
-#include <stdlib.h>
-#include "cctk_Flesh.h"
-#include "cctk_FortranString.h"
-#include "cctk_Comm.h"
-#include "cctk_Groups.h"
-
-
/*@@
@file CactusSync.c
@date Thu Sep 18 14:27:18 1999
@@ -16,29 +9,77 @@
It ends up calling CCTK_SyncGroup(GH,groupname), which is overloaded (currently
by PUGH).
- @enddesc
+ @enddesc
+ @version $Header$
@@*/
-void CCTK_SyncGroupI(cGH *GH, int groupi) {
+#include <stdlib.h>
+
+#include "cctk_Flesh.h"
+#include "cctk_FortranString.h"
+#include "cctk_Comm.h"
+#include "cctk_Groups.h"
+#include "cctk_Sync.h"
+
+static char *rcsid = "$Header$";
+
+ /*@@
+ @routine CCTK_SyncGroupI
+ @date Thu Sep 18 14:27:18 1999
+ @author Gerd Lanfermann
+ @desc
+
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+void CCTK_SyncGroupI(cGH *GH,
+ int groupi)
+{
char *groupname = CCTK_GroupName(groupi);
CCTK_SyncGroup(GH,groupname);
+
free(groupname);
}
-void FMODIFIER FORTRAN_NAME(CCTK_SyncGroupI)(cGH *GH, int *groupi) {
+void FMODIFIER FORTRAN_NAME(CCTK_SyncGroupI)(cGH *GH, int *groupi)
+{
CCTK_SyncGroupI(GH, *groupi);
}
-void CCTK_SyncGroupWithVar(cGH *GH, const char *varn) {
+ /*@@
+ @routine CCTK_SyncGroupWithVar
+ @date Thu Sep 18 14:27:18 1999
+ @author Gerd Lanfermann
+ @desc
+
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+void CCTK_SyncGroupWithVar(cGH *GH,
+ const char *varn)
+{
int groupi;
+
groupi = CCTK_GroupIndexFromVarI(CCTK_VarIndex(varn));
+
CCTK_SyncGroupI(GH,groupi);
}
-void FMODIFIER FORTRAN_NAME(CCTK_SyncGroupWithVar)(cGH *GH, ONE_FORTSTRING_ARG) {
+void FMODIFIER FORTRAN_NAME(CCTK_SyncGroupWithVar)(cGH *GH, ONE_FORTSTRING_ARG)
+{
ONE_FORTSTRING_CREATE(varn);
CCTK_SyncGroupWithVar(GH,varn);
free(varn);
@@ -46,14 +87,60 @@ void FMODIFIER FORTRAN_NAME(CCTK_SyncGroupWithVar)(cGH *GH, ONE_FORTSTRING_ARG)
-void CCTK_SyncGroupWithVarI(cGH *GH, int vari) {
+ /*@@
+ @routine CCTK_SyncGroupWithVarI
+ @date Thu Sep 18 14:27:18 1999
+ @author Gerd Lanfermann
+ @desc
+
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+void CCTK_SyncGroupWithVarI(cGH *GH,
+ int vari)
+{
int groupi;
+
groupi = CCTK_GroupIndexFromVarI(vari);
+
CCTK_SyncGroupI(GH,groupi);
}
-void FMODIFIER FORTRAN_NAME(CCTK_SyncGroupWithVarI)(cGH *GH, int *vari) {
+void FMODIFIER FORTRAN_NAME(CCTK_SyncGroupWithVarI)(cGH *GH, int *vari)
+{
CCTK_SyncGroupWithVarI(GH,*vari);
}
+ /*@@
+ @routine CCTK_SyncGroupsI
+ @date Thu Jan 27 18:00:15 2000
+ @author Tom Goodale
+ @desc
+ Synchronises a list of groups by group index.
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+int CCTK_SyncGroupsI(cGH *GH,
+ int n_groups,
+ int *groups)
+{
+ int i;
+
+ for(i = 0; i < n_groups; i++)
+ {
+ CCTK_SyncGroupI(GH, i);
+ }
+
+ return 0;
+}