Exemplo n.º 1
0
void ibv_ack_cq_events(struct ibv_cq * cq, unsigned int nevents)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
 // PDEBUG("******** WRAPPER for ibv_ack_cq_events\n");

  _ack_cq_events(cq, nevents);

  DMTCP_PLUGIN_ENABLE_CKPT();
}
Exemplo n.º 2
0
void ibv_free_device_list(struct ibv_device **list)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
//  PDEBUG("********* WRAPPER for ibv_free_device_list\n");

  _free_device_list(list);

  DMTCP_PLUGIN_ENABLE_CKPT();
}
Exemplo n.º 3
0
struct ibv_ah * ibv_create_ah(struct ibv_pd *pd, struct ibv_ah_attr *attr){
  DMTCP_PLUGIN_DISABLE_CKPT();
//  PDEBUG("******** WRAPPER for ibv_create_ah\n");

  struct ibv_ah *rslt = _create_ah(pd, attr);

  DMTCP_PLUGIN_ENABLE_CKPT();
  return rslt;
}
Exemplo n.º 4
0
void ibv_ack_async_event(struct ibv_async_event *event)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
 // PDEBUG("******* WRAPPER FOR ibv_ack_async_event\n");

  _ack_async_event(event);

  DMTCP_PLUGIN_ENABLE_CKPT();
}
Exemplo n.º 5
0
uint64_t ibv_get_device_guid(struct ibv_device *device)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
//  PDEBUG("******* WRAPPER for ibv_get_device_guid\n");

  uint64_t rslt = _get_device_guid(device);

  DMTCP_PLUGIN_ENABLE_CKPT();
  return rslt;
}
Exemplo n.º 6
0
int ibv_modify_srq(struct ibv_srq *srq,
                   struct ibv_srq_attr *srq_attr,
                   int srq_attr_mask)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
