1
1

Remove trailing spaces from SM BTL.

This commit was SVN r17794.
Этот коммит содержится в:
Gleb Natapov 2008-03-09 13:17:13 +00:00
родитель 4267f2b967
Коммит b0b21c68b4
7 изменённых файлов: 62 добавлений и 62 удалений

Просмотреть файл

@ -5,15 +5,15 @@
* Copyright (c) 2004-2008 The University of Tennessee and The University * Copyright (c) 2004-2008 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights * of Tennessee Research Foundation. All rights
* reserved. * reserved.
* Copyright (c) 2004-2007 High Performance Computing Center Stuttgart, * Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved. * University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California. * Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved. * All rights reserved.
* Copyright (c) 2006-2007 Voltaire. All rights reserved. * Copyright (c) 2006-2007 Voltaire. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
* *
* $HEADER$ * $HEADER$
*/ */
@ -104,7 +104,7 @@ mca_btl_sm_t mca_btl_sm = {
mca_btl_sm_free, mca_btl_sm_free,
mca_btl_sm_prepare_src, mca_btl_sm_prepare_src,
NULL, NULL,
mca_btl_sm_send, mca_btl_sm_send,
NULL, /* put */ NULL, /* put */
NULL, /* get */ NULL, /* get */
mca_btl_base_dump, mca_btl_base_dump,
@ -129,9 +129,9 @@ mca_btl_sm_module_resource_t mca_btl_sm_module_resource;
#define OFFSET2ADDR(OFFSET, BASE) ((ptrdiff_t)(OFFSET) + (char*)(BASE)) #define OFFSET2ADDR(OFFSET, BASE) ((ptrdiff_t)(OFFSET) + (char*)(BASE))
int mca_btl_sm_add_procs( int mca_btl_sm_add_procs(
struct mca_btl_base_module_t* btl, struct mca_btl_base_module_t* btl,
size_t nprocs, size_t nprocs,
struct ompi_proc_t **procs, struct ompi_proc_t **procs,
struct mca_btl_base_endpoint_t **peers, struct mca_btl_base_endpoint_t **peers,
ompi_bitmap_t* reachability) ompi_bitmap_t* reachability)
{ {
@ -205,7 +205,7 @@ int mca_btl_sm_add_procs(
OBJ_CONSTRUCT(&peer->pending_sends, opal_list_t); OBJ_CONSTRUCT(&peer->pending_sends, opal_list_t);
#if OMPI_ENABLE_PROGRESS_THREADS == 1 #if OMPI_ENABLE_PROGRESS_THREADS == 1
sprintf(path, "%s"OPAL_PATH_SEP"sm_fifo.%lu", orte_process_info.job_session_dir, sprintf(path, "%s"OPAL_PATH_SEP"sm_fifo.%lu", orte_process_info.job_session_dir,
(unsigned long)procs[proc]->proc_name.vpid); (unsigned long)procs[proc]->proc_name.vpid);
peer->fifo_fd = open(path, O_WRONLY); peer->fifo_fd = open(path, O_WRONLY);
if(peer->fifo_fd < 0) { if(peer->fifo_fd < 0) {
@ -295,8 +295,8 @@ int mca_btl_sm_add_procs(
/* Allocate Shared Memory BTL process coordination /* Allocate Shared Memory BTL process coordination
* data structure. This will reside in shared memory */ * data structure. This will reside in shared memory */
/* /*
* Create backing file - only first time through * Create backing file - only first time through
*/ */
if ( !mca_btl_sm.btl_inited ) { if ( !mca_btl_sm.btl_inited ) {
/* set file name */ /* set file name */
@ -312,7 +312,7 @@ int mca_btl_sm_add_procs(
size = sizeof(mca_btl_sm_module_resource_t); size = sizeof(mca_btl_sm_module_resource_t);
if(NULL==(mca_btl_sm_component.mmap_file=mca_common_sm_mmap_init(size, if(NULL==(mca_btl_sm_component.mmap_file=mca_common_sm_mmap_init(size,
mca_btl_sm_component.sm_resource_ctl_file, mca_btl_sm_component.sm_resource_ctl_file,
sizeof(mca_btl_sm_module_resource_t), 0))) sizeof(mca_btl_sm_module_resource_t), 0)))
{ {
opal_output(0, "mca_btl_sm_add_procs: unable to create shared memory BTL coordinating strucure :: size %lu \n", opal_output(0, "mca_btl_sm_add_procs: unable to create shared memory BTL coordinating strucure :: size %lu \n",
(unsigned long)size); (unsigned long)size);
@ -330,7 +330,7 @@ int mca_btl_sm_add_procs(
* make this array growable, but then one would need to uses mutexes * make this array growable, but then one would need to uses mutexes
* for any access to these queues to ensure data consistancy when * for any access to these queues to ensure data consistancy when
* the array is grown */ * the array is grown */
if(0 == mca_btl_sm_component.my_smp_rank ) { if(0 == mca_btl_sm_component.my_smp_rank ) {
/* allocate ompi_fifo_t strucutes for each fifo of the queue /* allocate ompi_fifo_t strucutes for each fifo of the queue
* pairs - one per pair of local processes */ * pairs - one per pair of local processes */
@ -412,18 +412,18 @@ int mca_btl_sm_add_procs(
* flags are set */ * flags are set */
opal_atomic_mb(); opal_atomic_mb();
} }
/* Note: Need to make sure that proc 0 initializes control /* Note: Need to make sure that proc 0 initializes control
* structures before any of the other procs can progress */ * structures before any of the other procs can progress */
if( 0 != mca_btl_sm_component.my_smp_rank ) if( 0 != mca_btl_sm_component.my_smp_rank )
{ {
/* spin unitl local proc 0 initializes the segment */ /* spin unitl local proc 0 initializes the segment */
while(!mca_btl_sm_component.mmap_file->map_seg->seg_inited) { while(!mca_btl_sm_component.mmap_file->map_seg->seg_inited) {
opal_atomic_rmb(); opal_atomic_rmb();
opal_progress(); opal_progress();
} }
} }
/* set the base of the shared memory segment, and flag /* set the base of the shared memory segment, and flag
* indicating that it is set */ * indicating that it is set */
tmp_ptr=(volatile char **) tmp_ptr=(volatile char **)
@ -647,9 +647,9 @@ CLEANUP:
} }
int mca_btl_sm_del_procs( int mca_btl_sm_del_procs(
struct mca_btl_base_module_t* btl, struct mca_btl_base_module_t* btl,
size_t nprocs, size_t nprocs,
struct ompi_proc_t **procs, struct ompi_proc_t **procs,
struct mca_btl_base_endpoint_t **peers) struct mca_btl_base_endpoint_t **peers)
{ {
return OMPI_SUCCESS; return OMPI_SUCCESS;
@ -675,7 +675,7 @@ int mca_btl_sm_finalize(struct mca_btl_base_module_t* btl)
} }
/* /*
* Register callback function for error handling.. * Register callback function for error handling..
*/ */
int mca_btl_sm_register_error_cb( int mca_btl_sm_register_error_cb(
@ -730,7 +730,7 @@ extern int mca_btl_sm_free(
{ {
mca_btl_sm_frag_t* frag = (mca_btl_sm_frag_t*)des; mca_btl_sm_frag_t* frag = (mca_btl_sm_frag_t*)des;
MCA_BTL_SM_FRAG_RETURN(frag); MCA_BTL_SM_FRAG_RETURN(frag);
return OMPI_SUCCESS; return OMPI_SUCCESS;
} }
@ -763,7 +763,7 @@ struct mca_btl_base_descriptor_t* mca_btl_sm_prepare_src(
if(reserve + max_data > frag->size) { if(reserve + max_data > frag->size) {
max_data = frag->size - reserve; max_data = frag->size - reserve;
} }
iov.iov_len = max_data; iov.iov_len = max_data;
iov.iov_base = iov.iov_base =
(IOVBASE_TYPE*)(((unsigned char*)(frag->segment.seg_addr.pval)) + (IOVBASE_TYPE*)(((unsigned char*)(frag->segment.seg_addr.pval)) +
@ -780,7 +780,7 @@ struct mca_btl_base_descriptor_t* mca_btl_sm_prepare_src(
return &frag->base; return &frag->base;
} }
/** /**
* Initiate a send to the peer. * Initiate a send to the peer.
* *
@ -804,9 +804,9 @@ int mca_btl_sm_send(
frag->endpoint = endpoint; frag->endpoint = endpoint;
/* /*
* post the descriptor in the queue - post with the relative * post the descriptor in the queue - post with the relative
* address * address
*/ */
MCA_BTL_SM_FIFO_WRITE(endpoint, endpoint->my_smp_rank, MCA_BTL_SM_FIFO_WRITE(endpoint, endpoint->my_smp_rank,
endpoint->peer_smp_rank, frag->hdr, false, rc); endpoint->peer_smp_rank, frag->hdr, false, rc);

Просмотреть файл

@ -6,15 +6,15 @@
* Copyright (c) 2004-2006 The University of Tennessee and The University * Copyright (c) 2004-2006 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights * of Tennessee Research Foundation. All rights
* reserved. * reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved. * University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California. * Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved. * All rights reserved.
* Copyright (c) 2006-2007 Voltaire. All rights reserved. * Copyright (c) 2006-2007 Voltaire. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
* *
* $HEADER$ * $HEADER$
*/ */
/** /**
@ -43,7 +43,7 @@
#include "opal/event/event.h" #include "opal/event/event.h"
#include "ompi/mca/pml/pml.h" #include "ompi/mca/pml/pml.h"
#include "ompi/mca/btl/btl.h" #include "ompi/mca/btl/btl.h"
#include "ompi/mca/btl/base/base.h" #include "ompi/mca/btl/base/base.h"
#include "ompi/mca/mpool/mpool.h" #include "ompi/mca/mpool/mpool.h"
#include "ompi/mca/common/sm/common_sm_mmap.h" #include "ompi/mca/common/sm/common_sm_mmap.h"
@ -91,7 +91,7 @@ struct mca_btl_sm_component_t {
size_t eager_limit; /**< first fragment size */ size_t eager_limit; /**< first fragment size */
size_t max_frag_size; /**< maximum (second and beyone) fragment size */ size_t max_frag_size; /**< maximum (second and beyone) fragment size */
opal_mutex_t sm_lock; opal_mutex_t sm_lock;
char* sm_resource_ctl_file; /**< name of shared memory file used char* sm_resource_ctl_file; /**< name of shared memory file used
to coordinate resource usage */ to coordinate resource usage */
mca_common_sm_mmap_t *mmap_file; /**< description of mmap'ed file */ mca_common_sm_mmap_t *mmap_file; /**< description of mmap'ed file */
mca_btl_sm_module_resource_t *sm_ctl_header; /* control header in mca_btl_sm_module_resource_t *sm_ctl_header; /* control header in
@ -153,14 +153,14 @@ extern int mca_btl_sm_component_close(void);
/** /**
* SM module initialization. * SM module initialization.
* *
* @param num_btls (OUT) Number of BTLs returned in BTL array. * @param num_btls (OUT) Number of BTLs returned in BTL array.
* @param enable_progress_threads (IN) Flag indicating whether BTL is allowed to have progress threads * @param enable_progress_threads (IN) Flag indicating whether BTL is allowed to have progress threads
* @param enable_mpi_threads (IN) Flag indicating whether BTL must support multilple simultaneous invocations from different threads * @param enable_mpi_threads (IN) Flag indicating whether BTL must support multilple simultaneous invocations from different threads
* *
*/ */
extern mca_btl_base_module_t** mca_btl_sm_component_init( extern mca_btl_base_module_t** mca_btl_sm_component_init(
int *num_btls, int *num_btls,
bool enable_progress_threads, bool enable_progress_threads,
bool enable_mpi_threads bool enable_mpi_threads
); );
@ -196,7 +196,7 @@ int mca_btl_sm_register_error_cb(
/** /**
* Cleanup any resources held by the BTL. * Cleanup any resources held by the BTL.
* *
* @param btl BTL instance. * @param btl BTL instance.
* @return OMPI_SUCCESS or error status on failure. * @return OMPI_SUCCESS or error status on failure.
*/ */
@ -212,12 +212,12 @@ extern int mca_btl_sm_finalize(
* Called for message that is send from process with the virtual * Called for message that is send from process with the virtual
* address of the shared memory segment being different than that of * address of the shared memory segment being different than that of
* the receiver. * the receiver.
* *
* @param btl (IN) * @param btl (IN)
* @param proc (IN) * @param proc (IN)
* @param peer (OUT) * @param peer (OUT)
* @return OMPI_SUCCESS or error status on failure. * @return OMPI_SUCCESS or error status on failure.
* *
*/ */
extern int mca_btl_sm_add_procs( extern int mca_btl_sm_add_procs(
@ -314,7 +314,7 @@ int mca_btl_sm_ft_event(int state);
void mca_btl_sm_component_event_thread(opal_object_t*); void mca_btl_sm_component_event_thread(opal_object_t*);
#endif #endif
#if OMPI_ENABLE_PROGRESS_THREADS == 1 #if OMPI_ENABLE_PROGRESS_THREADS == 1
#define MCA_BTL_SM_SIGNAL_PEER(peer) \ #define MCA_BTL_SM_SIGNAL_PEER(peer) \
{ \ { \
unsigned char cmd = DATA; \ unsigned char cmd = DATA; \

Просмотреть файл

@ -5,15 +5,15 @@
* Copyright (c) 2004-2008 The University of Tennessee and The University * Copyright (c) 2004-2008 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights * of Tennessee Research Foundation. All rights
* reserved. * reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved. * University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California. * Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved. * All rights reserved.
* Copyright (c) 2006-2007 Voltaire. All rights reserved. * Copyright (c) 2006-2007 Voltaire. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
* *
* $HEADER$ * $HEADER$
*/ */
#include "ompi_config.h" #include "ompi_config.h"
@ -60,7 +60,7 @@
/* /*
* Shared Memory (SM) component instance. * Shared Memory (SM) component instance.
*/ */
mca_btl_sm_component_t mca_btl_sm_component = { mca_btl_sm_component_t mca_btl_sm_component = {
@ -85,7 +85,7 @@ mca_btl_sm_component_t mca_btl_sm_component = {
MCA_BASE_METADATA_PARAM_NONE MCA_BASE_METADATA_PARAM_NONE
}, },
mca_btl_sm_component_init, mca_btl_sm_component_init,
mca_btl_sm_component_progress, mca_btl_sm_component_progress,
} /* end super */ } /* end super */
}; };
@ -96,7 +96,7 @@ mca_btl_sm_component_t mca_btl_sm_component = {
*/ */
static inline char* mca_btl_sm_param_register_string( static inline char* mca_btl_sm_param_register_string(
const char* param_name, const char* param_name,
const char* default_value) const char* default_value)
{ {
char *param_value; char *param_value;
@ -104,9 +104,9 @@ static inline char* mca_btl_sm_param_register_string(
mca_base_param_lookup_string(id, &param_value); mca_base_param_lookup_string(id, &param_value);
return param_value; return param_value;
} }
static inline int mca_btl_sm_param_register_int( static inline int mca_btl_sm_param_register_int(
const char* param_name, const char* param_name,
int default_value) int default_value)
{ {
int id = mca_base_param_register_int("btl","sm",param_name,NULL,default_value); int id = mca_base_param_register_int("btl","sm",param_name,NULL,default_value);
@ -171,7 +171,7 @@ int mca_btl_sm_component_open(void)
mca_btl_sm.super.btl_bandwidth = 900; mca_btl_sm.super.btl_bandwidth = 900;
mca_btl_sm.super.btl_latency = 100; mca_btl_sm.super.btl_latency = 100;
mca_btl_base_param_register(&mca_btl_sm_component.super.btl_version, mca_btl_base_param_register(&mca_btl_sm_component.super.btl_version,
&mca_btl_sm.super); &mca_btl_sm.super);
mca_btl_sm_component.max_frag_size = mca_btl_sm.super.btl_max_send_size; mca_btl_sm_component.max_frag_size = mca_btl_sm.super.btl_max_send_size;
mca_btl_sm_component.eager_limit = mca_btl_sm.super.btl_eager_limit; mca_btl_sm_component.eager_limit = mca_btl_sm.super.btl_eager_limit;
@ -213,7 +213,7 @@ int mca_btl_sm_component_close(void)
errno); errno);
goto CLEANUP; goto CLEANUP;
} }
/* unlink file, so that it will be deleted when all references /* unlink file, so that it will be deleted when all references
* to it are gone - no error checking, since we want all procs * to it are gone - no error checking, since we want all procs
* to call this, so that in an abnormal termination scenario, * to call this, so that in an abnormal termination scenario,
@ -227,7 +227,7 @@ int mca_btl_sm_component_close(void)
if(mca_btl_sm_component.sm_fifo_fd > 0) { if(mca_btl_sm_component.sm_fifo_fd > 0) {
/* write a done message down the pipe */ /* write a done message down the pipe */
unsigned char cmd = DONE; unsigned char cmd = DONE;
if( write(mca_btl_sm_component.sm_fifo_fd,&cmd,sizeof(cmd)) != if( write(mca_btl_sm_component.sm_fifo_fd,&cmd,sizeof(cmd)) !=
sizeof(cmd)){ sizeof(cmd)){
opal_output(0, "mca_btl_sm_component_close: write fifo failed: errno=%d\n", opal_output(0, "mca_btl_sm_component_close: write fifo failed: errno=%d\n",
errno); errno);
@ -249,7 +249,7 @@ CLEANUP:
* SM component initialization * SM component initialization
*/ */
mca_btl_base_module_t** mca_btl_sm_component_init( mca_btl_base_module_t** mca_btl_sm_component_init(
int *num_btls, int *num_btls,
bool enable_progress_threads, bool enable_progress_threads,
bool enable_mpi_threads) bool enable_mpi_threads)
{ {
@ -263,7 +263,7 @@ mca_btl_base_module_t** mca_btl_sm_component_init(
#if OMPI_ENABLE_PROGRESS_THREADS == 1 #if OMPI_ENABLE_PROGRESS_THREADS == 1
/* create a named pipe to receive events */ /* create a named pipe to receive events */
sprintf( mca_btl_sm_component.sm_fifo_path, sprintf( mca_btl_sm_component.sm_fifo_path,
"%s"OPAL_PATH_SEP"sm_fifo.%lu", orte_process_info.job_session_dir, "%s"OPAL_PATH_SEP"sm_fifo.%lu", orte_process_info.job_session_dir,
(unsigned long)ORTE_PROC_MY_NAME->vpid ); (unsigned long)ORTE_PROC_MY_NAME->vpid );
if(mkfifo(mca_btl_sm_component.sm_fifo_path, 0660) < 0) { if(mkfifo(mca_btl_sm_component.sm_fifo_path, 0660) < 0) {
@ -320,7 +320,7 @@ void mca_btl_sm_component_event_thread(opal_object_t* thread)
if( DONE == cmd ){ if( DONE == cmd ){
/* return when done message received */ /* return when done message received */
return; return;
} }
mca_btl_sm_component_progress(); mca_btl_sm_component_progress();
} }
} }

Просмотреть файл

@ -5,15 +5,15 @@
* Copyright (c) 2004-2005 The University of Tennessee and The University * Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights * of Tennessee Research Foundation. All rights
* reserved. * reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved. * University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California. * Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved. * All rights reserved.
* Copyright (c) 2006-2007 Voltaire. All rights reserved. * Copyright (c) 2006-2007 Voltaire. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
* *
* $HEADER$ * $HEADER$
*/ */
/** /**
@ -28,7 +28,7 @@
/** /**
* An abstraction that represents a connection to a endpoint process. * An abstraction that represents a connection to a endpoint process.
* An instance of mca_ptl_base_endpoint_t is associated w/ each process * An instance of mca_ptl_base_endpoint_t is associated w/ each process
* and BTL pair at startup. * and BTL pair at startup.
*/ */
@ -43,6 +43,6 @@ struct mca_btl_base_endpoint_t {
opal_list_t pending_sends; /**< pending data to send */ opal_list_t pending_sends; /**< pending data to send */
}; };
void void
btl_sm_add_pending(struct mca_btl_base_endpoint_t *ep, void *data, bool resend); btl_sm_add_pending(struct mca_btl_base_endpoint_t *ep, void *data, bool resend);
#endif #endif

Просмотреть файл

@ -24,6 +24,6 @@ do { \
} \ } \
if(opal_using_threads()) \ if(opal_using_threads()) \
opal_atomic_unlock(fifo->head_lock); \ opal_atomic_unlock(fifo->head_lock); \
} while(0) } while(0)
#endif #endif

Просмотреть файл

@ -5,14 +5,14 @@
* Copyright (c) 2004-2005 The University of Tennessee and The University * Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights * of Tennessee Research Foundation. All rights
* reserved. * reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved. * University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California. * Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved. * All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
* *
* $HEADER$ * $HEADER$
*/ */
#include "ompi_config.h" #include "ompi_config.h"

Просмотреть файл

@ -5,15 +5,15 @@
* Copyright (c) 2004-2006 The University of Tennessee and The University * Copyright (c) 2004-2006 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights * of Tennessee Research Foundation. All rights
* reserved. * reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved. * University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California. * Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved. * All rights reserved.
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
* $COPYRIGHT$ * $COPYRIGHT$
* *
* Additional copyrights may follow * Additional copyrights may follow
* *
* $HEADER$ * $HEADER$
*/ */
/** /**