Exemplo n.º 1
0
FORTRAN_API void FORT_CALL mpi_group_excl_ ( MPI_Fint *group, MPI_Fint *n, MPI_Fint *ranks, MPI_Fint *newgroup, MPI_Fint *__ierr )
{
    MPI_Group l_newgroup;
   
    if (sizeof(MPI_Fint) == sizeof(int))
        *__ierr = MPI_Group_excl( MPI_Group_f2c(*group), *n, ranks, 
                                  &l_newgroup );
    else {
	int *l_ranks;
	int i;

	MPIR_FALLOC(l_ranks,(int*)MALLOC(sizeof(int)* (int)*n),
		    MPIR_COMM_WORLD, MPI_ERR_EXHAUSTED,
		    "MPI_Group_excl");
	for (i=0; i<*n; i++)
	    l_ranks[i] = (int)ranks[i];
	
        *__ierr = MPI_Group_excl( MPI_Group_f2c(*group), (int)*n, l_ranks, 
                                  &l_newgroup );

	FREE( l_ranks );
    }
    if (*__ierr == MPI_SUCCESS) 		     
        *newgroup = MPI_Group_c2f(l_newgroup);
}
Exemplo n.º 2
0
FORTRAN_API void FORT_CALL mpi_group_free_ ( MPI_Fint *group, MPI_Fint *__ierr )
{
    MPI_Group l_group = MPI_Group_f2c(*group);
    *__ierr = MPI_Group_free(&l_group);
    if (*__ierr == MPI_SUCCESS) 		     
        *group = MPI_Group_c2f(l_group);
}
Exemplo n.º 3
0
__FRET__ __FFNAME__(__FPARAMS__)
{
  double tstart, tstop;

#if HAVE_CREQ    /* HAVE _CREQ */ 
  MPI_Request creq; 
#endif
#if HAVE_CSTAT   /* HAVE _CSTAT */ 
  MPI_Status  cstat; 
#endif
#if HAVE_CCOMM_OUT
  MPI_Comm ccomm_out;
#endif           /* HAVE _CCOMM_OUT */
#if HAVE_CCOMM_INOUT
  MPI_Comm ccomm_inout;
#endif           /* HAVE _CCOMM_INOUT */

#if HAVE_CCOMM_INOUT
  ccomm_inout = MPI_Comm_f2c(*comm_inout);
#endif 

#if HAVE_CGROUP_OUT /* HAVE _CGROUP_OUT */
  MPI_Group cgroup_out;
#endif

  IPM_TIMESTAMP(tstart);
  p__FFNAME__(__FARGS__);
  IPM_TIMESTAMP(tstop);

  if( ipm_state!=STATE_ACTIVE ) {
    return;
  }
  
#if HAVE_CSTAT   /* HAVE_CSTAT */ 
  if (*info==MPI_SUCCESS) 
    MPI_Status_c2f(&cstat, status);
#endif

#if HAVE_CREQ    /* HAVE_CREQ */ 
  if( *info==MPI_SUCCESS )
    *req=MPI_Request_c2f(creq);
#endif

#if HAVE_CCOMM_OUT /* HAVE _CCOMM_OUT */
  if( *info==MPI_SUCCESS ) 
    *comm_out=MPI_Comm_c2f(ccomm_out);
#endif

#if HAVE_CCOMM_INOUT /* HAVE _CCOMM_INOUT */
  if( *info==MPI_SUCCESS ) 
    *comm_inout=MPI_Comm_c2f(ccomm_inout);
#endif

#if HAVE_CGROUP_OUT /* HAVE _CGROUP_OUT */
  if( *info==MPI_SUCCESS )
    *group_out=MPI_Group_c2f(cgroup_out);
#endif
  IPM___CFNAME__(__F2CARGS__, tstart, tstop);

}
Exemplo n.º 4
0
/* See the comments in group_rinclf.c.  ranges is correct without changes */
EXPORT_MPI_API void FORTRAN_API mpi_group_range_excl_ ( MPI_Fint *group, MPI_Fint *n, MPI_Fint ranges[][3], MPI_Fint *newgroup, MPI_Fint *__ierr )
{
    MPI_Group l_newgroup;

    if (sizeof(MPI_Fint) == sizeof(int))
        *__ierr = MPI_Group_range_excl(MPI_Group_f2c(*group),*n,
                                       ranges, &l_newgroup);
    else {
	int *l_ranges;
	int i;
	int j = 0;

        MPIR_FALLOC(l_ranges,(int*)MALLOC(sizeof(int)* ((int)*n * 3)),
		    MPIR_COMM_WORLD, MPI_ERR_EXHAUSTED,
		    "MPI_Group_range_excl");

        for (i=0; i<*n; i++) {
	    l_ranges[j++] = (int)ranges[i][0];
	    l_ranges[j++] = (int)ranges[i][1];
	    l_ranges[j++] = (int)ranges[i][2];
	}
	
        *__ierr = MPI_Group_range_excl(MPI_Group_f2c(*group), (int)*n,
                                       (int (*)[3])l_ranges, &l_newgroup);
	FREE( l_ranges );
	
    }
    *newgroup = MPI_Group_c2f(l_newgroup);
}
Exemplo n.º 5
0
void mpi_file_get_group_(MPI_Fint *fh, MPI_Fint *group, MPI_Fint *ierr )
{
    MPI_File fh_c;
    MPI_Group group_c;

    fh_c = MPI_File_f2c(*fh);
    *ierr = MPI_File_get_group(fh_c, &group_c);
    *group = MPI_Group_c2f(group_c);
}
Exemplo n.º 6
0
FORTRAN_API void FORT_CALL mpi_group_union_ ( MPI_Fint *group1, MPI_Fint *group2, MPI_Fint *group_out, MPI_Fint *__ierr )
{
    MPI_Group l_group_out;
    *__ierr = MPI_Group_union( MPI_Group_f2c(*group1), 
                               MPI_Group_f2c(*group2), 
                               &l_group_out );
    if (*__ierr == MPI_SUCCESS) 		     
        *group_out = MPI_Group_c2f( l_group_out );
}
Exemplo n.º 7
0
void mpi_file_get_group_f(MPI_Fint *fh, MPI_Fint *group, MPI_Fint *ierr)
{
    MPI_File c_fh = MPI_File_f2c(*fh);
    MPI_Group c_grp;

    *ierr = OMPI_INT_2_FINT(MPI_File_get_group(c_fh, &c_grp));
    if (MPI_SUCCESS == OMPI_FINT_2_INT(*ierr)) {
        *group = MPI_Group_c2f(c_grp);
    }
}
Exemplo n.º 8
0
void mpi_comm_group_f(MPI_Fint *comm, MPI_Fint *group, MPI_Fint *ierr)
{
    MPI_Group c_group;
    MPI_Comm c_comm = MPI_Comm_f2c( *comm );
    
    *ierr = OMPI_INT_2_FINT(MPI_Comm_group( c_comm, &c_group));
    if (MPI_SUCCESS == OMPI_FINT_2_INT(*ierr)) {
        *group = MPI_Group_c2f (c_group);
    }
}
Exemplo n.º 9
0
void ompi_comm_group_f(MPI_Fint *comm, MPI_Fint *group, MPI_Fint *ierr)
{
    int c_ierr;
    MPI_Group c_group;
    MPI_Comm c_comm = MPI_Comm_f2c( *comm );
    
    c_ierr = MPI_Comm_group( c_comm, &c_group);
    if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);

    if (MPI_SUCCESS == c_ierr) {
        *group = MPI_Group_c2f (c_group);
    }
}
Exemplo n.º 10
0
void ompi_file_get_group_f(MPI_Fint *fh, MPI_Fint *group, MPI_Fint *ierr)
{
    int c_ierr;
    MPI_File c_fh = MPI_File_f2c(*fh);
    MPI_Group c_grp;

    c_ierr = MPI_File_get_group(c_fh, &c_grp);
    if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);

    if (MPI_SUCCESS == c_ierr) {
        *group = MPI_Group_c2f(c_grp);
    }
}
Exemplo n.º 11
0
void f2cgroup_( MPI_Fint * group )
{
    MPI_Group wgroup;
    MPI_Comm_group( MPI_COMM_WORLD, &wgroup );
    *group = MPI_Group_c2f( wgroup );
}