//  PDEBUG("******** WRAPPER for ibv_modify_srq\n");
  int rslt = _modify_srq(srq, srq_attr, srq_attr_mask);
  DMTCP_PLUGIN_ENABLE_CKPT();
  return rslt;
}
Exemplo n.º 7
0
struct ibv_srq *ibv_create_srq(struct ibv_pd * pd, struct ibv_srq_init_attr * srq_init_attr)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
 // PDEBUG("******** WRAPPER for ibv_create_srq\n");

  struct ibv_srq * user_copy = _create_srq(pd, srq_init_attr);

  DMTCP_PLUGIN_ENABLE_CKPT();
  return user_copy;
}
Exemplo n.º 8
0
struct ibv_pd *ibv_alloc_pd(struct ibv_context *context)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
//  PDEBUG("******* WRAPPER FOR ibv_alloc_pd\n");

  struct ibv_pd * user_copy = _alloc_pd(context);

  DMTCP_PLUGIN_ENABLE_CKPT();
  return user_copy;
}
Exemplo n.º 9
0
int ibv_destroy_comp_channel(struct ibv_comp_channel * channel)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
//  PDEBUG("****** WRAPPER for ibv_destroy_comp_channel\n");

  int rslt = _destroy_comp_channel(channel);

  DMTCP_PLUGIN_ENABLE_CKPT();
  return rslt;
}
Exemplo n.º 10
0
struct ibv_qp *ibv_create_qp(struct ibv_pd *pd, struct ibv_qp_init_attr *qp_init_attr)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
//  PDEBUG("******** WRAPPER for ibv_create_qp\n");

  struct ibv_qp * user_copy = _create_qp(pd, qp_init_attr);

  DMTCP_PLUGIN_ENABLE_CKPT();
  return user_copy;
}
Exemplo n.º 11
0
int ibv_query_pkey(struct ibv_context *context, uint8_t port_num,  int index, uint16_t *pkey)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
//  PDEBUG("******* WRAPPER for begin of ibv_query_pkey\n");

  int rslt = _query_pkey(context,port_num, index, pkey);

  DMTCP_PLUGIN_ENABLE_CKPT();
  return rslt;
}
Exemplo n.º 12
0
int ibv_destroy_cq(struct ibv_cq *cq)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
 // PDEBUG("****** WRAPPER for ibv_destroy_cq\n");

  int rslt = _destroy_cq(cq);

  DMTCP_PLUGIN_ENABLE_CKPT();
  return rslt;
}
Exemplo n.º 13
0
struct ibv_context *ibv_open_device(struct ibv_device *dev)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
//  PDEBUG("******* WRAPPER for begin of ibv_open_device\n");

  struct ibv_context * user_copy = _open_device(dev);

  DMTCP_PLUGIN_ENABLE_CKPT();
  return user_copy;
}
Exemplo n.º 14
0
int ibv_query_device(struct ibv_context *context, struct ibv_device_attr *device_attr)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
//  PDEBUG("******* WRAPPER for begin of ibv_query_device\n");

  int rslt = _query_device(context,device_attr);

  DMTCP_PLUGIN_ENABLE_CKPT();
  return rslt;
}
Exemplo n.º 15
0
int ibv_close_device(struct ibv_context *context)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
//  PDEBUG("***** WRAPPER for ibv_close_device\n");

  int rslt = _close_device(context);

  DMTCP_PLUGIN_ENABLE_CKPT();
  return rslt;
}
Exemplo n.º 16
0
int ibv_dereg_mr(struct ibv_mr *mr)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
//  PDEBUG("****** WRAPPER for ibv_dereg_mr\n");

  int rslt = _dereg_mr(mr);

  DMTCP_PLUGIN_ENABLE_CKPT();
  return rslt;
}
Exemplo n.º 17
0
int ibv_dealloc_pd(struct ibv_pd *pd)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
//  PDEBUG("****** WRAPPER for ibv_dealloc_pd\n");

  int rslt = _dealloc_pd(pd);

  DMTCP_PLUGIN_ENABLE_CKPT();
  return rslt;
}
Exemplo n.º 18
0
int ibv_query_gid(struct ibv_context *context, uint8_t port_num, int index, union ibv_gid *gid)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
//  PDEBUG("******* WRAPPER for begin of ibv_query_gid\n");

  int rslt = _query_gid(context,port_num, index, gid);

  DMTCP_PLUGIN_ENABLE_CKPT();
  return rslt;
}
Exemplo n.º 19
0
int ibv_destroy_qp(struct ibv_qp *qp)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
  //PDEBUG("****** WRAPPER for ibv_destroy qp\n");

  int rslt = _destroy_qp(qp);

  DMTCP_PLUGIN_ENABLE_CKPT();
  return rslt;
}
Exemplo n.º 20
0
int ibv_resize_cq(struct ibv_cq *cq, int cqe)
{

  DMTCP_PLUGIN_DISABLE_CKPT();
  //PDEBUG("****** WRAPPER for ibv_resize_cq\n");

  int rslt = _resize_cq(cq,cqe);

  DMTCP_PLUGIN_ENABLE_CKPT();
  return rslt;
}
extern "C" pid_t getpgrp(void)
{
  DMTCP_PLUGIN_DISABLE_CKPT();

  pid_t pgrp = _real_getpgrp();
  pid_t origPgrp =  REAL_TO_VIRTUAL_PID( pgrp );

  DMTCP_PLUGIN_ENABLE_CKPT();

  return origPgrp;
}
extern "C" int setpgrp(void)
{
  DMTCP_PLUGIN_DISABLE_CKPT();

  pid_t realPid = _real_setpgrp();
  pid_t virtualPid = REAL_TO_VIRTUAL_PID(realPid);

  DMTCP_PLUGIN_ENABLE_CKPT();

  return virtualPid;
}
extern "C" pid_t setsid(void)
{
  DMTCP_PLUGIN_DISABLE_CKPT();

  pid_t pid = _real_setsid();
  pid_t origPid = REAL_TO_VIRTUAL_PID (pid);

  DMTCP_PLUGIN_ENABLE_CKPT();

  return origPid;
}
Exemplo n.º 24
0
struct ibv_comp_channel * ibv_create_comp_channel(struct ibv_context
                                                                *context)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
