/src/qsnet/qswutil.h

https://code.google.com/ · C Header · 75 lines · 37 code · 10 blank · 28 comment · 0 complexity · bb0c03bcbf35a21e7e3bab9c5a639efd MD5 · raw file

  1. /*****************************************************************************\
  2. * $Id$
  3. *****************************************************************************
  4. * Copyright (C) 2001-2006 The Regents of the University of California.
  5. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
  6. * Written by Jim Garlick <garlick@llnl.gov>.
  7. * UCRL-CODE-2003-005.
  8. *
  9. * This file is part of Pdsh, a parallel remote shell program.
  10. * For details, see <http://www.llnl.gov/linux/pdsh/>.
  11. *
  12. * Pdsh is free software; you can redistribute it and/or modify it under
  13. * the terms of the GNU General Public License as published by the Free
  14. * Software Foundation; either version 2 of the License, or (at your option)
  15. * any later version.
  16. *
  17. * Pdsh is distributed in the hope that it will be useful, but WITHOUT ANY
  18. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  19. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  20. * details.
  21. *
  22. * You should have received a copy of the GNU General Public License along
  23. * with Pdsh; if not, write to the Free Software Foundation, Inc.,
  24. * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  25. \*****************************************************************************/
  26. #ifndef _QSWUTIL_INCLUDED
  27. #define _QSWUTIL_INCLUDED
  28. #if defined(HAVE_LIBELANCTRL)
  29. # include <elan/capability.h>
  30. #elif defined(HAVE_LIBELAN3)
  31. # include <elan3/elan3.h>
  32. #endif
  33. #include "src/common/hostlist.h"
  34. #ifndef ELAN_MAX_RAILS
  35. # define ELAN_MAX_RAILS 16
  36. #endif
  37. #define QSW_RAILMASK_MAX ((1<<ELAN_MAX_RAILS) - 1)
  38. typedef struct {
  39. int prgnum;
  40. int rank;
  41. int nodeid;
  42. int procid;
  43. int nnodes;
  44. int nprocs;
  45. } qsw_info_t;
  46. int qsw_init(void);
  47. void qsw_fini(void);
  48. int qsw_encode_cap(char *s, int len, ELAN_CAPABILITY * cap);
  49. int qsw_encode_cap_bitmap(char *s, int len, ELAN_CAPABILITY * cap, int i);
  50. int qsw_decode_cap(char *s, ELAN_CAPABILITY * cap);
  51. int qsw_decode_cap_bitmap(char *s, ELAN_CAPABILITY * cap, int i);
  52. int qsw_cap_bitmap_count(void);
  53. int qsw_encode_info(char *s, int len, qsw_info_t * qi);
  54. int qsw_decode_info(char *s, qsw_info_t * qi);
  55. int qsw_init_capability(ELAN_CAPABILITY * cap, int nprocs,
  56. hostlist_t nodelist, int cyclic_alloc,
  57. unsigned int railmask);
  58. int qsw_get_prgnum(void);
  59. void qsw_setup_program(ELAN_CAPABILITY * cap, qsw_info_t * qi, uid_t uid);
  60. int qsw_prgsignal(int prgid, int signo);
  61. int qsw_spawn_neterr_thr(void);
  62. #endif /* _QSWUTIL_INCLUDED */
  63. /*
  64. * vi:tabstop=4 shiftwidth=4 expandtab
  65. */