📄 mm_describe_states.c
字号:
g_timer_state[MPID_STATE_SOCK_WAIT].name = "sock_wait"; g_timer_state[MPID_STATE_SOCK_SET_USER_PTR].name = "sock_set_user_ptr"; g_timer_state[MPID_STATE_SOCK_READ].name = "sock_read"; g_timer_state[MPID_STATE_SOCK_READV].name = "sock_readv"; g_timer_state[MPID_STATE_SOCK_WRITE].name = "sock_write"; g_timer_state[MPID_STATE_SOCK_WRITEV].name = "sock_writev"; g_timer_state[MPID_STATE_SOCK_POST_READ].name = "sock_post_read"; g_timer_state[MPID_STATE_SOCK_POST_READV].name = "sock_post_readv"; g_timer_state[MPID_STATE_SOCK_POST_WRITE].name = "sock_write"; g_timer_state[MPID_STATE_SOCK_POST_WRITEV].name = "sock_writev"; g_timer_state[MPID_STATE_SOCK_EASY_RECEIVE].name = "sock_easy_receive"; g_timer_state[MPID_STATE_SOCK_EASY_SEND].name = "sock_easy_send"; return 0;}#endif /* USE_LOGGING == MPID_LOGGING_DLOG *//* This section of code is for the RLOG logging library */#if (USE_LOGGING == MPID_LOGGING_RLOG)#include <math.h>/* utility funcions */#ifndef RGB#define RGB(r,g,b) ((unsigned long)(((unsigned char)(r)|((unsigned short)((unsigned char)(g))<<8))|(((unsigned long)(unsigned char)(b))<<16)))#endifstatic unsigned long getColorRGB(double fraction, double intensity, unsigned char *r, unsigned char *g, unsigned char *b){ double red, green, blue; double dtemp; fraction = fabs(modf(fraction, &dtemp)); if (intensity > 2.0) intensity = 2.0; if (intensity < 0.0) intensity = 0.0; dtemp = 1.0/6.0; if (fraction < 1.0/6.0) { red = 1.0; green = fraction / dtemp; blue = 0.0; } else { if (fraction < 1.0/3.0) { red = 1.0 - ((fraction - dtemp) / dtemp); green = 1.0; blue = 0.0; } else { if (fraction < 0.5) { red = 0.0; green = 1.0; blue = (fraction - (dtemp*2.0)) / dtemp; } else { if (fraction < 2.0/3.0) { red = 0.0; green = 1.0 - ((fraction - (dtemp*3.0)) / dtemp); blue = 1.0; } else { if (fraction < 5.0/6.0) { red = (fraction - (dtemp*4.0)) / dtemp; green = 0.0; blue = 1.0; } else { red = 1.0; green = 0.0; blue = 1.0 - ((fraction - (dtemp*5.0)) / dtemp); } } } } } if (intensity > 1) { intensity = intensity - 1.0; red = red + ((1.0 - red) * intensity); green = green + ((1.0 - green) * intensity); blue = blue + ((1.0 - blue) * intensity); } else { red = red * intensity; green = green * intensity; blue = blue * intensity; } *r = (unsigned char)(red * 255.0); *g = (unsigned char)(green * 255.0); *b = (unsigned char)(blue * 255.0); return RGB(*r,*g,*b);}static unsigned long random_color(unsigned char *r, unsigned char *g, unsigned char *b){ double d1, d2; d1 = (double)rand() / (double)RAND_MAX; d2 = (double)rand() / (double)RAND_MAX; return getColorRGB(d1, d2 + 0.5, r, g, b);}static char random_color_str[40];static char *get_random_color_str(){ unsigned char r,g,b; random_color(&r, &g, &b); sprintf(random_color_str, "%3d %3d %3d", (int)r, (int)g, (int)b); return random_color_str;}int MPIDU_Describe_timer_states(){ /* mpid functions */ RLOG_DescribeState(g_pRLOG, MPID_STATE_MPID_ISEND, "MPID_Isend", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_MPID_IRECV, "MPID_Irecv", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_MPID_SEND, "MPID_Send", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_MPID_RECV, "MPID_Recv", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_MPID_PROGRESS_TEST, "MPID_Progress_test", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_MPID_ABORT, "MPID_Abort", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_MPID_CLOSE_PORT, "MPID_Close_port", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_MPID_COMM_ACCEPT, "MPID_Comm_accept", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_MPID_COMM_CONNECT, "MPID_Comm_connect", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_MPID_COMM_DISCONNECT, "MPID_Comm_disconnect", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_MPID_COMM_SPAWN_MULTIPLE, "MPID_Comm_spawn_multiple", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_MPID_OPEN_PORT, "MPID_Open_port", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_MPID_PROGRESS_WAIT, "MPID_Progress_wait", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_MPID_REQUEST_RELEASE, "MPID_Request_release", get_random_color_str()); /* bsocket functions */ RLOG_DescribeState(g_pRLOG, MPID_STATE_BACCEPT, "baccept", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_BBIND, "bbind", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_BCLOSE, "bclose", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_BCLR, "bclr", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_BCONNECT, "bconnect", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_BCOPYSET, "bcopyset", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_BEASY_ACCEPT, "beasy_accept", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_BEASY_CLOSESOCKET, "beasy_closesocket", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_BEASY_CONNECT, "beasy_connect", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_BEASY_CREATE, "beasy_create", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_BEASY_GET_IP, "beasy_get_ip", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_BEASY_GET_IP_STRING, "beasy_get_ip_string", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_BEASY_GET_SOCK_INFO, "beasy_get_sock_info", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_BEASY_RECEIVE, "beasy_receive", get_random_color_str()); RLOG_DescribeState(g_pRLOG, MPID_STATE_BEASY_RECEIVE_SOME, "beasy_receive_some", get_random_color_str());
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -