C :: Write Message Passing Interface Program For Implementing Graph Coloring?
Mar 21, 2013write mpi-c program for implementing graph coloring?(mpi-message passing interface used for parallel programming)
View 2 Replieswrite mpi-c program for implementing graph coloring?(mpi-message passing interface used for parallel programming)
View 2 RepliesI'm implementing parallel gaussian elimination using message passing. However, there is a problem with allocations and I don't get the correct answer. The matrix A is decomposed into smaller matrices (ie subA) and used into a buffer.
int n = 2; // for matrix size 1024 (additionally 2048 and 4096 was calculated)
#define MAXN 2
volatile float **a, *b, x[MAXN];
// generate a and b randomly; x is set to 0
void generateMatrix() {
[Code] ....
I've been using a timer to refresh the listview on my application, but after half a second, I get the error message at first try/catch method in RefreshPlot() in PlotComponent.cs:
Quote An exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in Marketplace.exe but was not handled in user code
Additional information: There is already an open DataReader associated with this Connection which must be closed first.
I was assigned a project to implement a real time graph to an application which continuously outputs data numerically through the GUI. The application that was created to do this is written in C.
I have to turn those numerical numbers into a graphical display that is periodically updated to appear as real time.
My adviser suggested using NTgraph [URL] ...... I had no clue how to implement this to my code and was finally able to understand that the .OCX needs to be registered as a COM and then imported to the application using visual studios. However, I get an error when I try importing it since it is in C (Visual Studios 8) and not an MFC application.
So my question is if it would be possible to implement the ActiveX control to my application even though it is not an MFC application and how to go about it.
Write an interactive text based menu interface (using a loop) that will allow the user to
Enter a task or assignment Display all of the tasks that are in the file Find a task by Course Quit For each task, you need to keep track of:
Course Name that it is for (e.g., CS162)
Description of the assignment (e.g., Finish Lab 2)
Due date (e.g., 9/26/2009)
Allow the program to keep looping until user wants to quit. When the program starts, it should load the tasks from external file ("tasks.txt") into memory. When user enters the three items of a task, the program needs to read them in, save them in memory and eventually write them to the external data file ("tasks.txt"). The file format could look like: (The ';' is used as a delimiter or field seperator.)
Some Implementation Requirements:
Write at least four functions WITH arguments for this assignment. Use struct named Task to model task Use array of structs to model the collection of tasks. Hint: In this assignment, the description and course name may have multiple words in it. Therefore, you now SHOULD read using the 3 argument version of get. Watch out. When using the 3 argument version of get you need to make sure to remove the delimiter or newline. Therefore, anytime you read (even a confirmation message), make sure to eat the newline! Make sure to have a delimiter written between each item in the file – like a newline. This will be important when you read the information back from the file.
This is my code so far:
#include <iostream>
int main()
{
char cname[25],desc[20];
[Code]....
I have a DLL developed using pure VC++ (all unmanaged code that doesn't use .NET framework). This DLL will be deployed in different client PCs within a network and will act like an agent.
Now I have establish a communication between this DLL and a WCF web service, that will be deployed in a server PC. The Service will first get a list of PCs either name or IP Address within a network using LDAP (Active Directory) and once, we get the PCs, I have to establish a communication between the web service and the agents that reside in these client PCs,
How can I accomplish this?
I have a crash on a application the customer machine i couldn't reproduce it yet on my machine... all i have is the error message
The Instruction 0x0070478b referencing to the memory 0x00000000 could not be written.
And that's all i have how do i track that instruction on my program from that address? is it possible?
this is my first year programming, and in my class, each week we have to write a program. last week we wrote a program in c that made random value point and made a graph of the random points that continued on forever. this week, we have to use statistical functions to find the sum, mean, max, and min of the graph. below is the code i have so far.
Code:
#include <stdlib.h>
#include <strings.h>
#include <stdio.h>
#include <stdbool.h>
#include "SwinGame.h"
[code]....
so, as you can see from the code, the parts i need are finding/ coming up with a function to find the max min sum and mean of the functions.
For this program i had to create an HTML with the cosine similarities. I got everything, i just need to color in the lowest and highest amount in the table, but I don't know how.
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <iomanip>
#include <string>
#include <cstdio>
using namespace std;
const int ARRAY_OF_ASCII_CODES_SIZE=256;
const int NUMBER_OF_FILES=8;
[Code] .....
I recently made a heightmap, it uses a triangle strip /row, and I try to figure out how can i color the triangles one by one. So, for example I have a color array of 9:
[0.0f,0.2f,0.6f //a triangles first vertex
0.0f,0.4f,0.3f //second vertex
0.0f,0.7f,0.2f] //third vertex
And I want to use it to color all triangles with it. My heightmap coords are in a vector:
vector<GLfloat> hmapcrds [x1,h1,z1; x2,h2,z2;...]
Like this:
c1 c2 c3 c4 c5 //row 1
c6 c7 c8 c9 c10 //row 2 coordinates
index array:c6->c1->c7->c2 ...cn->c(n-rwosize)->c(n+1)->cn->c(n-rwosize+1)
I draw my elements with a VAO and drawelements/row; (i tried drawrange but didnt work)
...
glGenVertexArrays(1,&VertArrObj);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,indexBuffer);
glBufferData(GL_ELEMENT_ARRAY_BUFFER,sizeof(GLuint)*v_heightIndexes.sie(),&v_heightIndexes[0],GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER,vertexBuffer);
[Code] ....
I think it want to index my color array too, so how can i do that it only reads the 3 colors from my array, the repeat it /vertex/triangle till the end of drawing.
The shaders work fine, i changed the map to a triangle so it applied these colors, but with the map "I see only darkness before me".
with my working shader without color "in" - height coloring: [URL] ....
(I also want to do texturing per triangle.)
It is supposed to calculate and graph time vs. distance. The problem I have is graphing, if I put too small values for Vi, which is the initial velocity, it just graphs one or two points, because t is too small. I already tried to adjust t with 'if(t<10) t=t*10; if (t>100) t=t/10;', But it seems not to solve my problem.
Other truble I have is that, as the graph is parabola, core values are very close together, and when plotted, these values are in the same line on the screen.
Here is my code:
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main() {
float x, y, hmax, t, amax, vi, v, a, b, g, ang; /*x= x coordinate, y= y coordinate, hmax= maximum height,
[Code] .....
I am fairly new to the topic of the ethernet and the data link layer and I am trying to write a C program which allows the sending and receiving of ethernet frames.
I am trying to have my program send the ethernet frame to myself, so the program will have the same source and destination mac addresses.
The program that I'm using is a modified version of the code from [URL] ....
I keep having trouble with the recvfrom() function, it seems to just be blocking and the program doesn't terminate. From the code, I am trying send the ethernet frame and have the recvfrom() function be able to retrieve the frame and store it in a buffer. But because recvfrom() function is just blocking, it seems to me that the sendto() function was not able to successfully send the frame.
Here is my code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h> /* Must precede if*.h */
#include <linux/if.h>
#include <linux/if_ether.h>
[Code] ....
This is on a linux machine ....
I'm trying to parallelize bottom's up merge sort algorithm. Firstly, i must have working procedural code.
I rember I had my code working last week but I made some changes ( probably to arguments passed to sort function ), i run my program several times without rebuilding it so i though it's still working.
Now i came back to my code and my program terminates without any message which confuses me. I debbuged merge function and it seems to work well, at the end i have sorted array.
fprintf doesn't print any value to my stdout.
whole code : [C] mergesort - Pastebin.com
I want to be able to type a message into another program (such as notepad) using C++. How would I do that? Is there a function to do this, or an event, or something?
View 4 Replies View RelatedI am starting this project on how to encode and decode messages that are inputted, how to start this?
View 4 Replies View RelatedI am writing a porgram which includes encoding and decoding a message.Now I am doing the encoding part.
The goal is to encode a message using similar approach as Caesar Cipher. But instead of alphabets, I am going to use the entire ASCII code of total 128 codes to be the base.
And it is not a simple shifting, it is a rotation. This means if you want to shift 4 units from char <DEL>, it will come back to the first code in ASCII Code which is at dec 0 char <NUL> and starts the shifting again. It won't jump if the limit of ASCII Code is reached.
Here we've got 7 different malls' names and I am going to encode them with a shift n. I think n is free to set, so here I just set it as 5. This is also called the key.
I have written something and I think it should work, but after all it doesn't. And I don't get what is wrong.
Here is my program:
#include <iostream>
using namespace std;
const int NUMBER_OF_MALLS = 7;
const int MALL_NAME_LENGTH = 13;
const int NAME_SIZE = MALL_NAME_LENGTH + 1;
void encode(int key, char plain[], int length, char encoded[]) {
for (int i = 0; i < MALL_NAME_LENGTH; i++)
[code].....
Note that I am not going to use other libraries, just <iostream>.
How do I write a program that'll interpret "M" and "F" inputs and print a "you're a guy" or "you're a gurl" message?
Code:
#include <stdio.h>
#include <conio.h>
char gender;
char main(void) {
printf("type M or F
[Code] ....
I need to have a program display an error message if the variable entered isn't an integer but then I want it to cin again. I have this but it doesn't work:
cout << "Enter an Integer: " ;
for (;;) {
cin >> var;
if (!cin) {
[Code] ....
I am not sure how to do what I want and this doesn't work, it just repeats That wasn't an int.. over and over again.
I am writing a program to auto login in a web site. Before making next attempt I have to wait for some time like some 10 seconds(it is configurable). But during waiting UI should not freeze. I wrote code something like this. Here event m_hEvent[1]) will be set by another thread after 10 seconds.The problem is UI still freezes some times!
while(1)
{
//m_hEvent[1] will be set by another thread after 10 seconds
dwRet = MsgWaitForMultipleObjects(1, &m_hEvent[1], FALSE, dwMilliseconds, QS_ALLINPUT);
ResetEvent(m_hEvent[1]);
[Code] ....
I have the following scenario: I plan to have an xml configuration file.I have a trader that lunch few strategies, each have different configurations. I plan to have all configuration reside in the same file as different nodes.
Now I want that each strategy will hard code the name of node it will loop up for its parameters. Since those paramters are requered for the init and I use DI (configuration are passed in the constructor) I want to make it static.
So this would be something like.
public class Strategy: Base_strategy{
public const string _conf_name = "XXX";
public static string get_conf_name(){
[Code]....
Since other people will code strategies, I want each strategy to implement this static function. I wanted to do this in an interface so that anyone coding new strategy,implementing the base strategy will have to code this static function as part of the contract.
For instance Code: int counter;
counter =0;
FILE *pfile;
pfile= fopen("g:myprog.txt" "w");
while (counter >100)
{ fprintf (case counter{something})}; how do I do this?
I had a project to create an ATM with a database of 100 customers, i wasn't able to interface the real program with the database. I have submitted the project already. Here is the database and the ATM program
#include <stdio.h>
int main(void) {
int account, pin;
[Code]....
I am supposed to write a C program to send through USB interface to the analog device AD9914. Now I am doing the USB interface part where my computer has to detect the AD when it is plugged in and send the signals to it. I have to write the program to detect the device when it is plugged in. What kind of functions can I use? I know that the registry stores the device when it is plugged in. What functions are available to read?
View 2 Replies View RelatedI am not 100% confident that changing the existing interfaces will not be error-prone. Should I discard the new changes for ease of use or Adapt to new changes but having a higher risk of introducing new bugs?
old
Code:
///ContactResultCallback is used to report contact points
structContactResultCallback {
short intm_collisionFilterGroup;
short intm_collisionFilterMask;
[Code] ....
New:
Code:
///ContactResultCallback is used to report contact points
structContactResultCallback {
short intm_collisionFilterGroup;
short intm_collisionFilterMask;
[Code] ....
I have a batch of .pdf files (~1000) with names 001.pdf 002.pdf ...etc. Still pretty new to C, but would it be possible to write a program that would open a PDF, prompt a new name from user, and when entered, close the .pdf and open the next one in the list?
View 14 Replies View RelatedI want to write a bootable c/c++ Hello World. How can i do that?
View 2 Replies View Related