Структура вычислительной системы: трехмерная с размерностью 4х4х3, страница 3

Список литературы.

1.  Жиратков В.И. «Вычислительные системы большой производительности», НГТУ, метод. пособие, 1993.

2.  Медведев Е.Г. Курс лекций. (7 семестр).


Приложение 1 .

// cpu.h : header file

/////////////////////////////////////////////////////////////////////////////

class cpu

{

public:

                  cpu(int);

                  int numcpu;//номер CPU

                  int bitrab;//признак работоспособности

                  int pnumzad[100];// номера задач, которые обрабатывает этот CPU

                  int ppispcpu[100];//трудоемкость этих задач на данном CPU

                  int kolzad;

// Implementation

public:

                  virtual ~cpu();

protected:

                  //{{AFX_MSG(cpu)

                                    // NOTE - the ClassWizard will add and remove member functions here.

                  //}}AFX_MSG

};

// cpu.cpp : implementation file

#include "stdafx.h"

#include "vkss1.h"

#include "cpu.h"

#ifdef _DEBUG

#define new DEBUG_NEW

#undef THIS_FILE

static char THIS_FILE[] = __FILE__;

#endif

/////////////////////////////////////////////////////////////////////////////

cpu::cpu(int a)

{                numcpu=a;

                  bitrab=1;

                  kolzad=0;

                  for(int i=0;i<100;i++)

                  {

                                    pnumzad[i]=0;

                                    ppispcpu[i]=0;

                  }

}

cpu::~cpu()

{               

}

/////////////////////////////////////////////////////////////////////////////

// zadacha.h : header file

//

class zadacha

{

public:

                  zadacha();

public:

                  int numzad;// № задачи

                  int P;//мощность

                  int time;

                  int numcpu[110];//Номер CPU которые обрабатывают эту задачу

public:

                  virtual ~zadacha();

protected:

};

/////////////////////////////////////////////////////////////////////////////

// zadacha.cpp : implementation file

//

#include "stdafx.h"

#include "vkss1.h"

#include "zadacha.h"

#ifdef _DEBUG

#define new DEBUG_NEW

#undef THIS_FILE

static char THIS_FILE[] = __FILE__;

#endif

/////////////////////////////////////////////////////////////////////////////

zadacha::zadacha()

{for(int r=0;r<110;r++)numcpu[r]=0;}

zadacha::~zadacha()

{}

// Vkss1Dlg.h : header file

//

#include "zadacha.h"

#include "cpu.h"

class CVkss1Dlg : public CDialog

{

public:

                  CVkss1Dlg(CWnd* pParent = NULL);   // standard constructor

                  ~CVkss1Dlg();

                  enum { IDD = IDD_VKSS1_DIALOG };

                  CListBox  m_Lcpu;

                  int                                m_P;

                  int                                m_time;

                  int                                m_numzp;

                  int                                m_ndelcpu;

                  zadacha *m_pz[100];

                  zadacha *ocher[300];

                  int kolzocher;

                  int m_kolz;// колич задач в системе

                  cpu *m_pcpu[48];

                  void RasprZad(zadacha*,int);

                  void DelstrLcpu();

                  void AddstrLcpu();

                  int SumT();

                  protected:

                  virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

                  //}}AFX_VIRTUAL

protected:

                  afx_msg void OnAddZad();

                  afx_msg void OnChangeEdit1();

                  afx_msg void OnChangendelcpu();

                  afx_msg void OnClok();

                  afx_msg void OnDestroy();

                  afx_msg void Ondelcpu();

                  afx_msg void OnChangeEdit2();

};

// Vkss1Dlg.cpp : implementation file

//

#include "stdafx.h"