Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suspend #75

Merged
merged 9 commits into from
Nov 6, 2015
Merged

Suspend #75

merged 9 commits into from
Nov 6, 2015

Conversation

carothersc-zz
Copy link
Member

Use this functionality by calling tw_lp_suspend in your event handler. An example is:

if( lp->gid == 0)
{
    printf("LP 0 is suspended at TS = %lf - should only get this once!!\n", tw_now(lp));
    tw_lp_suspend( lp, 0, -31459 );
    return;
}

@codecov-io
Copy link

Current coverage is 74.63%

Merging #75 into master will increase coverage by +1.13% as of bca71bb

@@            master     #75   diff @@
======================================
  Files           25      25       
  Stmts         2457    2456     -1
  Branches         0       0       
  Methods                          
======================================
+ Hit           1806    1833    +27
  Partial          0       0       
+ Missed         651     623    -28

Review entire Coverage Diff as of bca71bb

Powered by Codecov. Updated on successful CI builds.

dest_lp->suspend_event == event &&
// Must test time stamp since events are reused once GVT sweeps by
dest_lp->suspend_time == event->recv_ts)
{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the event pointer / timestamp checks sufficient to avoid issues with event ties in optimistic mode? Not sure what the semantics regarding ordering of ties are.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi John - yes, absolutely - no other event will have both the same pointer and time stamp.

Note, the time stamp is used solely to check that the event has not been re-used since
the LP was suspended. That is you suspend an LP and it presists til the end of the simulation.
That event will be re-used many times -- in fact once GVT sweeps by, you know that LP
will be suspended til the end ..

Make sense ?

thanks for the code review ...
Chris

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. Happy to help review, I was after all pestering for the feature :).

// unsuspend the LP
dest_lp->suspend_event = NULL;
dest_lp->suspend_time = 0.0;
dest_lp->suspend_error_number = 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suspend flag needs to be unset here - otherwise, a suspended lp always stays suspended (and future RCs are never processed).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the catch John.

There was a case where you don't want to unset the flag.

Let me read the code and double check that this is not that
case..

thanks,
Chris

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi John - I just pushed the fix.
thanks,
Chris

@JohnPJenkins
Copy link

So I pulled in your suspend flag fix and re-tested the codes suite. The new suspend code works as expected!

@carothersc-zz
Copy link
Member Author

Great news!

Thanks,
Chris


Christopher D. Carothers

Director, Center for Computational Innovations
Professor, Department of Computer Science
Rensselaer Polytechnic Institute
110 8th Street
Troy, New York 12180-3590

e-mail: chris.carothers@gmail.com
web page: www.cs.rpi.edu/~chrischttp://www.cs.rpi.edu/%7Echrisc
phone: (518) 276-2930tel:%28518%29%20276-2930

fax: (518) 276-4033tel:%28518%29%20276-4033


From: John Jenkins [notifications@github.com]
Sent: Monday, November 02, 2015 10:50 AM
To: carothersc/ROSS
Cc: Carothers, Christopher D.
Subject: Re: [ROSS] Suspend (#75)

So I pulled in your suspend flag fix and re-tested the codes suite. The new suspend code works as expected!


Reply to this email directly or view it on GitHubhttps://github.com/carothersc/ROSS/pull/75#issuecomment-153059385.

gonsie added a commit that referenced this pull request Nov 6, 2015
@gonsie gonsie merged commit 52b7a19 into master Nov 6, 2015
@laprej laprej deleted the suspend branch November 6, 2015 16:51
@gonsie
Copy link
Member

gonsie commented Nov 6, 2015

closed #15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants