tlog.c

来自「Path MPICH-V for MPICH the MPI Implement」· C语言 代码 · 共 57 行

C
57
字号
/*  MPICH-V2  Copyright (C) 2002, 2003 Groupe Cluster et Grid, LRI, Universite de Paris Sud  This file is part of MPICH-V2.  MPICH-V2 is free software; you can redistribute it and/or modify  it under the terms of the GNU General Public License as published by  the Free Software Foundation; either version 2 of the License, or  (at your option) any later version.  MPICH-V2 is distributed in the hope that it will be useful,  but WITHOUT ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  GNU General Public License for more details.  You should have received a copy of the GNU General Public License  along with MPICH-V2; if not, write to the Free Software  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  $Id: tlog.c,v 1.2 2004/04/01 10:59:30 bouziane Exp $*/#include "config.h"#include "debug.h"int main(int argc, char *argv[]){  int i;  char *init[12] = { "m1", "m2" ,"m3", "m4", "m5", "m6" ,"m7", "m8", "m9",		     "m10", "m11", "m12" };  char *tag[32];  char *msg[64];  for(i = 0; i < 32; i++)    {      tag[i] = (char*)malloc(128);      sprintf(tag[i], "tag%d", i);    }    for(i = 0; i < 64; i++)    {      msg[i] = (char*)malloc(128);      sprintf(msg[i], "message number %d ...", i);    }  for(i = 0; i < 10000; i++)    {      if( (rand() % 8) == 0)	initDebug(init[rand() % 12], argv[1]);      else	printi(tag[rand()%32], msg[rand()%64]);    }  return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?