[openib-general] [PATCH] MVAPICH: Use memory routines directly rather than cl_mem* routines

Hal Rosenstock halr at voltaire.com
Thu May 18 04:21:19 PDT 2006


MVAPICH: Use memory routines directly (cl_mem* routines were eliminated
in OpenSM/complib)

Use memory routines directly as these routines are part of ISO C

Signed-off-by: Hal Rosenstock <halr at voltaire.com>

This patch is only currently required on the trunk only

Index: mvapich-gen2/mpid/ch_gen2/ibmcgrp/ibmcgrp.c
===================================================================
--- mvapich-gen2/mpid/ch_gen2/ibmcgrp/ibmcgrp.c	(revision 7319)
+++ mvapich-gen2/mpid/ch_gen2/ibmcgrp/ibmcgrp.c	(working copy)
@@ -100,7 +100,7 @@ ibmcgrp_init( IN ibmcgrp_t * const p_ibm
   ib_api_status_t status;
 
   /* just making sure - cleanup the static global obj */
-  cl_memclr( p_ibmcgrp, sizeof( *p_ibmcgrp ) );
+  memset( p_ibmcgrp, 0, sizeof( *p_ibmcgrp ) );
 
   /* construct and init the log */
   p_ibmcgrp->p_log = (osm_log_t *)cl_malloc(sizeof(osm_log_t));
@@ -311,20 +311,20 @@ ibmcgrp_run( IN ibmcgrp_t * p_ibmcgrp )
    *
    * The query structures are locals.
    */
-  cl_memclr( &req, sizeof( req ) );
-  cl_memclr( &user, sizeof( user ) );
-  cl_memclr( &context, sizeof( context ) );
+  memset( &req, 0, sizeof( req ) );
+  memset( &user, 0, sizeof( user ) );
+  memset( &context, 0, sizeof( context ) );
 
   /* initialize some defaults on the MC grp request */
 
   /* use default values so we can change only what we want later */
-  cl_memclr(&mc_rec,sizeof(ib_member_rec_t));
+  memset(&mc_rec, 0, sizeof(ib_member_rec_t));
 
   /* Use the MGID provided */
-  cl_memcpy(&mc_rec.mgid, &(p_ibmcgrp->p_opt->mgid), sizeof(ib_gid_t));
+  memcpy(&mc_rec.mgid, &(p_ibmcgrp->p_opt->mgid), sizeof(ib_gid_t));
 
   /* our own port gid - as stored in the main object  */
-  cl_memcpy(&mc_rec.port_gid.unicast.interface_id ,
+  memcpy(&mc_rec.port_gid.unicast.interface_id,
             &p_ibmcgrp->port_guid,
             sizeof(p_ibmcgrp->port_guid)
             );
Index: mvapich-gen2/mpid/ch_gen2/ibmcgrp.c
===================================================================
--- mvapich-gen2/mpid/ch_gen2/ibmcgrp.c	(revision 7319)
+++ mvapich-gen2/mpid/ch_gen2/ibmcgrp.c	(working copy)
@@ -104,7 +104,7 @@ ibmcgrp_init( IN ibmcgrp_t * const p_ibm
   ib_api_status_t status;
 
   /* just making sure - cleanup the static global obj */
-  cl_memclr( p_ibmcgrp, sizeof( *p_ibmcgrp ) );
+  memset( p_ibmcgrp, 0, sizeof( *p_ibmcgrp ) );
 
   /* construct and init the log */
   p_ibmcgrp->p_log = (osm_log_t *)cl_malloc(sizeof(osm_log_t));
@@ -315,20 +315,20 @@ ibmcgrp_run( IN ibmcgrp_t * p_ibmcgrp )
    *
    * The query structures are locals.
    */
-  cl_memclr( &req, sizeof( req ) );
-  cl_memclr( &user, sizeof( user ) );
-  cl_memclr( &context, sizeof( context ) );
+  memset( &req, 0, sizeof( req ) );
+  memset( &user, 0, sizeof( user ) );
+  memset( &context, 0, sizeof( context ) );
 
   /* initialize some defaults on the MC grp request */
 
   /* use default values so we can change only what we want later */
-  cl_memclr(&mc_rec,sizeof(ib_member_rec_t));
+  memset(&mc_rec, 0, sizeof(ib_member_rec_t));
 
   /* Use the MGID provided */
-  cl_memcpy(&mc_rec.mgid, &(p_ibmcgrp->p_opt->mgid), sizeof(ib_gid_t));
+  memcpy(&mc_rec.mgid, &(p_ibmcgrp->p_opt->mgid), sizeof(ib_gid_t));
 
   /* our own port gid - as stored in the main object  */
-  cl_memcpy(&mc_rec.port_gid.unicast.interface_id ,
+  memcpy(&mc_rec.port_gid.unicast.interface_id,
             &p_ibmcgrp->port_guid,
             sizeof(p_ibmcgrp->port_guid)
             );






More information about the general mailing list