//  PDEBUG("******* WRAPPER for ibv_create_comp_channel\n");

  struct ibv_comp_channel * rslt = _create_comp_channel(context);

  DMTCP_PLUGIN_ENABLE_CKPT();
  return rslt;
}
extern "C" pid_t tcgetpgrp(int fd)
{
  DMTCP_PLUGIN_DISABLE_CKPT();

  pid_t retval = REAL_TO_VIRTUAL_PID( _real_tcgetpgrp(fd) );

  JTRACE ( "tcgetpgrp return value" ) (fd) (retval);
  DMTCP_PLUGIN_ENABLE_CKPT();

  return retval;
}
Exemplo n.º 26
0
int ibv_query_qp(struct ibv_qp * qp, struct ibv_qp_attr * attr,
                 int attr_mask, struct ibv_qp_init_attr *init_attr)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
//  PDEBUG("******** WRAPPER FOR ibv_query_qp\n");

  int rslt = _query_qp(qp, attr, attr_mask, init_attr);

  DMTCP_PLUGIN_ENABLE_CKPT();
  return rslt;
}
Exemplo n.º 27
0
int ibv_get_cq_event(struct ibv_comp_channel *channel, struct ibv_cq **cq,
                        void **cq_context)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
//  PDEBUG("******** WRAPPER for ibv_get_cq_event");

  int rslt = _get_cq_event(channel, cq, cq_context);

  DMTCP_PLUGIN_ENABLE_CKPT();
  return rslt;
}
Exemplo n.º 28
0
int ibv_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
                   int attr_mask) //int attr_mask)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
//  PDEBUG("********* WRAPPER for ibv_modify_qp\n");

  int rslt = _modify_qp(qp, attr, attr_mask);

  DMTCP_PLUGIN_ENABLE_CKPT();
  return rslt;
}
int shmctl(int shmid, int cmd, struct shmid_ds *buf)
{
  DMTCP_PLUGIN_DISABLE_CKPT();
  int ret = _real_shmctl(shmid, cmd, buf);
  if (buf != NULL) {
    buf->shm_cpid = REAL_TO_VIRTUAL_PID(buf->shm_cpid);
    buf->shm_lpid = REAL_TO_VIRTUAL_PID(buf->shm_lpid);
  }
  DMTCP_PLUGIN_ENABLE_CKPT();
  return ret;
}
extern "C" int waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options)
{
  int retval = 0;
  struct timespec sleepTime = {0, 1000};
  siginfo_t siginfop;
  memset(&siginfop, 0, sizeof(siginfop));

  /* waitid returns 0 in case of success as well as when WNOHANG is specified
   * and we need to distinguish those two cases.man page for waitid says:
   *   If WNOHANG was specified in options and there were no children in a
   *   waitable  state, then waitid() returns 0 immediately and the state of
   *   the siginfo_t structure pointed to by infop is unspecified.  To
   *   distinguish this case from that where a child was in a  waitable state,
   *   zero out the si_pid field before the call and check for a nonzero value
   *   in this field after the call returns.
   *
   * See comments above wait4()
   */
  while (retval == 0) {
    DMTCP_PLUGIN_DISABLE_CKPT();
    pid_t currPid = VIRTUAL_TO_REAL_PID (id);
    retval = _real_waitid (idtype, currPid, &siginfop, options | WNOHANG);

    if (retval != -1) {
      pid_t virtualPid = REAL_TO_VIRTUAL_PID ( siginfop.si_pid );
      siginfop.si_pid = virtualPid;

      if ( siginfop.si_code == CLD_EXITED || siginfop.si_code == CLD_KILLED )
        dmtcp::VirtualPidTable::instance().erase(virtualPid);
    }
    DMTCP_PLUGIN_ENABLE_CKPT();

    if ((options & WNOHANG) ||
        retval == -1 ||
        siginfop.si_pid != 0) {
      break;
    } else {
      if (sleepTime.tv_sec == 0) {
        sleepTime.tv_nsec *= 2;
        if (sleepTime.tv_nsec >= 1000 * 1000 * 1000) {
          sleepTime.tv_sec++;
          sleepTime.tv_nsec = 0;
        }
      }
      nanosleep(&sleepTime, NULL);
    }
  }

  if (retval == 0 && infop != NULL) {
    *infop = siginfop;
  }

  return retval;
}